Plan a cluster version upgrade
In this task you'll upgrade a cluster to a new Kubernetes version without breaking apps.
Kubernetes releases a minor version about three times a year and supports each for roughly a year, so upgrades are routine work. Upgrade one minor version at a time: control plane first, then nodes. Nodes may lag the control plane by a few versions (the version skew policy) but never be newer.
The risky part is usually not the upgrade itself but removed APIs: manifests or Helm charts still using an API version the new release deletes. Check for deprecated APIs first, read the release notes, upgrade a test cluster, then drain and upgrade nodes one pool at a time with disruption budgets in place. On kubeadm clusters the order is kubeadm upgrade plan, kubeadm upgrade apply, then each node; on AKS it's the control plane, then node pools, often with surge nodes.
Example. Tollmere Logistics found two Helm charts still using a beta autoscaling API before an upgrade. They updated the charts in the test cluster first, upgraded test, then production a week later, one node pool per evening.
Before you start
You need: Nothing to install: this is a planning task. Time: 20 minutes.
Where to look
- Release notes
- kubectl
- Your manifests and charts
Steps
- Find your current versions:
kubectl versionandkubectl get nodes. - Read the release notes for the next minor version, especially the removed APIs and changed defaults.
- Search your manifests and charts for the removed API versions (or use a checker such as kubent or pluto).
- Write the plan: test cluster first, control plane, then each node pool, with drains respecting disruption budgets and a rollback note.
- Check every critical app has at least two replicas and a disruption budget that allows one pod to go.
Commands
kubectl version
kubectl get nodes -o custom-columns=NAME:.metadata.name,VERSION:.status.nodeInfo.kubeletVersion
# kubeadm clusters
kubeadm upgrade plan
# AKS
az aks get-upgrades -g <rg> -n <cluster> -o table
Watch out for
- Cost
- Surge nodes cost extra for the length of the upgrade.
- Security
- Falling behind is the bigger risk: unsupported versions stop getting security fixes.
- Common mistakes
- Skipping minor versions, upgrading without checking removed APIs, and disruption budgets that allow zero pods to move.
Clean up
Nothing to clean up.
Words to know
- Minor version
- The middle number in a Kubernetes version, such as the 31 in 1.31.
- Version skew policy
- How far apart control plane and node versions may be.
- Deprecated API
- An API version marked for removal in a future release.
- Surge node
- An extra node added during an upgrade so capacity doesn't drop.
Tick off each step and track your progress in the guide.
Open this task in DevOps, Hands On