Sub topic 15
Upgrading Kubernetes Versions Safely
Kubernetes ships a new minor version (for example 1.30 to 1.31) several times a year, and EKS supports each version for a limited time. This chapter assumes you can run kubectl, eksctl and the AWS CLI, and that you have the demo cluster and managed node group from the earlier chapters. It covers the order of an upgrade, the checks that prevent outages, and what to do when a step stalls.
How EKS Versions Work
EKS follows upstream Kubernetes minor versions. Each version has a support lifecycle:
| Phase | Length | What you get |
|---|---|---|
| Standard support | About 14 months | Patches and normal pricing |
| Extended support | 12 more months | Continued patches for an extra hourly per-cluster fee |
| After extended support | Not applicable | EKS upgrades the control plane for you automatically |
Check the current dates and prices in the EKS documentation before you plan. A cluster that reaches the end of its support does not stay frozen. AWS moves it forward, possibly at a bad time for your workloads.
Three rules shape every upgrade:
- You upgrade the control plane one minor version at a time. Going from 1.29 to 1.31 means two upgrades.
- You cannot roll back a control plane to an older version.
- Nodes must never be newer than the control plane. Recent Kubernetes versions allow kubelets to be up to three minor versions older than the API server. Treat that as a safety margin, not a target.
Your kubectl should also be within one minor version of the cluster.
The Upgrade Order
EKS manages the control plane. You own everything else, so the order matters.
Step 1: Find Problems Before You Upgrade
Each Kubernetes release removes some API versions. A manifest that uses a removed API stops working once the control plane moves on. For example, policy/v1beta1 PodDisruptionBudget was removed in 1.25.
EKS runs checks called upgrade insights. They report deprecated API usage and other blockers for the next version:
aws eks list-insights --cluster-name demo --region us-east-1 \
--filter kubernetesVersions=1.31 \
--query 'insights[].{name:name,status:insightStatus.status}'An insight with status ERROR is a blocker. WARNING needs a look. You can also see which deprecated APIs clients called recently:
kubectl get --raw /metrics | grep apiserver_requested_deprecated_apisEach line names a group, version and resource, and has a removed_release label. Find the clients behind those calls. They are often old Helm charts, CI scripts or controllers, not your own manifests.
Also check these before you start:
- The release notes for the target version, including changes to add-ons.
- At least five free IP addresses in the subnets your cluster uses. EKS creates network interfaces for the new control plane.
- That your Helm charts and third-party controllers (ingress, service mesh, autoscalers) support the target version.
- That every workload with more than one replica has a PodDisruptionBudget (see below).
Step 2: Upgrade the Control Plane
With eksctl:
eksctl upgrade cluster --name demo --region us-east-1 --version 1.31 --approveThe same step with the AWS CLI:
aws eks update-cluster-version --name demo --region us-east-1 --kubernetes-version 1.31The upgrade usually takes 20 to 40 minutes. EKS starts new API server instances at the new version, checks that they are healthy, and then retires the old ones. If the new instances fail, EKS leaves the cluster on the old version and marks the update as failed. Your running pods are not affected, because pods run on nodes and keep running while the API server is replaced. During the swap, API calls are served by healthy instances.
Follow progress with the update ID that the command returns:
aws eks describe-update --name demo --region us-east-1 --update-id <update-id>
aws eks describe-cluster --name demo --region us-east-1 --query cluster.versionStep 3: Update Add-ons
Add-ons such as kube-proxy, coredns, vpc-cni and aws-ebs-csi-driver have versions tied to Kubernetes versions. List the compatible versions, then update:
aws eks describe-addon-versions --addon-name coredns --kubernetes-version 1.31 \
--query 'addons[].addonVersions[].{version:addonVersion,default:compatibilities[0].defaultVersion}'
aws eks update-addon --cluster-name demo --region us-east-1 \
--addon-name coredns --addon-version <version-from-list> \
--resolve-conflicts PRESERVEPRESERVE keeps settings you changed by hand. OVERWRITE resets them to the add-on defaults, so use it only when you want that. Update kube-proxy to the version for the new minor, because it must match the nodes you are about to create.
Step 4: Upgrade the Nodes
How you do this depends on the compute option you chose earlier.
- Managed node groups: EKS replaces nodes in a rolling fashion. It launches nodes with the new AMI, cordons and drains old nodes, then terminates them.
- Karpenter: Update the node class AMI selection. Karpenter detects drift and replaces nodes, honouring disruption budgets.
- Self-managed nodes: You create a new Auto Scaling group at the new version, drain the old nodes, then delete the old group.
- Fargate: Each pod runs on its own micro-VM at the control plane version. Delete or restart the pod (for example with a rollout restart) and the replacement starts at the current version.
For a managed node group with eksctl:
eksctl upgrade nodegroup --name ng-1 --cluster demo --region us-east-1 --kubernetes-version 1.31By default the group updates one node at a time. You can speed it up by allowing more unavailable nodes in the config:
apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig
metadata:
name: demo
region: us-east-1
version: "1.31"
managedNodeGroups:
- name: ng-1
instanceType: m5.large
desiredCapacity: 2
minSize: 1
maxSize: 4
updateConfig:
maxUnavailable: 1Use maxUnavailablePercentage instead for large groups. A higher value finishes sooner but removes more capacity at once.
Protecting Workloads While Nodes Drain
Draining a node evicts its pods. Without limits, the drain can evict every replica of a service at the same time. A PodDisruptionBudget (PDB) tells Kubernetes how many pods must stay up:
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: web
spec:
minAvailable: 1
selector:
matchLabels:
app: webManaged node groups respect PDBs, but only for a limited time. If a PDB blocks eviction for about 15 minutes, the update fails with a PodEvictionFailure error. You can retry with the force option, which ignores PDBs. Do that only after you understand why the pod would not move.
Common Failures
- PodEvictionFailure. A PDB with
minAvailableequal to the replica count (or a single-replica Deployment withminAvailable: 1) can never be satisfied during a drain. Fix the PDB or scale the workload up. - Pods stuck Pending on new nodes. Check for node selectors, taints, or zone-bound EBS volumes. A volume in one Availability Zone cannot follow a pod to a node in another zone.
- Add-on in
DEGRADEDstate. A manual edit conflicted with the managed version. Checkaws eks describe-addonfor the issue message. - Controllers fail after the control plane upgrade. An old controller version calls a removed API. Upgrade the controller, then retry.
Verify
kubectl version
kubectl get nodes -o wide
kubectl get pods -A | grep -v RunningEvery node should show the new kubelet version. The last command should list only completed jobs or nothing.
Alternative: Blue/Green Clusters
Instead of upgrading in place, you can create a new cluster at the target version and move traffic to it. This allows a rollback, since the old cluster is still running. It costs more, and you must handle data, DNS, and state that lives in the cluster. Many teams use it only for large jumps or risky changes.
Exercise
Your cluster runs 1.29 and you want 1.31. In what order do you act, and why can't you roll the control plane back if the second upgrade goes wrong?
Show answer
Upgrade the control plane to 1.30, update add-ons, upgrade nodes, and verify. Then repeat for 1.31. Control plane upgrades go one minor version at a time. EKS does not support downgrading a control plane, so your only way back is a separate cluster, such as one restored from your manifests and backups. That is why you test on a non-production cluster first.
Exercise
A managed node group update fails with PodEvictionFailure. A Deployment has one replica and a PDB with minAvailable: 1. What is wrong, and what are two ways to fix it?
Show answer
The PDB forbids evicting the only pod, so the drain can never finish. Either scale the Deployment to at least two replicas so one pod can be evicted while another stays available, or relax the PDB (for example maxUnavailable: 1). Forcing the update ignores the PDB and causes brief downtime for that service.