Created
August 13, 2020 12:20
-
-
Save onpaws/992e48a9e40efedb36211133b73bba8b to your computer and use it in GitHub Desktop.
k8s get all resources in a namespace
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
# via https://stackoverflow.com/a/55796558/2044952 | |
function kubectlgetall { | |
for i in $(kubectl api-resources --verbs=list --namespaced -o name | grep -v "events.events.k8s.io" | grep -v "events" | sort | uniq); do | |
echo "Resource:" $i | |
kubectl -n ${1} get --ignore-not-found ${i} | |
done | |
} | |
# Usage: kubectlgetall <namespace> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment