Last active
May 12, 2024 12:21
-
-
Save caruccio/7df68326ea4b7523669a1991424d2cda to your computer and use it in GitHub Desktop.
Count all objects in a clusters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
kubectl api-resources --verbs=list -o name --namespaced=false | while read kind; do | |
echo -n "$kind: " | |
kubectl get --ignore-not-found -A $kind | wc -l | |
done 2>/dev/null | |
kubectl api-resources --verbs=list -o name --namespaced=true | while read kind; do | |
echo -n "$kind: " | |
kubectl get --ignore-not-found -A $kind | wc -l | |
done 2>/dev/null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment