An enterprise application team is preparing to deploy a fault-tolerant, stateless data processing microservice to an existing Google Kubernetes Engine (GKE) Standard cluster. To optimize compute expenses, the cluster administrator has provisioned a secondary node pool using Spot VMs. Which configuration must be included in the application's Deployment manifest to ensure its pods are scheduled only on the Spot VM node pool?
- Specify a nodeSelector matching the cloud.google.com/gke-spot: "true" label within the Pod template specification.Answer
- BConfigure a Horizontal Pod Autoscaler (HPA) resource with a target CPU utilization metric set to trigger Spot node provisioning.
- CRun gcloud config set container/cluster to target the Spot node pool before applying the deployment with kubectl.
- DDeploy the application to GKE Autopilot mode, which automatically converts all stateless workloads to run on Spot nodes.
Answer
Specify a nodeSelector matching the cloud.google.com/gke-spot: "true" label within the Pod template specification.
GKE automatically attaches the label cloud.google.com/gke-spot: "true" to nodes provisioned within a Spot node pool. Including a matching nodeSelector in the deployment template ensures the Kubernetes scheduler assigns pods only to nodes possessing that label.
Step-by-Step Solution
Key Concept
Scheduling workloads on GKE Spot VM node pools using nodeSelector labels
Estimated Time:1m 30s