Add script for listing all resources in namespace
This commit is contained in:
13
scripts/k8s-all
Executable file
13
scripts/k8s-all
Executable file
@@ -0,0 +1,13 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Simple script for fetching all resources from a namespace, might include some
|
||||||
|
# clutter
|
||||||
|
|
||||||
|
[ $# -lt 1 ] && echo "Usage: k8s-all [namespace]" && exit 1
|
||||||
|
|
||||||
|
for r in $(kubectl api-resources --verbs=list --namespaced -o name)
|
||||||
|
do
|
||||||
|
echo "Resource: $r" \
|
||||||
|
&& kubectl get $r -n $1 --ignore-not-found \
|
||||||
|
&& echo
|
||||||
|
done
|
||||||
Reference in New Issue
Block a user