Venkat:
From the pod lable name=pod, find pods running high CPU workloads and write the name of the pod consuming most to the file. how to solve this?
Hải Đông:
i do it manually
k top po | grep label. Check the most consuming pod and write in the file. not sure its correct
Marco Tony:
I guess:
- kubectl top pods
- parsing the output through the jsonpath or jq creating a kind of csv like: consumption,pod_name
- sort the output through the sort utility
- get last line through the tail -1
samith perera:
kubectl top pods -l name=pod
Venkat:
@Tej_Singh_Rana is it right?
Kubs:
kubectl top pod --sort-by cpu -l name=pod
Hải Đông:
@sharan and write manually in the specified file ?