Now that we have upgraded the control plane, we have to upgrade kubeadm and kubelet on the worker nodes.
Upgrade Kubeadm on Worker Nodes
Important Note: Run all the the kubectl
commands from the control plane node. Other commands have to be run the worker nodes.
Step 1: Install required kubeadm version.
Update the package repo.
sudo apt-get update -y
Unhold kubeadm package.
sudo apt-mark unhold kubeadm
Install the specific Kubeadm version. Replce 1.29.2-1.1
with the respective version.
sudo apt-get install -y kubeadm=1.29.2-1.1
Step 2: Upgrade the node using the following command.
sudo kubeadm upgrade node
Upgrade Kubelet on Worker Nodes
Follow the steps given below to upgrade kubelet on the worker nodes
Step 1: Get the worker node name.
k get nodes
Step 2: Drain the worker plane node using the node name and make it unschedulable.
Important Note: Here, node01
is the node name. If you have a different name for your worker node, rename it accordingly..
k drain node01 --ignore-daemonsets --delete-emptydir-data
The --delete-emptydir-data
flag instructs the drain
process to remove any data stored in emptyDir volumes when draining a node..
Note: During CKA exam, you dont have to use the --delete-emptydir-data
flag.
Step 3: Unhold Kubelet.
sudo apt-mark unhold kubelet
Step 4: Update and install Kubelet. Replace 1.29.2-1.1
with the required version.
sudo apt-get update -y
sudo apt-get install kubelet=1.29.2-1.1
Step 5: Restart kubelet
sudo systemctl daemon-reload
sudo systemctl restart kubelet
Step 6: Uncordon the node so that node01
becomes schedulable.
k uncordon node01
Step 6: Verify the upgrade using the following command
k get nodes -o wide
You should see the updated version as shown below.