Soru

Zorluk: Çok zorManaging Google Kubernetes Engine Resources

A Lead Cloud Engineer is optimizing cost and availability for a GKE Standard cluster hosting a critical web API and a batch data processing pipeline. The batch pipeline consists of stateless, fault-tolerant workloads that must run strictly on cost-effective Spot VMs to reduce compute expenditure. The web API workloads must never be scheduled onto the Spot VM instances to ensure stability. Which TWO actions must you perform to configure the GKE cluster resources correctly? (Select TWO answers.)

  1. Create a new GKE node pool configured with Spot VMs (`--spot`) and apply a node taint such as `workload=batch:NoSchedule` to the node pool.Cevap
  2. B
    Configure the Horizontal Pod Autoscaler (HPA) using `kubectl autoscale` with the `--enable-autoscaling` flag to dynamically provision new Spot VM node instances when batch Pod resource requests spike.
  3. Add a corresponding toleration for `workload=batch:NoSchedule` and a node selector or node affinity targeting the Spot VM node pool in the batch workload Deployment specification.Cevap
  4. D
    Migrate the existing GKE Standard cluster to an Autopilot cluster and configure custom Linux kernel parameters on the node pool to handle Spot VM preemptions automatically.

Cevap

To isolate batch workloads onto Spot VMs while preventing core API workloads from being scheduled on them, you must create a dedicated Spot VM node pool with a Kubernetes taint (such as workload=batch:NoSchedule) and configure the batch processing Deployment with a matching toleration along with node selector or node affinity rules targeting the Spot node pool.
Isolating workloads on Spot VMs requires combining node taints with pod tolerations and node affinity. Tainting the Spot VM node pool with NoSchedule prevents non-batch pods (such as the web API) from being scheduled on Spot nodes. Adding the matching toleration and node selector/affinity to the batch workload specification enables and directs batch pods to land on the Spot VM nodes.

Adım Adım Çözüm

1
Provision a dedicated Spot VM node pool with a taint
Node pool instances are provisioned as Spot VMs, and the taint prevents any Pod without a matching toleration from being placed on these nodes.
This guarantees that regular cluster workloads (like the API service) will not accidentally run on preemptible Spot nodes.
2
Configure batch Deployment pod spec with tolerations and node placement rules
Batch Pods gain the ability to bypass the taint and are explicitly directed to schedule on the Spot VM node pool.
Tolerations allow pods to schedule on tainted nodes, while node selectors or node affinity ensure the batch pods prefer or require the Spot node pool.

Anahtar Kavram

GKE Node Pool Isolation with Taints, Tolerations, and Spot VMs
Tahmini Süre:2m 0s
Bu soruyu puanla