Skip to content

Instantly share code, notes, and snippets.

@rcosnita
Last active November 19, 2020 16:57
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 rcosnita/92728f72e8d27d7c3451748a66ff4453 to your computer and use it in GitHub Desktop.
Save rcosnita/92728f72e8d27d7c3451748a66ff4453 to your computer and use it in GitHub Desktop.
Delete all resources from k8s
#!/usr/bin/env bash
# # this gist is extracted from another gist on internet which I don't remember right now.
# kubectl-delete_all is a utility to delete all objects in the namespace.
[[ -n "$DEBUG" ]] && set -x
set -eou pipefail
exec kubectl delete "$(kubectl api-resources --namespaced=true --verbs=delete -o name | tr "\n" "," | sed -e 's/,$//')" --all "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment