Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@ricjcosme
Last active November 10, 2017 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ricjcosme/892e0e3f6f10120278962f3055df6212 to your computer and use it in GitHub Desktop.
Save ricjcosme/892e0e3f6f10120278962f3055df6212 to your computer and use it in GitHub Desktop.
Generate kubectl delete commands for replica sets
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