Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save dostolu/6342cf72cbf26b4fe859258bd346a252 to your computer and use it in GitHub Desktop.
Save dostolu/6342cf72cbf26b4fe859258bd346a252 to your computer and use it in GitHub Desktop.
Delete evicted pods
kubectl get pods | grep Evicted | awk '{print $1}' | xargs kubectl delete pod
@dostolu
Copy link
Author

dostolu commented May 28, 2018

kubectl get po -a --all-namespaces -o json | jq  '.items[] | select(.status.reason!=null) | select(.status.reason | contains("Evicted")) | "kubectl delete po \(.metadata.name) -n \(.metadata.namespace)"' | xargs -n 1 bash -c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment