Skip to content

Instantly share code, notes, and snippets.

@jkeam
Created July 12, 2023 16:41
Show Gist options
  • Save jkeam/f370919fa9934ec344c8a579a74def65 to your computer and use it in GitHub Desktop.
Save jkeam/f370919fa9934ec344c8a579a74def65 to your computer and use it in GitHub Desktop.
Get the top pods in all the projects
#!/bin/bash
# Taken from: https://www.redhat.com/architect/openshift-usage-metrics
for project in `oc get project|grep -v NAME`; \
do echo $project; \
oc project $project 2> /dev/null; \
oc adm top pods; \
done;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment