Skip to content

Instantly share code, notes, and snippets.

@darth-veitcher
Created April 27, 2020 22:16
Show Gist options
  • Save darth-veitcher/2df2791a2c4f2c8b0e944d8375aad3f1 to your computer and use it in GitHub Desktop.
Save darth-veitcher/2df2791a2c4f2c8b0e944d8375aad3f1 to your computer and use it in GitHub Desktop.
delete all evicted pods in kubernetes
kubectl get pods -A --all-namespaces -o json | jq '.items[] | select(.status.reason!=null) | select(.status.reason | contains("Evicted")) | "kubectl delete pods \(.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