Created
June 12, 2023 20:57
-
-
Save onpaws/f94f60ba5cf6604f9465c948c89e9ceb to your computer and use it in GitHub Desktop.
Clean up evicted pods 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
# k8s will evict pods when resources get too tight, and by default retains a long history of evictions (either >12k, or 1000 on Rancher) | |
# This commmand will clean up the stale/evicted pods | |
kubectl get pods -A | grep Evicted | while read namespace pod rest; do kubectl delete pod $pod -n $namespace; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment