Skip to content

Instantly share code, notes, and snippets.

@wimvds
Last active January 27, 2020 09:30
Show Gist options
  • Save wimvds/fbcf0fc170ba8e0f16fc1ab5c2952583 to your computer and use it in GitHub Desktop.
Save wimvds/fbcf0fc170ba8e0f16fc1ab5c2952583 to your computer and use it in GitHub Desktop.
Kubernetes snippets

Kubernetes snippets

Remove all replicasets without pods on ready state

kubectl get replicasets --all-namespaces -o json | jq '.items[] | select(.status.readyReplicas<1) | "kubectl delete replicasets \(.metadata.name) -n \(.metadata.namespace)"' | xargs -n 1 bash -c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment