Skip to main content

Command Palette

Search for a command to run...

CKS Notes - work node update

Published
1 min read
C

Some blogs are from my previous blogs, even though I have renovated and checked before migration, but there may be still some parts out of date. (https://blog.sina.com.cn/u/1784323047 or https://blog.csdn.net/li_6698230?type=blog, if they're still accessible.)

Here just a quick present of basic workflow of how to upgrade on the work node.More details can refer to the official doc, upgrading Linux work node.

Notice: The official doc shows is the completed procedural which we will stop the jobs, and drain the node(s) then continue the upgrade, but here we do the upgrade one work node without disturbing the jobs.

1. check the nodes we will upgrade

controlplane:~$ k get no
NAME           STATUS   ROLES           AGE   VERSION
controlplane   Ready    control-plane   10d   v1.34.2
node01         Ready    <none>          10d   v1.34.1

2. ssh to the node and check the version

controlplane:~$ ssh node01
node01:~$ apt-cache madison kubeadm
   kubeadm | 1.34.2-1.1 | https://pkgs.k8s.io/core:/stable:/v1.34/deb  Packages
   kubeadm | 1.34.1-1.1 | https://pkgs.k8s.io/core:/stable:/v1.34/deb  Packages
   kubeadm | 1.34.0-1.1 | https://pkgs.k8s.io/core:/stable:/v1.34/deb  Packages

3. ssh to work node, do the upgrade

node01:~$ apt install kubeadm=1.34.2-1.1
node01:~$ kubeadm upgrade node
node01:~$ apt install kubelet=1.34.2-1.1 kubectl=1.34.2-1.1
node01:~$ systemctl restart kubelet

4. back to controlplane and check the result

node01:~$ ssh controlplane
controlplane:~$ k get node
NAME           STATUS   ROLES           AGE   VERSION
controlplane   Ready    control-plane   10d   v1.34.2
node01         Ready    <none>          10d   v1.34.2

Cluster upgrade

If need to upgrade the controlplane node, see the article here, or the official doc about upgrade kubeadm.