Created
May 22, 2024 09:05
-
-
Save clayrisser/f5ac8cf9185cc737a28042791655a2dc to your computer and use it in GitHub Desktop.
Delete all pods with phase Error
This file contains hidden or 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
kubectl get pods --all-namespaces -o custom-columns=NAMESPACE:.metadata.namespace,NAME:.metadata.name,REASON:.status.phase --field-selector=status.phase=Failed --no-headers | awk '{print $1 " " $2}' | while read ns pod; do echo kubectl delete pod $pod -n $ns |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment