Soru

Zorluk: OrtaDeploying and Managing Google Kubernetes Engine (GKE) Clusters and Workloads

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?

  1. Specify a nodeSelector matching the cloud.google.com/gke-spot: "true" label within the Pod template specification.Cevap
  2. B
    Configure a Horizontal Pod Autoscaler (HPA) resource with a target CPU utilization metric set to trigger Spot node provisioning.
  3. C
    Run gcloud config set container/cluster to target the Spot node pool before applying the deployment with kubectl.
  4. D
    Deploy the application to GKE Autopilot mode, which automatically converts all stateless workloads to run on Spot nodes.

Cevap

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.

Adım Adım Çözüm

1
Identify the node labeling mechanism used by GKE for Spot VM node pools.
GKE automatically assigns the node label cloud.google.com/gke-spot="true" to nodes provisioned in Spot node pools.
Kubernetes uses labels on nodes to allow workloads to target specific hardware or pricing configurations.
2
Configure the Kubernetes Deployment spec to target this node label.
Adding nodeSelector: cloud.google.com/gke-spot: "true" inside the template spec directs the Kubernetes scheduler to place pods only on matching Spot nodes.
nodeSelector is the standard way to constrain pod scheduling to nodes with specific key-value labels.

Anahtar Kavram

Scheduling workloads on GKE Spot VM node pools using nodeSelector labels
Tahmini Süre:1m 30s
Bu soruyu puanla