Question

Difficulty: HardManaging Google Kubernetes Engine Resources

A site reliability engineering (SRE) team receives alerts that several replicas of a data processing service deployed on a Google Kubernetes Engine (GKE) Standard cluster are stuck in a Pending state. Running kubectl describe pod reveals the event condition 0/6 nodes are available: 6 Insufficient cpu. The existing node pool contains 6 compute instances and currently has autoscaling disabled. Resource requests and limits for the workload containers are properly defined in the Deployment manifest. Which operational action should the cloud engineer take to resolve the pending Pods and enable dynamic node scaling based on resource demand?

  1. Enable Cluster Autoscaler on the existing node pool by running gcloud container node-pools update with the --enable-autoscaling flag and defining --min-nodes and --max-nodes boundaries.Answer
  2. B
    Configure a Horizontal Pod Autoscaler (HPA) using kubectl autoscale deployment with a lower target CPU utilization percentage to force the pending Pods onto existing nodes.
  3. C
    Convert the live GKE Standard cluster to GKE Autopilot mode by executing gcloud container clusters update with the --enable-autopilot flag to remove node capacity management overhead.
  4. D
    Update the existing node pool to use Spot VMs by applying the --preemptible flag with gcloud container node-pools update to bypass compute resource limits.

Answer

Enable Cluster Autoscaler on the existing node pool by running gcloud container node-pools update with the --enable-autoscaling flag and defining --min-nodes and --max-nodes boundaries.
Enabling Cluster Autoscaler on the node pool using gcloud container node-pools update --enable-autoscaling allows GKE to detect unschedulable Pods (caused by insufficient CPU) and automatically scale up the number of Compute Engine worker nodes within specified --min-nodes and --max-nodes limits.

Step-by-Step Solution

1
Analyze the error state from kubectl describe pod.
The message 0/6 nodes are available: 6 Insufficient cpu indicates that all 6 nodes in the cluster are at full CPU capacity, preventing new Pods from being scheduled.
Existing compute node resources are completely exhausted while Pod resource requests are valid.
2
Differentiate between workload scaling (HPA) and infrastructure scaling (Cluster Autoscaler).
HPA scales Pod count, whereas Cluster Autoscaler provisions additional Compute Engine VM instances in a GKE node pool when Pods are unschedulable due to resource constraints.
Creating more Pods via HPA will not help when the cluster lacks node CPU capacity; new nodes must be added.
3
Select the correct gcloud command to enable node autoscaling on the existing GKE node pool.
Running gcloud container node-pools update <pool-name> --cluster=<cluster-name> --enable-autoscaling --min-nodes=<min> --max-nodes=<max> enables the Cluster Autoscaler for that node pool.
This enables GKE to automatically scale the node count up to max-nodes when Pods are unschedulable.

Key Concept

GKE Cluster Autoscaler vs Horizontal Pod Autoscaler (HPA)
Rate this question