Soru

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

A company runs a stateless web application on a Google Kubernetes Engine (GKE) Standard cluster. During peak traffic hours, incoming requests cause high CPU utilization, requiring more Pod instances. However, when additional Pods are created, several remain stuck in a Pending status because the current worker nodes have exhausted their CPU and memory capacity. Which configuration strategy should the cloud engineer implement to automatically handle scaling for both the workload Pods and the underlying cluster node capacity?

  1. Configure a Horizontal Pod Autoscaler (HPA) for the deployment to adjust Pod replicas based on CPU utilization, and enable Cluster Autoscaler on the GKE cluster to automatically add nodes when Pods are unschedulable.Cevap
  2. B
    Configure Cluster Autoscaler on the deployment to adjust Pod replica counts based on CPU metrics, and configure a Horizontal Pod Autoscaler (HPA) on the cluster to add worker nodes to the node pool.
  3. C
    Provision a new Spot VM node pool and set resource limits to zero so GKE can bypass physical node capacity restrictions during traffic surges without scaling infrastructure.
  4. D
    Migrate the deployment to a Compute Engine Managed Instance Group (MIG) autoscaling policy to directly manage Kubernetes Pod lifecycle and scheduling across zones.

Cevap

Configure a Horizontal Pod Autoscaler (HPA) for the deployment to adjust Pod replicas based on CPU utilization, and enable Cluster Autoscaler on the GKE cluster to automatically add nodes when Pods are unschedulable.
To resolve pending Pods caused by insufficient node capacity during traffic spikes, Google Cloud recommends combining Horizontal Pod Autoscaler (HPA) for workload Pod replica scaling with GKE Cluster Autoscaler for node infrastructure scaling. HPA reacts to resource utilization by increasing Pod counts, and Cluster Autoscaler detects Pending Pods to add new compute nodes to the node pool.

Adım Adım Çözüm

1
Identify workload scaling requirements
Determine that increasing traffic requires dynamic scaling of Pod replicas based on resource metrics like CPU utilization.
Horizontal Pod Autoscaler (HPA) is the standard Kubernetes resource designed to scale Pod counts automatically.
2
Identify infrastructure capacity requirements
Determine that pending Pods indicate a shortage of allocatable node CPU/memory capacity.
Cluster Autoscaler detects unschedulable Pods in a Pending state and automatically provisions additional compute nodes in the GKE node pool.
3
Combine workload and infrastructure autoscaling mechanisms
Pairing HPA with Cluster Autoscaler creates a complete auto-scaling pipeline from application demand to GKE worker nodes.
HPA scales out Pods when load increases, and Cluster Autoscaler expands node capacity if those Pods cannot fit on existing nodes.

Anahtar Kavram

GKE Workload and Cluster Autoscaling Mechanisms
Bu soruyu puanla