클라우드 및 인프라/CKA
[CKA] 문제풀이 - Cluster Upgrade - only Master
작은소행성
2023. 5. 15. 18:03
문제
작업 클러스터 : 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
반응형