Skip to content

Instantly share code, notes, and snippets.

@cdgraff
Created February 11, 2018 20:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cdgraff/57c16a9d04341900044ce2fe913e782d to your computer and use it in GitHub Desktop.
Save cdgraff/57c16a9d04341900044ce2fe913e782d to your computer and use it in GitHub Desktop.
k8s - Delete Evicted PODs
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