Skip to content

Instantly share code, notes, and snippets.

What would you like to do?

For reference

For each nodes

Installing Docker

sudo apt-get update
sudo apt-get install -y

Installing kubeadm, kubelet and kubectl

sudo apt-get update && sudo apt-get install -y apt-transport-https curl
sudo -i
curl -s | apt-key add -
cat <<EOF >/etc/apt/sources.list.d/kubernetes.list
deb kubernetes-xenial main
sudo apt-get update
sudo apt-get install -y kubelet kubeadm kubectl

Configure cgroup driver used by kubelet on Master Node only

sudo sed -i "s/cgroup-driver=systemd/cgroup-driver=cgroupfs/g" /etc/systemd/system/kubelet.service.d/10-kubeadm.conf

Then restart kubelet:

sudo systemctl daemon-reload
sudo systemctl restart kubelet

Initializing your master only

sudo kubeadm init --apiserver-advertise-address=<master-private-ip> --apiserver-cert-extra-sans= --pod-network-cidr
sudo mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
sudo sysctl net.bridge.bridge-nf-call-iptables=1
sudo KUBECONFIG=/etc/kubernetes/admin.conf
kubectl apply -f

In worker nodes only

sudo kubeadm join --token <token> <master-ip>:<master-port> --discovery-token-ca-cert-hash sha256:<hash>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.