Upgrade a Cluster with kubeadm

Upgrading a Kubernetes cluster involves several children to ensure a smooth transition to the new version.

Upgrade the Control Plane

Plans and applies the upgrade to the control plane.

kubeadm upgrade plan
kubeadm upgrade apply <version>

Upgrade kubelet and kubectl

Upgrades the kubelet and kubectl binaries on each node.

apt-get update && apt-get install -y kubelet=<version> kubectl=<version>
systemctl restart kubelet

Upgrade Worker Nodes

Drains each worker node, applies the upgrade, and then marks the node as schedulable again.

kubectl drain <node-name> --ignore-daemonsets --delete-local-data
kubeadm upgrade node
kubectl uncordon <node-name>