Skip to content

Instantly share code, notes, and snippets.

@ragul28
Created January 11, 2020 09:20
Show Gist options
  • Star 32 You must be signed in to star a gist
  • Fork 11 You must be signed in to fork a gist
  • Save ragul28/6af1b536abe1d2e1e62dbea0ee64f2d5 to your computer and use it in GitHub Desktop.
Save ragul28/6af1b536abe1d2e1e62dbea0ee64f2d5 to your computer and use it in GitHub Desktop.
k8s Trick to Scale down daemonset to zero
  • Scaling k8s daemonset down to zero
kubectl -n kube-system patch daemonset myDaemonset -p '{"spec": {"template": {"spec": {"nodeSelector": {"non-existing": "true"}}}}}'
  • Scaling up k8s daemonset
kubectl -n kube-system patch daemonset myDaemonset --type json -p='[{"op": "remove", "path": "/spec/template/spec/nodeSelector/non-existing"}]'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment