Cordoning nodes
Let's suppose we are going to run an app's load test and we want to keep a node away from the load test. In the node list that we saw in the Getting a list of nodes section, we have three nodes, and they are all in the Ready
state. Let's pick one node, gke-kubectl-lab-default-pool-b3c7050d-8jhj
, which we do not want new pods to be scheduled on.
kubectl
has a command called cordon
, which allows us to make a node unschedulable:
$ kubectl cordon -h Mark node as unschedulable. Examples: # Mark node "foo" as unschedulable. kubectl cordon foo Options: --dry-run='none': Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource. -l, --selector='': Selector (label query) to filter on Usage...