[12] Pod Log 추출

❓Record the extracted log lines

Reference

docs에서 reference 검색 > logs 검색

Kubectl Reference Docs

실습

[user@console ~]$ kubectl config use-context hk8s

[user@console ~]$ kubectl get pods custom-app

[user@console ~]$ kubectl logs custom-app | grep 'file not found'

[user@console ~]$ kubectl logs custom-app | grep 'file not found' > /var/CKA2022/podlog

# 잘 들어갔는지 확인
[user@console ~]$ cat /var/CKA2022/podlog

기출문제 (1번)

List pod logs named "frontend" and search for the pattern "started" and write it to a file "/opt/error-logs"

기출문제 (7번)

Monitor the logs of pod foo and: Extract log lines corresponding to error unable-to-access-website Write them to /opt/KULM00201/foo

기출문제 (17번)

Task Monitor the logs of pod bar and:


Revision #1
Created 31 May 2023 00:06:11 by 와지
Updated 20 June 2023 13:20:12 by 와지