Skip to content

Instantly share code, notes, and snippets.

@onpaws
Created August 13, 2020 12:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save onpaws/992e48a9e40efedb36211133b73bba8b to your computer and use it in GitHub Desktop.
Save onpaws/992e48a9e40efedb36211133b73bba8b to your computer and use it in GitHub Desktop.
k8s get all resources in a namespace
# 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