Skip to content

Instantly share code, notes, and snippets.

@wyaeld
Created October 4, 2018 22:01
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 wyaeld/593c22dbcc22af3775d95ec4473f2bee to your computer and use it in GitHub Desktop.
Save wyaeld/593c22dbcc22af3775d95ec4473f2bee to your computer and use it in GitHub Desktop.
kubectl magic
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