Created
October 19, 2023 17:49
-
-
Save igabice/8cb71dfa6923044f05d6a2546b95ee38 to your computer and use it in GitHub Desktop.
A bash script that deletes kubernetes pods in bad state
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! 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