Net Eng

[CKA] - Kubernetes Troubleshooting (1) 본문

Cloud/Kubernetes

[CKA] - Kubernetes Troubleshooting (1)

欲心 2024. 1. 23. 18:08

[선수 지식]

Worker Node 동작원리
* Container Engine(Container Runtime)
* kubelet
* kube-proxy

Worker Node Notready 상태라면,
(ㄱ) dockerd running?
(ㄴ) kubelet running?
(ㄷ) kube-proxy running?
(ㄹ) CNI running?

Log Check
* /var/log/{pods,containers}/
* container runtime command
- docker: docker {ps,logs}
- cri-o: crictl {ps,logs}
  - containerd: nertdctl {ps,logs} 
* kubelet logs: /var/log/syslog, journalctl 

 


 

[선수 작업]

ssh node2 'systemctl disable --now kubelet' >/dev/null 2>&1

 


 

[문제]

  • A kubernetes worker node, named node2 is in state NotReady.
  • Investigate why this is the case, and perform any appropriate steps bring the node to a Ready state, ensuring that any changes are made permanent.

 

[풀이]

kubectl get nodes

* node 상태 확인

 

node2 -> NotReady 확인

 

ssh node2

* node2 접속

 

sudo -i

* root 권한

 

systemctl status docker

* Docker 상태 확인

 

systemctl status kubelet

* kubelet 상태 확인

 

kubelet -> inactive 상태

 

systemctl enable --now kubelet

* kubelet 상태 활성화

 

exit
exit

* 클스터로 복귀

 

kubectl get pod -n kube-system -o wide | grep 'kube-proxy'

* kube-proxy, CNI 상태 확인

 

kubectl get nodes

* node 상태 확인

 

node2 -> Ready 확인

 


[참고]

 

클러스터 트러블슈팅

일반적인 클러스터 이슈를 디버깅한다.

kubernetes.io

 

애플리케이션 트러블슈팅하기

일반적인 컨테이너화된 애플리케이션 이슈를 디버깅한다.

kubernetes.io

 

'Cloud > Kubernetes' 카테고리의 다른 글

[CKA] - Kubernetes Troubleshooting (2)  (0) 2024.01.23
[CKA] - Kubernetes Upgrade  (0) 2024.01.23
[CKA] - Ingress 구성  (0) 2024.01.23
[CKA] - Check Resource Information  (1) 2024.01.23
[CKA] - Persistent Volume Claim 사용하는 Pod 운영  (0) 2024.01.22