Loading Posts...

How To Upgrade A Kubernetes Cluster Using Kubeadm

There is no doubt that Kubernetes is a leading technology and, let’s see how we can upgrade a Kubernetes cluster using the Kubeadm tool. Previously, I have published an article about building a Kubernetes cluster on AWS using GitLab pipeline and, if you’d like to see the complete steps I followed, I encourage you to visit that article first. I had a Kubernetes cluster with a Master and three worker nodes running with v1.14.0 and, I upgraded the cluster to the v1.15.9 using Kubeadm.

Here is the initial cluster status of my nodes.

Upgrade A Kubernetes Cluster Using Kubeadm status

Install The New Version Of Kubeadm

I have added my version and the architecture of the system as environment variables and, downloaded the relevant Kubelet version to my master

I used below commands to install the kubeadm v1.15.9

export VERSION=v1.15.9
export ARCH=amd64
wget https://dl.k8s.io/release/${VERSION}/bin/linux/${ARCH}/kubeadm
Upgrade A Kubernetes Cluster Using Kubeadm master

Read More: How To Start Working With Google Kubernetes Engine (GKE)

Then install the kubeadm and, checked the version to ensure the running version, below commands were used.

sudo install -o root -g root -m 0755 ./kubeadm /usr/bin/kubeadm
sudo kubeadm version
Upgrade A Kubernetes Cluster Using Kubeadm version

Then planned the upgrade and checked for the errors with below command and, next command can be found at the bottom if every thing is ready to be upgraded

sudo kubeadm upgrade plan
Upgrade A Kubernetes Cluster Using Kubeadm plan

The given command will upgrade the control plane of the cluster, below is my command for the upgrade

sudo kubeadm upgrade apply v1.15.9
Upgrade A Kubernetes Cluster Using Kubeadm perform upgrade

Nice message will be displayed after the successful upgrade and, it will ask to upgrade the “kubelet” as the next step if you haven’t done so far. I had not done it and, that will be my next step

Upgrade A Kubernetes Cluster Using Kubeadm completed

Install The Kubelet On The Master Node

We have done the upgrade of the kubeadm and, it’s time to install the kubelet on the Master node. I used below commands to download

wget https://dl.k8s.io/release/${VERSION}/bin/linux/${ARCH}/kubelet
sudo install -o root -g root -m 0755 ./kubelet /usr/bin/kubelet
sudo systemctl restart kubelet.service

Verified the cluster status with “kubectl get nodes” command as below

Upgrade A Kubernetes Cluster Using Kubeadm master version

My Master node was upgraded to the v1.15.9 and, let’s move in to the worker nodes

Install The Kubelet On Worker Nodes

As we followed in the Master node install the kubelet on the worker nodes. I followed the below commands

export VERSION=v1.15.9
export ARCH=amd64
wget https://dl.k8s.io/release/${VERSION}/bin/linux/${ARCH}/kubelet
sudo install -o root -g root -m 0755 ./kubelet /usr/bin/kubelet
sudo systemctl restart kubelet.service
Upgrade A Kubernetes Cluster Using Kubeadm worker

After following the steps checked the status of the nodes

Upgrade A Kubernetes Cluster Using Kubeadm completed

All were updated successfully, let’s update the “Kubectl” on the master node

Install The Kubectl On The Master Node

These are the commands for the process

export VERSION=v1.15.9
export ARCH=amd64
wget https://dl.k8s.io/release/${VERSION}/bin/linux/${ARCH}/kubectl
sudo install -o root -g root -m 0755 ./kubectl /usr/bin/kubectl
#Check the kubectl version
kubectl version
Upgrade A Kubernetes Cluster Using Kubeadm kubectl

This is pretty much easy to follow and, I think this is quite useful for anyone looking for similar upgrade.

Click to rate this post!
[Total: 4 Average: 4.8]

Aruna Fernando

"Sharing knowledge doesn't put your job at risk - iron sharpen iron" I heard this and it's true.

Get Updates Directly To Your Inbox!

   

Leave a Comment

Loading Posts...