- Take me to Video Tutorial
- No, The components can be at different release versions.
- Upgrading a cluster involves 2 major steps
- One is to upgrade all at once. But then your pods will be down and users will not be able to access the applications.
- Second one is to upgrade one node at a time.
- Third one would be to add new nodes to the cluster
-
kubeadm has an upgrade command that helps in upgrading clusters.
$ kubeadm upgrade plan
-
Upgrade kubeadm from v1.11 to v1.12
$ apt-get upgrade -y kubeadm=1.12.0-00
-
Upgrade the cluster
$ kubeadm upgrade apply v1.12.0
-
If you run the 'kubectl get nodes' command, you will see the older version. This is because in the output of the command it is showing the versions of kubelets on each of these nodes registered with the API Server and not the version of API Server itself
$ kubectl get nodes
-
Upgrade 'kubelet' on the master node
$ apt-get upgrade kubelet=1.12.0-00
-
Restart the kubelet
$ systemctl restart kubelet
-
Run 'kubectl get nodes' to verify
$ kubectl get nodes
-
From master node, run 'kubectl drain' command to move the workloads to other nodes
$ kubectl drain node-1
-
Upgrade kubeadm and kubelet packages
$ apt-get upgrade -y kubeadm=1.12.0-00 $ apt-get upgrade -y kubelet=1.12.0-00
-
Update the node configuration for the new kubelet version
$ kubeadm upgrade node config --kubelet-version v1.12.0
-
Restart the kubelet service
$ systemctl restart kubelet
-
Mark the node back to schedulable
$ kubectl uncordon node-1
-
Upgrade all worker nodes in the same way