This is a cheat sheet created during the last upgrade of a CentOS-based Kubernetes cluster serving Developer’s Cloud Desktops to our customers. TLDR; style.

The commands are tested on CentOS 7. For Ubuntu, replace
sudo yum install -y kubeadm-1.25.4-00 --disableexcludes=kubernetes
by
sudo apt-mark unhold kubeadm;
sudo apt-get install -y kubeadm=1.25.4-00;
sudo apt-mark  hold kubeadm

and similar for kubectl and kubelet.

For Ubuntu, you also need to replace
sudo yum list --showduplicates kubeadm --disableexcludes=kubernetes
by
sudo apt-cache madison kubeadm

Please report in the feedback section below, if it does not work in your case.

References

Step 1: Create  Backup

Recommended

Step 2: Upgrade to the latest Hotfix Version

This is an example of how to upgrade to v1.21.12 as the latest hotfix version of v1..21:

# upgrade DEV v1.21.3 to v1.21.12:
sudo yum install -y kubeadm-1.21.12-0 --disableexcludes=kubernetes # on all machines (also on the worker nodes, because we need it for pre-downloading the images)
sudo kubeadm upgrade plan # master
sudo kubeadm config images pull # on all machines
sudo kubeadm upgrade apply v1.21.12 # on master

sudo kubectl get nodes
# if the last command has failed, you might need to configure the correct kube config for root as follows:
  sudo mkdir -p /root/.kube
  sudo cp -i /etc/kubernetes/admin.conf /root/.kube/config

# drain worker nodes:
WORKER_NODE=node1
kubectl drain $WORKER_NODE --ignore-daemonsets --delete-emptydir-data

sudo systemctl daemon-reload # on all machines
sudo systemctl restart kubelet # on all machines

# check
kubectl get nodes

# enable worker node scheduling:
WORKER_NODE=node1
kubectl uncordon $WORKER_NODE

Step 3: Upgrade to the next higher main Version

# upgrade DEV v1.21.12 to v1.22.9:
sudo yum install -y kubeadm-1.22.9-0 --disableexcludes=kubernetes # on all machines (also on the worker nodes, because we need it for pre-downloading the images)
sudo kubeadm upgrade plan # master
sudo kubeadm config images pull # on all machines
sudo kubeadm upgrade apply v1.22.9 # on master

# check
kubectl get nodes

# drain worker nodes: 
WORKER_NODE=node1 
kubectl drain $WORKER_NODE --ignore-daemonsets --delete-emptydir-data
sudo systemctl daemon-reload # on all machines
sudo systemctl restart kubelet # on all machines

# check
kubectl get nodes
sudo kubeadm certs check-expiration # on master

# enable worker node scheduling:
WORKER_NODE=node1 
kubectl uncordon $WORKER_NODE # on master

kubectl get nodes

27 comments

  1. of course like your website but you have to check the spelling on several of your posts A number of them are rife with spelling issues and I in finding it very troublesome to inform the reality on the other hand I will certainly come back again

  2. I loved as much as youll receive carried out right here The sketch is tasteful your authored material stylish nonetheless you command get bought an nervousness over that you wish be delivering the following unwell unquestionably come more formerly again since exactly the same nearly a lot often inside case you shield this hike

  3. I simply could not go away your web site prior to suggesting that I really enjoyed the standard info a person supply on your guests Is going to be back incessantly to investigate crosscheck new posts

  4. I have been browsing online more than three hours today yet I never found any interesting article like yours It is pretty worth enough for me In my view if all website owners and bloggers made good content as you did the internet will be a lot more useful than ever before

  5. I just could not leave your web site before suggesting that I really enjoyed the standard information a person supply to your visitors Is gonna be again steadily in order to check up on new posts

  6. I do agree with all the ideas you have introduced on your post They are very convincing and will definitely work Still the posts are very short for newbies May just you please prolong them a little from subsequent time Thank you for the post

  7. Usually I do not read article on blogs however I would like to say that this writeup very compelled me to take a look at and do so Your writing taste has been amazed me Thanks quite nice post

  8. Magnificent beat I would like to apprentice while you amend your site how can i subscribe for a blog web site The account helped me a acceptable deal I had been a little bit acquainted of this your broadcast offered bright clear idea

  9. I loved as much as you will receive carried out right here The sketch is attractive your authored material stylish nonetheless you command get got an impatience over that you wish be delivering the following unwell unquestionably come more formerly again since exactly the same nearly a lot often inside case you shield this hike

  10. ????? ??????, ??????????, ???? ?? ???????? ??????????? ?????????? ? ???????. ?????????? ? 1935 ????, ?? ???? ?????? ???-?-????? ????????? ?????? ?????????????? ????? ? ????????????? ??????. ??? ?????? ?????, ????? ??? „Can’t Help Falling in Love“, „Suspicious Minds“ ? „Jailhouse Rock“, ????? ????????? ????? ? ?????????? ????????? ??????????? ?? ????? ????. ?????? ????? ???????? ?????? ??????????? ????????????? ? ????????? ????????, ??? ??????? ??? ???????? ?? ?????? ? ??????, ?? ? ? ?????????????. ??? ???????? ???????? ????? ? ??????????? ????? ????????? ????????. ??????? ?????? 2024 ???? ? ??????? ?????? ????????? mp3.

  11. DumpsWrap offers CompTIA CompTIA PenTest+ Certification Exam real exam questions and practice test engine with real questions and verified answers. Try CompTIA PenTest+ Certification Exam exam questions for free. You can also download a free PDF demo of CompTIA CompTIA PenTest+ Certification Exam exam. Our CompTIA PenTest+ Certification Exam Combo Package for which includes PDF (Printable Format) and Testing Engine (Works on Windows and MAC) which ensures you to go through all certification topics and provides you ultimate satisfaction to pass your exam in your first attempt.

  12. Fantastic beat I would like to apprentice while you amend your web site how could i subscribe for a blog site The account helped me a acceptable deal I had been a little bit acquainted of this your broadcast offered bright clear concept

  13. helloI really like your writing so a lot share we keep up a correspondence extra approximately your post on AOL I need an expert in this house to unravel my problem May be that is you Taking a look ahead to see you

Comments

Diese Website verwendet Akismet, um Spam zu reduzieren. Erfahre mehr darüber, wie deine Kommentardaten verarbeitet werden.