마구잡

containerd 다운그레이드 본문

Kubernetes

containerd 다운그레이드

MAGUJOB 2023. 11. 21. 17:28
반응형
OS 버전 RHEL 8.6
쿠버네티스 버전 1.25.11

 

AS-IS containerd://1.6.22
TO-BE containerd://1.6.18

 

개요: 워커 노드를 재 조인 시키는 과정에서 containerd의 버전이 upgrade 되어버렸다.
타 워커와 containerd의 버전 차이가 발생하게 되고 버전 일치를 위한 다운그레이드 작업이 필요하여 하기 방법을 사용했다.


kubelt, containerd 데몬 중지

systemctl stop kubelet.service
systemctl stop containerd.service


노드의 NotReady 상태 확인

kubectl get node -owide

| sh-mn1 | Ready | control-plane | 2d4h | v1.25.12 | 192.168.60.240 | <none> | Red | Hat | Enterprise | Linux | 8.6 | (Ootpa) | 4.18.0-372.9.1.el8.x86_64 | containerd://1.6.18 |
|--------|-------|---------------|------|----------|----------------|--------|-----|-----|------------|-------|-----|---------|---------------------------|---------------------|
| sh-mn2 | Ready | control-plane | 2d4h | v1.25.12 | 192.168.60.241 | <none> | Red | Hat | Enterprise | Linux | 8.6 | (Ootpa) | 4.18.0-372.9.1.el8.x86_64 | containerd://1.6.18 |
| sh-mn3 | Ready | control-plane | 2d4h | v1.25.12 | 192.168.60.242 | <none> | Red | Hat | Enterprise | Linux | 8.6 | (Ootpa) | 4.18.0-372.9.1.el8.x86_64 | containerd://1.6.18 |
| sh-wn1 | Ready | node          | 2d4h | v1.25.12 | 192.168.60.243 | <none> | Red | Hat | Enterprise | Linux | 8.6 | (Ootpa) | 4.18.0-372.9.1.el8.x86_64 | containerd://1.6.18 |
| sh-wn2 | NotReady | node       | 2d4h | v1.25.12 | 192.168.60.244 | <none> | Red | Hat | Enterprise | Linux | 8.6 | (Ootpa) | 4.18.0-372.9.1.el8.x86_64 | containerd://1.6.22 |

 

containerd config 백업

ls /etc/containerd/
certs.d config.toml

cp -r /etc/containerd/ /임시디렉터리


현재 설치되어 있는 containerd 제거

yum remove containerd --noautoremove


이때 containerd-selinux까지 remove해도 상관 없지만

혹여 해당 패키지가 없을 경우가 있을 수 있으니 의존성 제거는 하지 않았다.

 

이전 버전의 rpm 설치

rpm -i containerd.io-1.6.18-3.1.el8.x86_64.rpm

 

이때 로컬에 rpm이 없는 상황이라면 /var/cahce/dnf/ 경로를 확인해보자 dnf, yum 패키지가 캐시 형태로 남아있을 수 있다.

containerd를 재설치 하게 되면 이전 config들은 지워진다.

( rpmsave로 남아 있는 경우가 있긴 하나 혹시 모를 상황을 대비하여 백업을 권장한다.)

 

백업한 containerd config 복원

cp -r /임시디렉터리/containerd /etc/containerd


데몬 재시작

systemctl restart containerd
systemctl restart kubelet

 

node의 버전과 Ready 상태 확인

kubectl get node -owide

| sh-mn1 | Ready | control-plane | 2d4h | v1.25.12 | 192.168.60.240 | <none> | Red | Hat | Enterprise | Linux | 8.6 | (Ootpa) | 4.18.0-372.9.1.el8.x86_64 | containerd://1.6.18 |
|--------|-------|---------------|------|----------|----------------|--------|-----|-----|------------|-------|-----|---------|---------------------------|---------------------|
| sh-mn2 | Ready | control-plane | 2d4h | v1.25.12 | 192.168.60.241 | <none> | Red | Hat | Enterprise | Linux | 8.6 | (Ootpa) | 4.18.0-372.9.1.el8.x86_64 | containerd://1.6.18 |
| sh-mn3 | Ready | control-plane | 2d4h | v1.25.12 | 192.168.60.242 | <none> | Red | Hat | Enterprise | Linux | 8.6 | (Ootpa) | 4.18.0-372.9.1.el8.x86_64 | containerd://1.6.18 |
| sh-wn1 | Ready | node          | 2d4h | v1.25.12 | 192.168.60.243 | <none> | Red | Hat | Enterprise | Linux | 8.6 | (Ootpa) | 4.18.0-372.9.1.el8.x86_64 | containerd://1.6.18 |
| sh-wn2 | Ready | node          | 2d4h | v1.25.12 | 192.168.60.244 | <none> | Red | Hat | Enterprise | Linux | 8.6 | (Ootpa) | 4.18.0-372.9.1.el8.x86_64 | containerd://1.6.18 |


인프라 pod 재시작

kubectl delete pod kube-proxy-l9v8n -n kube-system
kubectl delete pod calico-node-98szm -n kube-system

 

반응형

'Kubernetes' 카테고리의 다른 글

NFS 2/3 버전의 스토리지 클래스 PVC 생성 불가 현상  (2) 2023.11.24
POD 이미지 pull rate limit 늘리기  (2) 2023.11.24
kubelet 데몬 동작  (1) 2023.11.24
POD netns 보기  (4) 2023.11.21
쿠버네티스의 시스템 데몬  (2) 2023.11.20