Created
June 11, 2019 10:51
-
-
Save palonsoro/7ea0caa65ff534fccd4e19b0b5c5655d to your computer and use it in GitHub Desktop.
Delete all the failed pods on an OpenShift cluster
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
#!/bin/bash | |
oc get pod -o wide --all-namespaces --field-selector=status.phase=Failed -o template --template '{{range .items}}-n {{.metadata.namespace}} {{.metadata.name}}{{"\n"}}{{end}}' | xargs -n3 oc delete pod |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment