Skip to content

Instantly share code, notes, and snippets.

@tvorogme
Created October 22, 2023 17:24
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 tvorogme/ae1aa0f97a05ec13c1fb9e8715b24bf0 to your computer and use it in GitHub Desktop.
Save tvorogme/ae1aa0f97a05ec13c1fb9e8715b24bf0 to your computer and use it in GitHub Desktop.
delete all evicted pods kubernetes
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