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?
- 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
- BConfigure a Horizontal Pod Autoscaler (HPA) using kubectl autoscale deployment with a lower target CPU utilization percentage to force the pending Pods onto existing nodes.
- CConvert 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.
- DUpdate 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
Key Concept
GKE Cluster Autoscaler vs Horizontal Pod Autoscaler (HPA)