Troubleshooting

hahic·2023년 1월 10일
0

Kubernetes/CKA

목록 보기
10/13
post-thumbnail

Application Failure

Trouble 확인 하는 방법

  1. service 상태 확인
    curl https://web-service-ip:node-port

  2. pod 상태 확인
    kubectl get pod
    kubectl describe pod web
    kubectl logs web -f --previous

Trouble Type

  1. Service와 Pod의 label이 같지 않는 경우

  2. Pod에서 Service의 참조가 잘못되어 있는 경우

  3. Service에 Pod의 Endpoint가 잘못되어 있는 경우

  4. Pod의 Environment가 잘못 설정되어있는 경우

  5. 문제의 요청에 따라 제대로 설정되지 않는 경우

핵심 명령어

  • curl http://10.43.224.254:30081
  • k config set-context --currnet --namespace=alpha
  • k get all -o wide --show-labels

Reference

https://kubernetes.io/ko/docs/tasks/debug/debug-application/ -> troubleshot application

Control Plane Failure

Trouble 확인 하는 방법

  • kubectl get pods -n kube-system
  • service kube-apiserver status
  • kubectl logs kube-apisever -n system

Trouble Type

  1. kubeconfig 위치가 잘못 지정되어 있는 경우

  1. volume이 잘못 지정되어 있는 경우

Referece

https://kubernetes.io/ko/docs/tasks/debug/debug-cluster/ -> troubleshot cluster
https://kubernetes.io/ko/docs/reference/kubectl/cheatsheet/ -> kubernetes cheat sheet

Worker Node Failure

Trouble Type

  1. kubelet 서비스가 실행되지 않았을 경우

  2. config 파일이 제대로 설정되지 않았을 경우

  3. kubelet port가 잘못 지정되어 있는 경우
    /etc/kubernetes/kubelet.conf

-> 6553이 아니라 6443이다

핵심 명령어

  • service kubelet status
  • service kubelet start
  • service kubelet restart
  • journalctl -u kubelet -f

Troubleshoot Network

kube-proxy와 관련된 문제 해결

  1. kube-system 네임스페이스 의 kube -proxy 포드 가 실행 중인지 확인합니다.

  2. kube-proxy 로그를 확인합니다.

  3. configmap 이 올바르게 정의되어 있고 kube-proxy 바이너리를 실행하기 위한 구성 파일이 올바른지 확인합니다.

  4. kube-config 는 구성 맵 에 정의되어 있습니다 .

  5. kube-proxy 가 컨테이너 내부에서 실행 중인지 확인

Trouble Type

  1. command가 잘못되어 있는 경우
profile
👩‍💻 Junior Backend Developer

0개의 댓글