Question

Difficulty: HardManaging Google Kubernetes Engine Resources

A cloud engineer is managing a production Google Kubernetes Engine (GKE) Standard cluster that hosts both a critical payment microservice and a batch data processing job. The batch data processing job should only execute on dedicated Spot VM node pools to reduce operational costs, while the payment microservice must remain strictly isolated on on-demand Compute Engine nodes to prevent unexpected termination. Which TWO configuration steps must the engineer take to achieve this workload isolation? Select two.

  1. Apply a node taint to the Spot VM node pool and configure matching tolerations on the batch data processing Pod specification.Answer
  2. Configure nodeSelector or nodeAffinity rules on the batch data processing Pod specification to explicitly target the Spot VM node pool labels.Answer
  3. C
    Configure a Horizontal Pod Autoscaler (HPA) target on the Spot VM node pool to automatically add Compute Engine nodes when pending Pods accumulate.
  4. D
    Add Spot VM tolerations to the payment microservice Pod specification so it can spill over to Spot nodes during peak traffic events.

Answer

To isolate workloads on GKE, you must apply a node taint to the Spot VM node pool along with matching tolerations on the batch processing Pods, and configure nodeSelector or nodeAffinity rules on the batch Pod specification to explicitly target the Spot node pool labels.
Workload isolation on GKE requires a combination of taints/tolerations and node affinity. Tainting the Spot VM node pool ensures that general workloads (like the payment microservice) are repelled from preemptible nodes. Adding tolerations to the batch processing Pod manifest allows it to be placed on tainted nodes, while defining nodeSelector or nodeAffinity rules actively pulls the batch Pods to the Spot VM node pool.

Step-by-Step Solution

1
Repel non-batch Pods from Spot nodes
Applying taints to the Spot node pool prevents Pods without matching tolerations (such as the payment microservice) from scheduling on Spot instances.
Taints act as repellants on nodes to ensure un-tolerated Pods are not placed on preemptible hardware.
2
Allow and direct batch Pods onto Spot nodes
Adding tolerations and nodeSelector/nodeAffinity to the batch Pod manifest enables them to tolerate the Spot taint and explicitly attracts them to the designated node pool.
Tolerations allow Pods to bound to tainted nodes, while nodeAffinity ensures Pods actively select those specific nodes.

Key Concept

Workload Isolation in GKE using Taints, Tolerations, and Node Affinity
Estimated Time:2m 0s
Rate this question