Created
September 3, 2020 17:25
-
-
Save paddy74/4c0e4832a9aa3cd201dccbda2673b18c to your computer and use it in GitHub Desktop.
Clean bad 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
#!/bin/bash | |
kubectl get pods --all-namespaces | grep -E 'ImagePullBackOff|ErrImagePull|Evicted' | awk '{print $2 " --namespace=" $1}' | xargs kubectl delete pod | |
#kubectl get pods --all-namespaces --field-selector 'status.phase==Failed' -o json | kubectl delete -f - |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment