Last active
November 10, 2017 14:26
-
-
Save ricjcosme/892e0e3f6f10120278962f3055df6212 to your computer and use it in GitHub Desktop.
Generate kubectl delete commands for replica sets
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 --all-namespaces rs -o json|jq -r '.items[] | select(.spec.replicas | contains(0)) | "kubectl delete rs --namespace=\(.metadata.namespace) \(.metadata.name)"' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment