Created
February 13, 2018 12:17
-
-
Save owainlewis/77b241a0063ddf4a9541b71323b07bc0 to your computer and use it in GitHub Desktop.
Delete all non running Kubernetes pods
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 -a | grep -v Running | awk '{print $1}' | xargs kubectl delete pod |
-a is not a legal flag
kubectl get pods --no-headers | grep -v Running | awk '{print $2}' | xargs kubectl delete pod
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
without -a is work