Skip to content
Switch branches/tags
Go to file
Latest commit e4dd1e8 Jul 14, 2020 History
1 contributor

Users who have contributed to this file

Installing kubernetes with kubeadm on Ubuntu 16.04+/Debian 9+/HypriotOS v1.0.1+

Installing kubeadm kubectl kubelet

Copy paste the below snippet one by one in your CLI terminal - This is for both Master and Worker Nodes

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

Initialize kubeadm - This is only for Master

kubeadm init

Setting up kubeconfig - This is only for Master Node

  mkdir -p $HOME/.kube
  sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
  sudo chown $(id -u):$(id -g) $HOME/.kube/config

Copying token from kubeadmn init snippet - This you should copy from Master. This you will get from Master node only

kubeadm join <control-plane-host>:<control-plane-port> --token <token> --discovery-token-ca-cert-hash sha256:<hash>

Installing Network Plugin - This is only for Master Node

kubectl apply -f "$(kubectl version | base64 | tr -d '\n')"

Joining Worker Nodes - This is only for Worker Nodes

kubeadm join --token <token> <control-plane-host>:<control-plane-port> --discovery-token-ca-cert-hash sha256:<hash>


Please do not run Master node snippet commands on Worker Nodes.