Forked from svx/delete-evicted-pods-all-namespaces.sh
Last active
February 24, 2020 09:24
-
-
Save 15below-adamhancock/a82ab913f07132232c058596a899d582 to your computer and use it in GitHub Desktop.
Delete evicted pods from all namespaces (also ImagePullBackOff and ErrImagePull)
This file contains hidden or 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/sh | |
# delete all containers in ImagePullBackOff or ErrImagePull or Evicted state from all namespaces | |
kubectl get pods --all-namespaces | grep -E 'ImagePullBackOff|ErrImagePull|Evicted' | awk '{print $2 " --namespace=" $1}' | xargs kubectl delete pod -n 15below |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment