GCP Associate Cloud Engineer Practice Question 93: GKE Spot Nodepool Taints
Google Cloud Associate Cloud Engineer · Test 10 · question 3 of 10
A GKE Standard cluster runs a customer-facing web Deployment on an on-demand node pool. To cut cost, you add a second node pool backed by Spot VMs for a batch analytics workload that runs as Jobs and can tolerate being interrupted and restarted. The web pods must never be scheduled onto Spot nodes, and the Job pods must run only on Spot nodes.
Which configuration meets both requirements?
Show answer and explanation
Answer:
GKE labels every Spot VM node with cloud.google.com/gke-spot=true, but a node pool you create yourself is not tainted unless you ask for it with the --node-taints flag. The two requirements need two different mechanisms. The NoSchedule taint repels every pod that lacks a matching toleration, which keeps the web pods off the Spot nodes. The toleration only permits the Job pods to land on a tainted node; it does not attract them there, so the nodeSelector on the cloud.google.com/gke-spot label is what confines them to Spot capacity.
Option A pins the Jobs to Spot nodes, but with no taint the scheduler is still free to place web pods on the Spot pool, breaking the first requirement. Option B keeps web pods off Spot nodes, but a toleration alone lets the Job pods run anywhere, including the on-demand pool. Option D is wrong because a PodDisruptionBudget limits how many pods voluntary disruptions can evict at once; it has no effect on which nodes the scheduler chooses.
Reference: Run fault-tolerant workloads at lower costs with Spot VMs