Skip to content

Instantly share code, notes, and snippets.

@carlessanagustin
Created February 21, 2020 12:20
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 carlessanagustin/daa9755a9c245f2aefd367b787a1ce82 to your computer and use it in GitHub Desktop.
Save carlessanagustin/daa9755a9c245f2aefd367b787a1ce82 to your computer and use it in GitHub Desktop.
Enable/disable nodes from Kubernetes
# ENABLE NODE
kc uncordon $NODE
kubectl taint nodes $NODE dedicated-
# NODE ID
export NODE=
# DISABLE NODE
kc drain $NODE --ignore-daemonsets
kubectl taint nodes $NODE dedicated=special-user:NoExecute
########
# WATCH NODES
watch kubectl get nodes
# watch "kubectl get nodes -o json | jq '.items[].spec.taints'"
########
# WATCH ALL PODS
watch kubectl get pods -o wide --sort-by="{.spec.nodeName}" --all-namespaces
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment