Skip to content

Instantly share code, notes, and snippets.

@utkuozdemir
Created January 29, 2021 12:24
Show Gist options
  • Save utkuozdemir/4d92f581508d29277409d8f4c4f10eda to your computer and use it in GitHub Desktop.
Save utkuozdemir/4d92f581508d29277409d8f4c4f10eda to your computer and use it in GitHub Desktop.
Delete all Kubernetes pods in CrashLoopBackOff
# Delete - dry run
kubectl get pods --all-namespaces | grep CrashLoopBackOff | awk '{print "--namespace " $1 " " $2}' | xargs -L 1 kubectl delete pod --dry-run=client
# Delete
kubectl get pods --all-namespaces | grep CrashLoopBackOff | awk '{print "--namespace " $1 " " $2}' | xargs -L 1 kubectl delete pod
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment