문제
작업 클러스터 : kubelet config use-context k8s
upgrade system : hk8s-m
Given an existing Kubernetes cluster running version 1.22.4 ,
upgrade all of the Kubernetes control plane and node components on the master node only to version 1.23.3
Be sure to drain the master node before upgrading it and uncordon it after the upgrade.
클러스터 변경하기
kubelet config use-context hk8s-m
kubeadm 업그레이드
https://kubernetes.io/docs/tasks/administer-cluster/kubeadm/kubeadm-upgrade/
## Ubuntu
# replace x in 1.23.x-00 with the latest patch version
apt-mark unhold kubeadm && \
apt-get update && apt-get install -y kubeadm=1.23.x-00 && \
apt-mark hold kubeadm
## CentOS
# replace x in 1.23.x-0 with the latest patch version
yum install -y kubeadm-1.23.x-0 --disableexcludes=kubernetes
node components 업그레이드
sudo kubeadm upgrade plan v1.23.3
sudo kubeadm upgrade apply v1.23.3
노드 드레인
kubectl drain hk8s-m --ignore-daemonsets
https://kubernetes.io/docs/tasks/administer-cluster/kubeadm/kubeadm-upgrade/
kubelet과 kubectl 업그레이드
## Ubuntu
# replace x in 1.27.x-00 with the latest patch version
apt-mark unhold kubelet kubectl && \
apt-get update && apt-get install -y kubelet=1.27.x-00 kubectl=1.27.x-00 && \
apt-mark hold kubelet kubectl
## CentOS
# replace x in 1.27.x-0 with the latest patch version
yum install -y kubelet-1.27.x-0 kubectl-1.27.x-0 --disableexcludes=kubernetes
kubelet 재시작하기
sudo systemctl daemon-reload
sudo systemctl restart kubelet
노드 uncordon
sudo kubelet uncordon hk8s-m
반응형
'클라우드 및 인프라 > CKA' 카테고리의 다른 글
[CKA] Udemy - Troubleshooting - worker node failure 문제풀이 (0) | 2023.05.29 |
---|---|
[CKA] kubectl JSON Path 사용법 (0) | 2023.05.23 |
[CKA] 문제풀이 - 따배쿠 02. Pod 생성하기 (0) | 2023.05.12 |
[CKA] 문제풀이 - 따배쿠 01. ETCD Backup & Restore (0) | 2023.05.11 |
[CKA] cka 문제 풀이에 필요한 document 참조 링크 (0) | 2023.05.10 |