본문 바로가기

자격증/CKA

[CKA] CPU 사용량이 높은 Pod 검색

반응형

[문제]

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

- From the pod label name=overloaded-cpu, find pods runnning high CPU workloads and write the name of the pod consuming most CPU to the file /car/CKA2022/cpu_load_pod.txt.

 

[이론]

- top 명령어 이론

node 리소스 확인
# kubectl top nodes

pod 리소스 확인
# kubectl top pods

 

[풀이]

- CPU 사용률 가장 높은 pod를 /var/CKA2022/cpu_load_pod.txt 에 기록

# kubectl top pods -l name=overloaded-cpu --sort-by=cpu
# echo "POD_NAME" > /var/CKA2022/cpu_load_pod.txt

 

 

[참고]

- 유투브 따배씨

반응형

'자격증 > CKA' 카테고리의 다른 글

[CKA] NodePort 서비스 생성  (0) 2023.03.31
[CKA] init 컨테이너를 포함한 Pod 운영  (0) 2023.03.27
[CKA] Pod Log 추출  (0) 2023.03.27
[CKA] Deployment & Expose the Service  (0) 2023.03.26
[CKA] Node 정보 수집  (0) 2023.03.26