Get kubectl top pods in .csv format

--

Hi, this is a short post, as a friendly reminder for me.

This command gets all the pods in all namespaces in a cluster, sorted by memory, and as an output a file .csv “resources-pod.csv” you can change it.

kubectl top pods -A - sort-by=memory | awk '{print $1 ", " $2 ", "$3–1"," $4–2}' | tee resources-pod.csv

More scripts: https://github.com/GloriaPG/kubernetes-scripts

--

--

Gloria Palma González
Gloria Palma González

Written by Gloria Palma González

My life is a paradigm: I can do anything. IT engineer, melomaniac, in love: #Infrastructure #OpenSource #CommunityLeadershipTeams #SoftwareEngineering

No responses yet