{"id":313,"date":"2026-04-01T01:54:00","date_gmt":"2026-04-01T01:54:00","guid":{"rendered":"https:\/\/blog.ngocha.biz\/?p=313"},"modified":"2026-04-01T01:54:00","modified_gmt":"2026-04-01T01:54:00","slug":"upgrade-kubernetes-cluster-kubeadm","status":"publish","type":"post","link":"https:\/\/blog.ngocha.biz\/?p=313","title":{"rendered":"How to Upgrade Kubernetes Cluster Using Kubeadm?"},"content":{"rendered":"<p>In <a href=\"https:\/\/devopscube.com\/kubernetes-tutorials-beginners\/\">kubernetes tutorial<\/a>, I have added step-by-step guides to upgrade the Kubernetes cluster using Kubeadm. It is one of the important tasks in the CKA Exam.<\/p>\n<p>In another blog, I have covered the <a href=\"https:\/\/devopscube.com\/setup-kubernetes-cluster-kubeadm\/\">Kubeadm cluster setup<\/a>. You can follow it to deploy a fresh cluser for testing the upgrade.<\/p>\n<h2 id=\"kubeadm-kubernetes-cluster-upgrade\">Kubeadm Kubernetes Cluster Upgrade<\/h2>\n<div class=\"kg-card kg-callout-card kg-callout-card-grey\">\n<div class=\"kg-callout-text\"><b><strong style=\"white-space: pre-wrap;\">Note: <\/strong><\/b>In this example, I will be upgrading Kubernetes version 1.34.0 to 1.34.6. Please replace the version numbers as per your existing version and upgrade requirement.<\/div>\n<\/div>\n<p>We need to run the upgrades in the following order<\/p>\n<ol>\n<li>Control plane node<\/li>\n<li>Worker Nodes<\/li>\n<\/ol>\n<p>Also, we need to upgrade the following components on both the control plane and the worker nodes.<\/p>\n<ol>\n<li>Kubeadm<\/li>\n<li>Kubelet<\/li>\n<li>Kubectl<\/li>\n<\/ol>\n<p>Before we get started <strong>you should know the cluster and node names<\/strong>. Execute the following command to get the node names.<\/p>\n<pre><code class=\"language-bash\">kubectl get nodes<\/code><\/pre>\n<p>You will get the following output.<\/p>\n<pre><code class=\"language-bash\">NAME           STATUS   ROLES           AGE    VERSION\ncontrolplane   Ready    control-plane   7d7h   v1.34.0\nnode01         Ready    worker          7d7h   v1.34.0<\/code><\/pre>\n<h2 id=\"upgrade-the-control-plane\">Upgrade The Control Plane<\/h2>\n<p>Following are the high level steps for the control plane  upgrade<\/p>\n<ol>\n<li>Login to control plane<\/li>\n<li>Check the existing version<\/li>\n<li>unhold kubeadm and Install the latest kubeadm version<\/li>\n<li>Decide on the upgrade version by running a kubeadm upgrade plan (Same version patch or new version)<\/li>\n<li>Apply Kubeadm upgrade<\/li>\n<li>Evict all workloads from control plane except daemonsets<\/li>\n<li>Upgrade kubectl and kubelet.<\/li>\n<li>Make the control plane schedulable (Uncordon)<\/li>\n<\/ol>\n<p>Lets get started with the Upgrade.<\/p>\n<h3 id=\"step-1-check-the-existing-kubeadm-version\">Step 1: Check the existing Kubeadm version<\/h3>\n<p>Login to the control plane and can check the existing version using the following command.<\/p>\n<pre><code class=\"language-bash\">kubeadm version -o json<\/code><\/pre>\n<p>You will get the following output.<\/p>\n<pre><code class=\"language-bash\">{\n  \"clientVersion\": {\n    \"major\": \"1\",\n    \"minor\": \"34\",\n    \"gitVersion\": \"v1.34.0\",\n    \"gitCommit\": \"f28b4c9efbca5c5c0af716d9f2d5702667ee8a45\",\n    \"gitTreeState\": \"clean\",\n    \"buildDate\": \"2025-08-27T10:15:59Z\",\n    \"goVersion\": \"go1.24.6\",\n    \"compiler\": \"gc\",\n    \"platform\": \"linux\/arm64\"\n  }\n}<\/code><\/pre>\n<h3 id=\"step-2-unhold-kubeadm-and-install-the-latest-version\">Step 2: unhold kubeadm and Install the latest version<\/h3>\n<p>During the Kubeadm cluster installation process, you would have hold the kubeadm installation to prevent upgrades.<\/p>\n<p>Now we need to unhold kubeadm.<\/p>\n<pre><code class=\"language-bash\">sudo apt-mark unhold kubeadm <\/code><\/pre>\n<p>Check the available latest Kubeadm version using the following command.<\/p>\n<pre><code class=\"language-bash\">sudo apt-cache madison kubeadm | tac<\/code><\/pre>\n<p>You will get the following output.<\/p>\n<pre><code class=\"language-bash\">   kubeadm | 1.34.0-1.1 | https:\/\/pkgs.k8s.io\/core:\/stable:\/v1.34\/deb  Packages\n   kubeadm | 1.34.1-1.1 | https:\/\/pkgs.k8s.io\/core:\/stable:\/v1.34\/deb  Packages\n   kubeadm | 1.34.2-1.1 | https:\/\/pkgs.k8s.io\/core:\/stable:\/v1.34\/deb  Packages\n   kubeadm | 1.34.3-1.1 | https:\/\/pkgs.k8s.io\/core:\/stable:\/v1.34\/deb  Packages\n   kubeadm | 1.34.4-1.1 | https:\/\/pkgs.k8s.io\/core:\/stable:\/v1.34\/deb  Packages\n   kubeadm | 1.34.5-1.1 | https:\/\/pkgs.k8s.io\/core:\/stable:\/v1.34\/deb  Packages\n   kubeadm | 1.34.6-1.1 | https:\/\/pkgs.k8s.io\/core:\/stable:\/v1.34\/deb  Packages<\/code><\/pre>\n<p>In my case the latest version is <strong><code>1.34.6-1.1<\/code><\/strong>.  Update and install the latest version using the following command. Replace the version number you get from the output.<\/p>\n<pre><code class=\"language-bash\">sudo apt-get update -y\nsudo apt-get install -y kubeadm=1.34.6-1.1<\/code><\/pre>\n<p>Hold kubeadm package.<\/p>\n<pre><code class=\"language-bash\">sudo apt-mark hold kubeadm<\/code><\/pre>\n<h3 id=\"step-3-decide-on-the-upgrade-version\">Step 3: Decide on the upgrade version<\/h3>\n<p>You can get the list of available kubernetes version using the kubeadm upgrade plan.<\/p>\n<pre><code class=\"language-bash\">sudo kubeadm upgrade plan<\/code><\/pre>\n<p>The output will show the version that can be applied for the upgrade. In my case the version to be upgraded is <strong>v1.34.6<\/strong>. Change this version as per your output.<\/p>\n<h2 id=\"step-4-apply-kubeadm-upgrade\">Step 4: Apply Kubeadm upgrade<\/h2>\n<p>Apply the upgrade using the following command with the version.<\/p>\n<pre><code class=\"language-bash\">kubeadm upgrade apply v1.34.6<\/code><\/pre>\n<p>Now if you check the kubeadm version, you can see the upgraded version.<\/p>\n<pre><code class=\"language-bash\">{\n  \"clientVersion\": {\n    \"major\": \"1\",\n    \"minor\": \"34\",\n    \"gitVersion\": \"v1.34.6\",\n    \"gitCommit\": \"8b2bf66ce7018f6e13e8767624d4ce7768a8a2e5\",\n    \"gitTreeState\": \"clean\",\n    \"buildDate\": \"2026-03-18T19:18:06Z\",\n    \"goVersion\": \"go1.24.13\",\n    \"compiler\": \"gc\",\n    \"platform\": \"linux\/arm64\"\n  }\n}<\/code><\/pre>\n<h3 id=\"step-6-drain-the-node-to-evict-all-workloads\">Step 6: Drain the Node to evict all workloads.<\/h3>\n<p>To apply the upgrade we nee to evict all the workloads except daemonsets using the following command. Replace <strong><code>controlplane<\/code><\/strong> with your controlplane node name.<\/p>\n<pre><code class=\"language-bash\">kubectl drain controlplane --ignore-daemonsets<\/code><\/pre>\n<h3 id=\"step-7-upgrade-kubelet-and-kubectl\">Step 7: Upgrade Kubelet and Kubectl.<\/h3>\n<p>Unhold and upgrade kubectl and kubelet using the following commands.<\/p>\n<pre><code class=\"language-bash\">sudo apt-mark unhold kubelet kubectl \nsudo apt-get update\nsudo apt-get install -y kubelet=1.34.6-1.1 kubectl=1.34.6-1.1\nsudo apt-mark hold kubelet kubectl<\/code><\/pre>\n<p>Restart the services.<\/p>\n<pre><code class=\"language-bash\">sudo systemctl daemon-reload\nsudo systemctl restart kubelet<\/code><\/pre>\n<h3 id=\"step-7-uncordon-the-node-and-verify-the-node-status\">Step 7: Uncordon the Node and Verify the Node Status<\/h3>\n<p>Use the following command to uncordon the control plane node<\/p>\n<pre><code class=\"language-bash\">kubectl uncordon controlplane<\/code><\/pre>\n<p>Verify the node status and version using the following command.<\/p>\n<pre><code class=\"language-bash\">kubectl get nodes<\/code><\/pre>\n<p>You can see the control plane upgraded to the new version and nodes running on the old version as shown below.<\/p>\n<pre><code class=\"language-bash\">NAME           STATUS   ROLES           AGE    VERSION\ncontrolplane   Ready    control-plane   7d7h   v1.34.6  \nnode01         Ready    worker          7d7h   v1.34.0<\/code><\/pre>\n<h2 id=\"upgrade-worker-nodes\">Upgrade Worker Nodes<\/h2>\n<p>Worker node upgrade steps are similar to control plane upgrade. However the internal upgrade process differ from control plane.<\/p>\n<p>All the following steps should be executed on the Worker node. If you have multiple worker nodes, upgrade one at a time.<\/p>\n<h3 id=\"step-1-unhold-kubeadm-and-install-required-version\">Step 1: Unhold Kubeadm and Install Required Version<\/h3>\n<p>Install the required version of Kubeadm on worker nodes. Replace <code>1.34.6-1.1<\/code> with you version.<\/p>\n<pre><code class=\"language-bash\">sudo apt-mark unhold kubeadm \nsudo apt-get update &amp;&amp; sudo apt-get install -y kubeadm=1.34.6-1.1\nsudo apt-mark hold kubeadm<\/code><\/pre>\n<h3 id=\"step-2-upgrde-kubeadm\">Step 2: Upgrde Kubeadm<\/h3>\n<p>As you are running the following command on a worker node, it skips all the steps required for the control plane and update only kubelet configuration required for a worker node.<\/p>\n<pre><code class=\"language-bash\">sudo kubeadm upgrade node<\/code><\/pre>\n<h3 id=\"step-3-drain-the-node\">Step 3: Drain the Node<\/h3>\n<p>Evict all the pods on the worker node by draining it. Replace <strong><code>node01<\/code><\/strong> with your worker node name. Execute this command from terminal where you have kubectl access.<\/p>\n<pre><code class=\"language-bash\">kubectl drain node01 --ignore-daemonsets<\/code><\/pre>\n<p>If pods are using local storage, you might get the following error. This is mostly occur in vagrant setup. In CKA exam, you will not probably face this issue.<\/p>\n<pre><code>error: unable to drain node \"node01\" due to error:cannot delete Pods with local storage (use --delete-emptydir-data to override): kube-system\/metrics-server-69fb86cf66-nqmhn, continuing command...\nThere are pending nodes to be drained:\n node01\ncannot delete Pods with local storage (use --delete-emptydir-data to override): kube-system\/metrics-server-69fb86cf66-nqmhn<\/code><\/pre>\n<p>To rectify that issues, you need to add the <code>--delete-emptydir-data<\/code> as well.<\/p>\n<pre><code class=\"language-bash\">kubectl drain node01 --ignore-daemonsets --delete-emptydir-data<\/code><\/pre>\n<h3 id=\"step-4-upgrade-kubelet-kubectl\">Step 4: Upgrade Kubelet &amp; Kubectl<\/h3>\n<p>Run these commands on worker nodes<\/p>\n<pre><code class=\"language-bash\">sudo apt-mark unhold kubelet kubectl \nsudo apt-get update\nsudo apt-get install -y kubelet=1.34.6-1.1 kubectl=1.34.6-1.1\nsudo apt-mark hold kubelet kubectl<\/code><\/pre>\n<p>Restart kubelet<\/p>\n<pre><code class=\"language-bash\">sudo systemctl daemon-reload\nsudo systemctl restart kubelet<\/code><\/pre>\n<h3 id=\"step-5-uncordon-worker-node\">Step 5: Uncordon worker node<\/h3>\n<p>Execute the following uncordon command from the node where you have kubectl access.<\/p>\n<pre><code class=\"language-bash\">kubectl uncordon node01<\/code><\/pre>\n<h2 id=\"verify-cluster-upgrade\">Verify Cluster Upgrade<\/h2>\n<p>Now that we have upgraded the control plane node and the worker nodes, lets verify if the cluster is upgraded and working as expected.<\/p>\n<p>Get the node information<\/p>\n<pre><code class=\"language-bash\">kubectl get nodes<\/code><\/pre>\n<p>You should see the control plane and worker nodes upgraded to the specified version.<\/p>\n<pre><code class=\"language-bash\">NAME           STATUS   ROLES           AGE    VERSION\ncontrolplane   Ready    control-plane   7d8h   v1.34.6\nnode01         Ready    worker          7d7h   v1.34.6<\/code><\/pre>\n<p>From the control plane node, you can use any one of the following kubectl commands to check the status of all the cluster components.<\/p>\n<pre><code class=\"language-bash\">kubectl get --raw='\/readyz?verbose'\ncurl -k https:\/\/localhost:6443\/livez?verbose<\/code><\/pre>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/api-health-1.png\" class=\"kg-image\" alt=\"kubernetes API health status\" loading=\"lazy\" width=\"633\" height=\"526\" srcset=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w600\/2025\/03\/api-health-1.png 600w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/api-health-1.png 633w\"><\/figure>\n<p>Also, check if all the kube-system control node pods are running.<\/p>\n<pre><code class=\"language-bash\">kubectl get po -n kube-system<\/code><\/pre>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-31-13.png\" class=\"kg-image\" alt=\"verify kube-system pods status\" loading=\"lazy\" width=\"542\" height=\"359\"><\/figure>\n<h2 id=\"conclusion\">Conclusion<\/h2>\n<p>Kubeadm utility helps you upgrade the Kubernetes cluster control plane and worker nodes without downtime. Ensure you verify the cluster and application status after the upgrade.<\/p>\n<p>Also, Kubeadm cluster upgrade is one of the important topics in Kubernets CKA certification. If you are preparing for CKA exam, you can check out <a href=\"https:\/\/devopscube.com\/cka-exam-study-guide\/\">CKA exam guide<\/a>.<\/p>\n<p>If you are preparation for Kubernetes certification, checkout the <a href=\"https:\/\/devopscube.com\/best-kubernetes-certifications\/\">best Kubernetes certification<\/a> guide that matches your skillset.<\/p>\n<hr>\n<p><strong>Ngu\u1ed3n:<\/strong> <a href=\"https:\/\/devopscube.com\/upgrade-kubernetes-cluster-kubeadm\/\" target=\"_blank\" rel=\"noopener noreferrer\">How to Upgrade Kubernetes Cluster Using Kubeadm? \u2014 DevOpsCube<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Source: https:\/\/devopscube.com\/upgrade-kubernetes-cluster-kubeadm\/<\/p>\n","protected":false},"author":1,"featured_media":314,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-313","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-devops"],"_links":{"self":[{"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=\/wp\/v2\/posts\/313","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=313"}],"version-history":[{"count":0,"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=\/wp\/v2\/posts\/313\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=\/wp\/v2\/media\/314"}],"wp:attachment":[{"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=313"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=313"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=313"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}