A DevOps engineer is managing a Google Kubernetes Engine (GKE) Standard cluster named `prod-app-cluster` in zone `us-central1-a`. During a traffic increase, several new microservice pods remain in a `Pending` state because the existing node pool, `frontend-pool`, lacks sufficient CPU resources to schedule them. The engineer needs to ensure that the GKE cluster automatically adds Compute Engine nodes to `frontend-pool` when pods are unschedulable due to resource constraints, up to a maximum of 10 nodes. Which command should the engineer run to achieve this requirement?
- gcloud container clusters update prod-app-cluster --enable-autoscaling --min-nodes=1 --max-nodes=10 --node-pool=frontend-pool --zone=us-central1-aAnswer
- Bkubectl autoscale deployment frontend-pool --min=1 --max=10 --cpu-percent=80
- Cgcloud container clusters update prod-app-cluster --enable-autopilot --node-pool=frontend-pool --zone=us-central1-a
- Dgcloud container node-pools update frontend-pool --cluster=prod-app-cluster --spot --zone=us-central1-a
Answer
Execute the `gcloud container clusters update prod-app-cluster --enable-autoscaling --min-nodes=1 --max-nodes=10 --node-pool=frontend-pool --zone=us-central1-a` command.
Enabling Cluster Autoscaler on a node pool via `gcloud container clusters update prod-app-cluster --enable-autoscaling --min-nodes=1 --max-nodes=10 --node-pool=frontend-pool --zone=us-central1-a` instructs GKE to automatically resize the underlying Compute Engine instance group when pods cannot be scheduled due to insufficient CPU or memory resources.
Step-by-Step Solution
Key Concept
Configuring GKE Cluster Autoscaler to dynamically scale Compute Engine node pools when pods are unschedulable.