You can upgrade the version of a Kubernetes cluster running on Linux operating system. You can perform version upgrade operations from Kubernetes 1.18 to 1.30, transition from Docker to Containerd, and manage necessary files.
When upgrading Kubernetes version, each minor version between the current and target versions (e.g., from 1.25 to 1.26, then from 1.26 to 1.27, etc.) must be upgraded sequentially.
Kubernetes: v1.18 → Current version, v1.30 → Target version
Installing once is sufficient when transitioning from Kubernetes 1.18 to 1.19. Installation is not necessary in versions 1.19 and above.
Containerd
When transitioning to Kubernetes 1.24 version, transition to containerd usage should be made. Containerd should be 1.6+ and docker should be removed.Download
The version upgrade process consists of “1.18-1.19”, “1.20-1.23”, and “1.24-1.30” sections. In each section, the version upgrade process and solutions to possible errors are addressed.
Switch to the server that is Master(control-plane) and apply the following steps.
1
Check current versions
Check kubeadm, kubelet, and kubectl versions before starting the upgrade process:
Copy
kubeadm versionkubelet --versionkubectl version --client
2
Upgrade Kubeadm version
Remove package hold for Kubeadm:
Copy
sudo apt-mark unhold kubeadm
Go to the folder where you extracted the file you downloaded from fss.apinizer.com:
Copy
cd 1.19.3
Install the .deb extension kubeadm file found inside:
Copy
sudo dpkg -i kubeadm_1.19.3-00_amd64.debsudo apt-mark hold kubeadm
3
Put node in maintenance mode
The drain command below puts the specified Kubernetes node in maintenance mode and transfers pods to other nodes. If you do not have an alternative master node for your Master (control-plane) node, this command will cause system interruption. You may not apply this operation for clusters with a single node.
Worker node version upgrade is also performed with similar steps.
1
Put worker node in maintenance mode
The drain command below puts the specified Kubernetes node in maintenance mode and transfers pods to other nodes. If you do not have an alternative node for your Worker node, this command will cause system interruption. You may not apply this operation for clusters with a single worker node.The command is run on the master(control-plane) server and initiates maintenance and pod evacuation for the worker node.
Switch to the server where the worker node is located and perform kubeadm upgrade operation.Go to the folder where you extracted the file you downloaded from fss.apinizer.com:
Copy
sudo apt-mark unhold kubeadmsudo dpkg -i kubeadm_1.19.3-00_amd64.debsudo apt-mark hold kubeadm
Very ImportantWhen transitioning to Kubernetes 1.24 version, transition to containerd usage should be made instead of Docker. Containerd should be 1.6+ and docker should be removed.
Versions 1.24-1.30 are updated one by one. The steps above are repeated for each version. However, containerd installation must be done when transitioning to 1.24.
When transitioning to Kubernetes 1.24 version, transition to containerd usage should be made instead of Docker.
Containerd Installation
You can download the necessary file for Containerd installation.See the relevant documentation pages for Containerd installation and Docker transition operations.