A cloud engineer manages a production Google Kubernetes Engine (GKE) Standard cluster hosting both latency-sensitive microservices and fault-tolerant background batch workloads. To reduce compute expenditures, the engineer needs to provision a secondary node pool using GCP Spot VMs for the batch workloads. The implementation must ensure that Cluster Autoscaler dynamically adjusts node counts based on pending pod demand, while strictly preventing latency-sensitive web pods from being scheduled onto Spot instances. Which strategy correctly configures the GKE node pool and workload specifications to satisfy these requirements?
- ACreate the new node pool using gcloud container node-pools create with the --spot flag, configure a Horizontal Pod Autoscaler (HPA) targeting node count metrics to add nodes when unschedulable pods are detected, and define node selectors on the batch workloads.
- BMigrate the existing GKE Standard cluster to GKE Autopilot mode using gcloud container clusters update, relying on default Autopilot behavior to provision Spot nodes dynamically without setting node taints or workload tolerations.
- Create the new node pool using gcloud container node-pools create with the flags --spot, --enable-autoscaling, and --node-taints=cloud.google.com/gke-spot=true:NoSchedule, then add matching tolerations and node affinity to the batch workload Deployment manifests.Answer
- DCreate the new node pool using gcloud container node-pools create with the --spot flag without node taints, and configure higher CPU resource requests on latency-sensitive workloads so the Kubernetes scheduler avoids placing them on Spot nodes.
Answer
Create the node pool with Spot instances, Cluster Autoscaler enabled, and a node taint of cloud.google.com/gke-spot=true:NoSchedule via gcloud, while configuring corresponding tolerations and node affinity in the batch workload specifications.
Combining `--spot`, `--enable-autoscaling`, and `--node-taints` during node pool provisioning ensures that nodes scale automatically when unschedulable pods are queued, while guaranteeing that untolerated latency-sensitive workloads are never scheduled on Spot VMs. Adding tolerations and node affinity to the batch workloads enables them to run on the tainted Spot nodes.
Step-by-Step Solution
Key Concept
Managing GKE Node Pools with Spot VMs, Cluster Autoscaler, and Taints/Tolerations
Estimated Time:3m 0s