Skip to content

Instantly share code, notes, and snippets.

@ybelleguic
Created May 31, 2021 11:47
Show Gist options
  • Save ybelleguic/e63fcb0bc6f730d5edd200f66db874e0 to your computer and use it in GitHub Desktop.
Save ybelleguic/e63fcb0bc6f730d5edd200f66db874e0 to your computer and use it in GitHub Desktop.
kubernetes list all objects in ns
function klsns() {
NS=$1
if [ "${#@}" -eq "0" ]; then
NS="default"
fi
for i in $(kubectl api-resources --verbs=list --namespaced -o name 2>/dev/null)
do
kubectl get --show-kind --ignore-not-found -n $NS $i 2>/dev/null
sleep 0.1
done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment