Skip to content

Instantly share code, notes, and snippets.

@davosian
Created September 29, 2021 10:59
Show Gist options
  • Save davosian/bb5448d20b0990e2817997ee93b6c63b to your computer and use it in GitHub Desktop.
Save davosian/bb5448d20b0990e2817997ee93b6c63b to your computer and use it in GitHub Desktop.

Revisions

  1. davosian created this gist Sep 29, 2021.
    1 change: 1 addition & 0 deletions script.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    kubectl get pods --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