Overview
This article walks the installer through the process of upgrading K8S from a previous version. In working through the installation, references will be made as appropriate to provide context.System Parameters/Versions:
-
Base OS:
-
Amazon Linux 2023:
ami-05576a079321f21f8 - Rocky 8.10
-
Amazon Linux 2023:
-
K8S
- current version: v1.30.9
- upgrade version: v1.31.7
Requirements:
K8S must be upgraded incrementally from each version. As an example, if upgrading from v1.29 to v1.31, you must install each increment and repeat the process until the desired version is installed:- v1.29 → v1.30
- v1.30 → v1.31
Upgrade K8S
Step 1: Check Current Versions
kubeadm, kubelet, and kubectl versions must match. Verify that the current versions are the same:
kubeadm version:
kubectl version:
kubelet version:
Step 2: Update Base OS
On ALL nodes in the cluster (master, worker, and gpu). Each base OS has different package updates.- Amazon Linux 2023:
- Rocky 8:
Step 3: Update Repository Config
On ALL nodes in the cluster (master, worker, and gpu), update repository config file to desired version. In this example, using v1.31:Step 4: Upgrade Control Plane Kubeadm
On the master node, upgradekubeadm. Worker/GPUs nodes will be updated separately.
Get list of possible upgrade versions:
kubeadm version:
Step 5: Upgrade Control Plane Components
On the master node, upgrade control plane components. Run a plan to show what can/will be updated:kube-system pods. If the upgrade was successful, the kube* pods will have a newer age than the others:
Step 6: Upgrade Control Plane Kubectl and Kubelet
On the master node, upgradekubectl and kubelet components. Versions need to match kubeadm from previous steps (v1.31.7):
kubelet daemon:
kubectl, need to export config:
kubectl version:
kubelet was upgraded successfully to v1.31.7 (other nodes will still show previous version):
Step 7: Upgrade Worker/GPU Node Components
Although the worker and gpu nodes can be upgraded in parallel, it is highly recommended to only upgrade ONE node at a time.kubeadm and kubectl are not required on the worker/gpu nodes (only kubelet); however, in this example going to install all three for possible future use.
NOTE: if workloads/pods need to remain running during upgrade, each node must be drained, cordoned, and pods rescheduled. This example assumes that the cluster is not operational and that the pods will not be reachable until the upgrade is complete.
kubeadm:
kubeadm upgrade:
kubelet and kubectl:
kubelet daemon:
kubectl upgrade:
Step 8: Verify all Nodes Upgraded
On the master node (control plane), confirm the correctkubelet version for all nodes:

