Skip to content

Instantly share code, notes, and snippets.

@mcfearsome
Created June 4, 2022 21:02
Show Gist options
  • Save mcfearsome/5c4506103787a5f352b5596eb03de4d2 to your computer and use it in GitHub Desktop.
Save mcfearsome/5c4506103787a5f352b5596eb03de4d2 to your computer and use it in GitHub Desktop.
k8s-find-resources-in-ns.bash
#!/usr/bin/env bash
ns=default
(k api-resources --namespaced --no-headers | awk '{ print $1 }' -) | (
while read -r LINE; do
echo "resources is: $LINE";
kubectl --namespace=$ns get "$LINE" -owide
done;
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment