자격증/CKA

[CKA] Pod Log 추출

후드리챱챱 2023. 3. 27. 21:40
반응형

[문제]

작업 클러스터 : kubectl config use-context kubernetes-admin@kubernetes

- Monitor the logs of pod custom-app and: Extract log lines corresponding to error file not found Write them to /var/CKA2022/podlog.

 

[풀이]

# kubectl get pods custom-app

# kubectl logs custom-app | grep 'file not found' > /var/CKA2022/podlog

# cat /var/CKA2022/podlog

※ 명령어는 아래 링크 참고

https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#logs

 

 

[참고]

- 유투브 따배씨

반응형