Skip to content

Instantly share code, notes, and snippets.

@matti
Created November 12, 2022 15:47
Show Gist options
  • Save matti/9187604c2f7b935abee1cdcae1d10773 to your computer and use it in GitHub Desktop.
Save matti/9187604c2f7b935abee1cdcae1d10773 to your computer and use it in GitHub Desktop.
while true; do
kubectl get pods --all-namespaces --no-headers | awk '$5 > 3 {print $1,$2}' | xargs -r kubectl delete pod -n || echo "failed to delete pods"
sleep 30
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment