Skip to content

Instantly share code, notes, and snippets.

@kirkins
Last active April 30, 2018 15:55
Show Gist options
  • Save kirkins/a28fe694d4a8f2756a8841544910557b to your computer and use it in GitHub Desktop.
Save kirkins/a28fe694d4a8f2756a8841544910557b to your computer and use it in GitHub Desktop.
Command to quickly clear out everything in default namespace on k8s
# command to remove all deployments, services, and pods, with y/N prompt
cleankube() {
read -r -p "Are you sure you want to delete all deployments, services, and pods? [y/N] " response
case "$response" in
[yY][eE][sS]|[yY])
kubectl delete deployment --all && kubectl delete pods --all && kubectl delete services --all
;;
*)
esac
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment