Skip to content

Instantly share code, notes, and snippets.

@igabice
Created October 19, 2023 17:49
Show Gist options
  • Save igabice/8cb71dfa6923044f05d6a2546b95ee38 to your computer and use it in GitHub Desktop.
Save igabice/8cb71dfa6923044f05d6a2546b95ee38 to your computer and use it in GitHub Desktop.
A bash script that deletes kubernetes pods in bad state
#! bash
kubectl get pods | grep -E OutOfcpu\|Evicted\|OOMKilled\|Error\|ContainerStatusUnknown | awk '{print "kubectl delete pod " $1 }'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment