A cloud engineer manages a Google Kubernetes Engine (GKE) Standard cluster named `analytics-cluster` in zone `us-central1-a`. Several newly deployed workload Pods are stuck in a `Pending` state because the existing node pool named `analytics-pool` lacks sufficient CPU capacity to schedule them. The engineer needs to ensure that worker node capacity automatically scales out whenever Pods cannot be scheduled due to resource constraints. Which `gcloud` command should the engineer execute?
- gcloud container clusters update analytics-cluster --enable-autoscaling --node-pool=analytics-pool --min-nodes=2 --max-nodes=8 --zone=us-central1-aAnswer
- Bkubectl autoscale deployment analytics-worker --min=2 --max=8 --cpu-percent=80
- Cgcloud container node-pools update analytics-pool --cluster=analytics-cluster --enable-spot --zone=us-central1-a
- Dgcloud container clusters update analytics-cluster --enable-autoprovisioning --zone=us-central1-a
Answer
Execute `gcloud container clusters update analytics-cluster --enable-autoscaling --node-pool=analytics-pool --min-nodes=2 --max-nodes=8 --zone=us-central1-a` to enable Cluster Autoscaler on the existing node pool.
The correct command updates the GKE cluster configuration by enabling Cluster Autoscaler specifically for the target node pool (`analytics-pool`) with defined minimum and maximum node limits. When Pods cannot be scheduled due to insufficient CPU, Cluster Autoscaler provisions additional Compute Engine nodes in the pool.
Step-by-Step Solution
Key Concept
GKE Cluster Autoscaler configuration for dynamic node pool scaling