-
-
Save mumoshu/1e497707f0dc31576e213b2ca1e52d97 to your computer and use it in GitHub Desktop.
Setup Kubernetes using kubeadm. In case you provided a wrong control-plane node address, run `sudo kubeadm reset` and try again.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
if [ $# -ne 1 ]; then | |
echo "controle-plane-endpoint is required" 1>&2 | |
exit 1 | |
fi | |
CONTROLE_PLANE_ENDPOINT=$1 | |
set -x | |
sudo apt-get install -y apt-transport-https ca-certificates curl | |
sudo curl -fsSLo /usr/share/keyrings/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg | |
echo "deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list | |
sudo apt-get update | |
sudo apt-get install -y kubelet kubeadm kubectl | |
sudo rm /etc/containerd/config.toml || : | |
sudo systemctl restart containerd | |
sudo kubeadm init --control-plane-endpoint $CONTROLE_PLANE_ENDPOINT | |
mkdir -p ~/.kube | |
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config | |
sudo chown $(id -u):$(id -g) $HOME/.kube/config | |
curl https://get.helm.sh/helm-v3.9.1-linux-amd64.tar.gz -o helm.tar.gz | |
tar -xvf helm.tar.gz | |
sudo mv linux-amd64/helm /usr/local/bin/helm | |
helm repo add cilium https://helm.cilium.io/ | |
helm install cilium cilium/cilium --version 1.12.0 --namespace kube-system |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment