Cloud Native 7 min read

Mastering Kubernetes Hard‑Way Upgrade: From v1.22 to v1.23 Step‑by‑Step

This guide walks you through the hard‑way method for upgrading a Kubernetes cluster from version 1.22 to 1.23, covering prerequisites, master and worker node procedures, package handling, and verification steps to ensure a successful, fully controlled upgrade.

Open Source Linux
Open Source Linux
Open Source Linux
Mastering Kubernetes Hard‑Way Upgrade: From v1.22 to v1.23 Step‑by‑Step

First, the article defines the “hard‑way” approach to Kubernetes upgrades, emphasizing hands‑on learning of each component and the troubleshooting benefits it provides.

It then demonstrates upgrading a cluster from version 1.22 to 1.23 using a step‑by‑step command‑line workflow.

Prerequisites

Back up all critical components, especially application state stored in databases.

Disable swap.

Master node upgrade

Drain the master node, ignoring daemon‑set‑managed pods: #kubectl drain master --ignore-daemonsets Check that the node status shows SchedulingDisabled.

Update the package manager and hold kubectl and kubelet:

#apt-get update
#apt-mark hold kubectl kubelet

Unhold kubeadm, install the desired version, then hold it again:

#apt-mark unhold kubeadm
#apt-get install kubeadm=1.23.1-00
#apt-mark hold kubeadm

Verify the kubeadm version: #kubeadm version Review the upgrade plan and apply it:

#kubeadm upgrade plan
#kubeadm upgrade apply v1.23.1

Unhold and upgrade kubectl and kubelet, then hold them again:

#apt-mark unhold kubelet kubectl
#apt-get install kubelet=1.23.1-00 kubectl=1.23.1-00
#apt-mark hold kubelet kubectl

Restart kubelet and verify its status:

#systemctl restart kubelet
#systemctl status kubelet

Run kubeadm upgrade plan again to confirm everything is upgraded:

#kubeadm upgrade plan

Uncordon the master node so it can schedule pods again:

#kubectl uncordon master

Worker node upgrade

Drain the worker node (use --force if needed):

#kubectl drain worker --ignore-daemonsets --force

Repeat the package‑manager updates, unhold/install/hold kubeadm, then upgrade kubectl and kubelet as done for the master.

Restart kubelet and check node status.

Uncordon the worker node:

#kubectl uncordon worker

After completing these steps, the cluster runs with the master at version 1.23.1 and the worker at the same version, confirming a successful upgrade.

Conclusion

The upgrade process consists of draining each node, temporarily un‑holding the relevant packages, installing the target versions, re‑holding the packages, and finally un‑cordoning the nodes.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

KubernetesLinuxupgradeCluster ManagementkubeadmHard Way
Open Source Linux
Written by

Open Source Linux

Focused on sharing Linux/Unix content, covering fundamentals, system development, network programming, automation/operations, cloud computing, and related professional knowledge.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.