OPS

[k8s] 트러블슈팅할 때 꼭 봐야하는 events, logs, describe

찻잔속청개구리 2024. 7. 29. 01:55
반응형
  • events : 네임스페이스 단위로 이벤트 확인
  • logs : 컨테이너 로그 확인 (이미지가 pull되고 나서 트러블슈팅할 때 보기)
  • describe : 배포된 오브젝트의 상태 파악할 때 사용 (컨테이너까지는 알 수 없음)

실습1.

# k get event 

=> image pull할 때 에러 발생한 것 확인됨

 

# k describe po <pod명> 

=> ImagePullBackOff 로 인해 정상적인 컨테이너 실행 안되는 점 확인

ㄴ> 맨 밑 event에 나오는 에러도 동일한 내용임.

문제가 생긴 컨테이너만 다뤄서 # k get event  쓰는것보다 describe가 더 나음.

 

실습2.

# k logs <pod명>

=> 정상적으로 실행되서 올라와야만 log 확인 가능 


/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
10-listen-on-ipv6-by-default.sh: info: ipv6 not available
/docker-entrypoint.sh: Sourcing /docker-entrypoint.d/15-local-resolvers.envsh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
/docker-entrypoint.sh: Configuration complete; ready for start up
2024/07/28 16:52:17 [notice] 1#1: using the "epoll" event method
2024/07/28 16:52:17 [notice] 1#1: nginx/1.27.0
2024/07/28 16:52:17 [notice] 1#1: built by gcc 12.2.0 (Debian 12.2.0-14) 
2024/07/28 16:52:17 [notice] 1#1: OS: Linux 5.19.0-28-generic
2024/07/28 16:52:17 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 1048576:1048576
2024/07/28 16:52:17 [notice] 1#1: start worker processes
2024/07/28 16:52:17 [notice] 1#1: start worker process 20

반응형

'OPS' 카테고리의 다른 글

리전에서 가용영역 내부 그리고 가용영역 간 패킷 드랍 발생!  (0) 2024.08.27
tracert 사용법  (0) 2024.08.19
[k8s] -o yaml 과 --dry-run=client  (0) 2024.07.29
정보처리기사 정리  (0) 2024.07.01
#1 EKS 연습  (0) 2024.06.26