Skip to content

Instantly share code, notes, and snippets.

@klesouza
Created February 3, 2020 14:47
Show Gist options
  • Save klesouza/d7a3f82aef395f19bd991211401fc567 to your computer and use it in GitHub Desktop.
Save klesouza/d7a3f82aef395f19bd991211401fc567 to your computer and use it in GitHub Desktop.
Find all resources in Kubernetes for deletion
kubectl api-resources --verbs="get" --no-headers=true | awk '{ print $1; }' | xargs -I {} sh -c 'for i in `kubectl get $1`; do echo "$1\t$i"; done' sh {} | awk '{ print "kubectl delete " $1 " " $2; }' | grep WHAT_YOUR_ARE_LOOKING_FOR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment