cloud/k8s(문제풀이)
[따배쿠CKA] 12. Pod Log 추출
mozi2
2022. 8. 10. 15:55
반응형
Cluster: kubectl config use-context hk8s
Q. Monitor the logs of pod custom-app and: Extract log lines corresponding to error file not found Write them to /var/CKA2022/podlog.
: custom-app 로그 파일의 file not found 의 로그 파일을 찾고 추출해 해당 경로에 넣어라
*테스트를 위해 현재 환경에 맞게 변경해서 실습진행
1.
kubectl get pods custom-app
2. logs 확인하기
kubectl logs custom-app | grep 'file not found'
3. 로그 특정 내용을 해당 경로에 파일로 만듬
kubectl logs custom-app | grep 'file not found' > /var/cka2022/pdlog
4. 확인하기
cat /var/cka222/pdlog
* 본 게시글은 "TTABAE-LEARN" 을 보고 정리한 내용입니다.
728x90
반응형