Created
February 21, 2020 12:20
-
-
Save carlessanagustin/daa9755a9c245f2aefd367b787a1ce82 to your computer and use it in GitHub Desktop.
Enable/disable nodes from Kubernetes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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