Skip to main content
In this guide, we demonstrate how to upgrade a Kubernetes cluster from version 1.28 to 1.29 using kubeadm. We follow the official “Upgrading a Kubeadm Cluster” instructions from the Kubernetes documentation. For further details, refer to the “Upgrading a Kubeadm Cluster” section in the Kubernetes Documentation.
The image shows a webpage from Kubernetes documentation about upgrading
kubeadm clusters, detailing version updates and providing links for further
information.
The documentation provides dedicated instructions for each upgrade path. In this case, we are upgrading from 1.28 to 1.29 (the latest release). Similar procedures exist for other upgrade paths (e.g., 1.27 to 1.28, 1.26 to 1.27, etc.). Simply select the correct upgrade path and follow the detailed steps accordingly.

Updating Package Repositories

Before beginning the upgrade, review the updated package repository information. The legacy repositories (app.kubernetes.io and yum.kubernetes.io) have been deprecated. Moving forward, packages are available at packages.k8s.io. This repository now hosts the latest versions of essential tools such as kubectl and kubeadm.
The image shows a Kubernetes documentation page about changing package
repositories, highlighting the deprecation of legacy repositories and
recommending new ones from September 13,
2023.
Before proceeding, confirm that you are using the new package repositories. Check the documentation and click the provided link for the latest instructions.

Verify Your Node OS and Repository Setup

First, determine your node distribution because the commands differ slightly by operating system. For example, on a two-node cluster, run:
An example output may be:
To check your OS distribution, use:
Example output for Ubuntu 20.04.6 LTS (Debian-based):
For Debian/Ubuntu systems, update the repository to the new endpoint. First, switch to the new URL for your version upgrade. For version 1.29, execute:
Next, download the public signing key:
Remember to adjust the version numbers (e.g., change to 1.29) in both commands as needed during the upgrade process.
After making these updates on the control plane and worker nodes, run:

Upgrading the Control Plane

Step 1: Upgrade kubeadm

On the control plane node, list the available kubeadm versions:
A typical output may appear as follows:
Select the latest version (in this example, 1.29.3-1.1) and upgrade kubeadm with:
Verify that the kubeadm upgrade is successful by checking the version:
Expected output:

Step 2: Run the Upgrade Plan

Before applying the upgrade, conduct a dry run to ensure compatibility:
This command displays the upgrade details, including the components automatically upgraded and those requiring manual intervention (e.g., kubelet). A sample output might look like:
Kubeadm upgrades most of the control plane components automatically but leaves the kubelet for manual upgrade.

Step 3: Apply the Control Plane Upgrade

Upgrade your control plane with:
Monitor the process as it renews certificates, updates static Pod manifests, and applies configuration changes. Once complete, you should see a success message such as:
Note: Until kubelet is upgraded, kubectl get nodes will still display version v1.28.0 for the kubelet.

Upgrading kubelet and kubectl on the Control Plane

Step 1: Drain the Control Plane Node

Before updating kubelet and kubectl, drain the control plane node:

Step 2: Upgrade Packages

Next, upgrade kubelet and kubectl to version 1.29.3-1.1:
Reload the systemd configuration and restart the kubelet service:
Finally, uncordon the control plane node to allow pods to be scheduled:
Verify the upgrade by checking the node versions:
The control plane should now reflect version v1.29.3.

Upgrading Worker Nodes

For each worker node, perform the following steps:
  1. Upgrade kubeadm:
  2. Update Node Configuration: Run the command on the control plane to update the node configuration:
    This command refreshes the node configuration without upgrading the kubelet package.
  3. Drain the Worker Node: Use the node name (e.g., node01) to drain it:
  4. Upgrade kubelet and kubectl: Execute the following commands on the worker node:
    Reload and restart kubelet:
  5. Uncordon the Worker Node:
After upgrading all worker nodes, verify that every node in the cluster is running version v1.29.3:

Summary

This guide detailed the process of upgrading a Kubernetes cluster using kubeadm by:
  1. Updating package repositories to the new packages.k8s.io.
  2. Upgrading kubeadm on the control plane and verifying the available versions.
  3. Running a dry-run upgrade plan to check compatibility.
  4. Applying the control plane upgrade.
  5. Upgrading kubelet and kubectl on both the control plane and worker nodes while minimizing downtime by draining and uncordoning nodes.
Following these steps will ensure that your cluster components run on v1.29.3 securely and efficiently. Happy upgrading!

Watch Video

Practice Lab