0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

CKA試験、kubeadm upgrade

Last updated at Posted at 2023-02-23

kubeadm upgrade

Ubuntu基準で説明します

チートシート

control plane upgrade(Master)

1. 現在アップグレードできるバージョンを取得

sudo apt update
sudo apt-cache madison kubeadm

2. control plane upgrade(Master)

 sudo apt-mark unhold kubeadm && \
 sudo apt-get update && apt-get install -y kubeadm=1.26.x-xx && \
 sudo apt-mark hold kubeadm

x のところに、バージョンの番号を入れる

3. upgradeの計画を確認する

sudo kubeadm upgrade plan 1.26.x-xx

4. upgradeを行う

sudo kubeadm upgrade apply 1.26.x-xx

5. master のnodeたちを全体削除する

### 6. sudo kubectl drain <node-to-drain> --ignore-daemonsets

< node-to-drain > -> PC名

sudo kubectl drain ip-172-31-23-75.ap-northeast-1.compute.internal --ignore-daemonsets

7. kubeletとkubectlをアップグレード

sudo apt-mark unhold kubelet kubectl && \
sudo apt-get update && apt-get install -y kubelet=1.26.x-xx kubectl=1.26.x-xx && \
sudo apt-mark hold kubelet kubectl

8. kubeletを再起動

sudo systemctl daemon-reload
sudo systemctl restart kubelet

9. node uncordon

kubectl uncordon <node-to-uncordon>

< node-to-uncordon > -> PC名

worker node upgrade(Node)

1. ノードPCにアクセス

ssh <node>
sudo apt-mark unhold kubeadm && \
sudo apt-get update && apt-get install -y kubeadm=1.26.x-00 && \
sudo apt-mark hold kubeadm

x のところに、バージョンの番号を入れる

2. kubedam node upgradeを実行する

sudo kubeadm upgrade node

3. master Pcでノード PCのdrain 命令ごを実行す

ssh <master>
kubectl drain <node pc name> --ignore-daemonsets

4. ノード PCにアクセスし、kubeletとkubectlをアップグレード

ssh <node>
sudo apt-mark unhold kubelet kubectl && \
sudo apt-get update && apt-get install -y kubelet=1.26.x-xx kubectl=1.26.x-xx && \
sudo apt-mark hold kubelet kubectl

5. kubectlを再起動

sudo systemctl daemon-reload
sudo systemctl restart kubelet

6. node uncordon

ssh <master>
kubectl uncordon  <node pc name> 
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?