From the pod label name=overloaded-cpu, find pods running high CPU workloads and write the name of the pod consuming most CPU to the file /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

출처

https://youtu.be/dcrWsfulUM8