Question

Difficulty: MediumManaging Google Kubernetes Engine Resources

A company runs a batch processing application on a Google Kubernetes Engine (GKE) Standard cluster. The workload processes fault-tolerant, stateless data jobs during overnight operations. The cloud engineering team wants to significantly reduce infrastructure costs while ensuring that node capacity automatically expands during peak processing demand and contracts when jobs complete. Which strategy should the cloud engineer implement to meet these requirements?

  1. Create a dedicated GKE node pool configured with Spot VMs and enable Cluster Autoscaler on the node pool with defined minimum and maximum node limits.Answer
  2. B
    Create a GKE node pool using standard Compute Engine instances and deploy a Horizontal Pod Autoscaler (HPA) configured to adjust the cluster node count based on node CPU metrics.
  3. C
    Migrate the workload to GKE Autopilot mode and apply custom operating system kernel configurations to the worker nodes to control node scaling behavior manually.
  4. D
    Create a standard node pool with static sizing and generate exported service account JSON keys to allow workload pods to dynamically provision Compute Engine instances.

Answer

Create a dedicated GKE node pool configured with Spot VMs and enable Cluster Autoscaler on the node pool with defined minimum and maximum node limits.
Configuring a dedicated node pool with Spot VMs provides up to 60-90% cost savings for stateless, fault-tolerant batch processing. Enabling Cluster Autoscaler on the node pool allows GKE to automatically scale the worker node count up when pending pods need resources and down when demand subsides.

Step-by-Step Solution

1
Identify workload characteristics and cost optimization requirements.
Stateless, fault-tolerant batch processing jobs are ideal candidates for Spot VMs, which offer significant discounts compared to standard instances.
Spot VMs can be preempted by Compute Engine at any time, making them suitable only for stateless or resilient workloads.
2
Select the appropriate scaling mechanism for GKE infrastructure nodes.
Cluster Autoscaler automatically adjusts the number of nodes in a given node pool based on unschedulable pods and node resource utilization.
Horizontal Pod Autoscaler (HPA) adjusts pod replica counts, not node instance counts.
3
Combine Spot VM node pool provision with Cluster Autoscaler configuration.
Configuring a dedicated node pool with `--spot` and `--enable-autoscaling` achieves both automated infrastructure scaling and cost optimization.
This combination ensures nodes expand when batch pods are queued and scale down to minimum bounds when idle.

Key Concept

GKE Spot VM Node Pools and Cluster Autoscaler Operations
Rate this question