Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Delete all Evicted pods across namespaces
# Requires kubectl and jq
kubectl get po -a --all-namespaces -o json | \
jq '.items[] | select(.status.reason!=null) | select(.status.reason | contains("Evicted")) |
"kubectl delete po \( -n \(.metadata.namespace)"' | xargs -n1 bash -c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment