CKA Exam Prep Node Version Not Upgraded — Common Confusion Kubeadm Upgrade

tanut aran
2 min readNov 9, 2024

--

Credit : https://kubernetes.io/

The step is to upgrade : FIRST controlpane THEN worker node

  1. Go to Controlplane
  2. Drain Controlplane (Auto cordon)
  3. ** Upgrade kubeadm **
  4. ** Upgrade kubelet , kubectl Restart Service **
  5. Uncordon the controlplane
  6. Drain Node (Auto cordon)
  7. Go to Node
  8. ** Upgrade kubeadm **
  9. ** Upgrade kubelet , kubectl Restart Service**
  10. Bring back the Node

Each Node — There are 2 things to upgrade : FIRST kubeadm THEN kubelet, kubectl

See the version by

sudo apt update
sudo apt-cache madison kubeadm

If you do not find the version you want to upgrade to, see note below.

First with kubeadm

sudo apt-get update
sudo apt-get install -y kubeadm='1.31.0-1.1' && \

Then for: kubectl and kubelet

Here is the confusion happen, the command look the same, so you skip this step

sudo apt-get update
sudo apt-get install -y kubelet='1.31.x-*' kubectl='1.31.0-1.1'

With Additional Restart

sudo systemctl daemon-reload
sudo systemctl restart kubelet

Note: Make SURE apt is actually upgrading

After run this command you might experience warning

You see the log and though the package is upgraded. See carefully what the log say.

Some common mistake

You either need

--allow-change-held-packages

sudo apt-get update
sudo apt-get install -y kubeadm='1.31.0-1.1' --allow-change-held-packages

Or the unhold as the doc suggest

sudo apt-mark unhold kubeadm
sudo apt-get update
sudo apt-get install -y kubeadm='1.31.0-1.1'
sudo apt-mark hold kubeadm

Sometimes you make mistake to upgrade to too latest.

You need the downgradable flag to make it do what you want.

--allow-downgrades

sudo apt-get update
sudo apt-get install -y kubelet='1.31.0-1.1' kubectl='1.31.0-1.1' --allow-downgrades

Note: Mistake in apt version

nano /etc/apt/sources.list.d/kubernetes.list/

Go there and fix the version if there is nothing matched. Then run the update again

sudo apt update
sudo apt-cache madison kubeadm

Note: How to check

You MUST go back to controlplane to run

kubectl get node

And see the version is upgraded

--

--

tanut aran
tanut aran

Written by tanut aran

Co-founder and Coder at work !

No responses yet