Skip to content

Instantly share code, notes, and snippets.

@wombat
Created October 25, 2016 13:48
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 wombat/370743308c7c5d526218fc1c1989e753 to your computer and use it in GitHub Desktop.
Save wombat/370743308c7c5d526218fc1c1989e753 to your computer and use it in GitHub Desktop.
Kubernetes - Old ReplicaSet cleanup
kubectl get rs --all-namespaces | awk {' if ($3 == 0 && $4 == 0) system("kubectl delete rs "$2" --namespace="$1)'}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment