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.
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 kubeletUnhold kubeadm, install the desired version, then hold it again:
#apt-mark unhold kubeadm
#apt-get install kubeadm=1.23.1-00
#apt-mark hold kubeadmVerify the kubeadm version: #kubeadm version Review the upgrade plan and apply it:
#kubeadm upgrade plan
#kubeadm upgrade apply v1.23.1Unhold 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 kubectlRestart kubelet and verify its status:
#systemctl restart kubelet
#systemctl status kubeletRun kubeadm upgrade plan again to confirm everything is upgraded:
#kubeadm upgrade planUncordon the master node so it can schedule pods again:
#kubectl uncordon masterWorker node upgrade
Drain the worker node (use --force if needed):
#kubectl drain worker --ignore-daemonsets --forceRepeat 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 workerAfter 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.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Open Source Linux
Focused on sharing Linux/Unix content, covering fundamentals, system development, network programming, automation/operations, cloud computing, and related professional knowledge.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
