-
-
Save jamesholcomb/7a19247f2b773e36d9da8451fe887dc2 to your computer and use it in GitHub Desktop.
A simply script to delete all failed pods from Kubernetes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kubectl get pods --all-namespaces | grep Evicted | awk '{print $2 " --namespace=" $1}' | xargs kubectl delete pod |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
deletes status = Terminated and NodeShutdown
kubectl delete pods -A --field-selector=status.phase=Failed