Last active
September 20, 2018 21:44
-
-
Save saidsef/c2a17c1a0428de203a4d32a16eccedd8 to your computer and use it in GitHub Desktop.
Kubernetes cleanup evicted pods across all namespaces
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
| # Qucik way to cleanup evicted pods across all namespaces | |
| # Long term fix: https://kubernetes.io/docs/tasks/administer-cluster/out-of-resource/ | |
| for NS in `kubectl get ns | grep -v NAME | awk '{ print $1 }'`; do | |
| kubectl get all -n $NS | grep -i evicted | awk '{ print $1 }' | while read f; do kubectl delete -n $NS $f; done | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment