A cloud engineering team needs to manually change the number of worker nodes in a Google Kubernetes Engine (GKE) node pool named pool-analytics inside an existing zonal cluster named analytics-cluster in zone us-central1-a. They want to set the target size to 5 nodes per zone using the Google Cloud CLI. Which command should they execute?
- gcloud container node-pools resize pool-analytics --cluster=analytics-cluster --zone=us-central1-a --num-nodes=5Answer
- Bkubectl autoscale deployment pool-analytics --min=5 --max=5 --zone=us-central1-a
- Cgcloud container clusters update analytics-cluster --enable-autopilot --node-pool=pool-analytics --num-nodes=5
- Dkubectl scale node pool-analytics --replicas=5
Answer
The command `gcloud container node-pools resize pool-analytics --cluster=analytics-cluster --zone=us-central1-a --num-nodes=5` correctly resizes the specified GKE node pool.
Resizing a GKE node pool requires using the Google Cloud CLI command `gcloud container node-pools resize`. Specifying the node pool name alongside the `--cluster`, `--zone`, and `--num-nodes` flags correctly updates the underlying Compute Engine instance group size for that pool.
Step-by-Step Solution
Key Concept
Manually resizing GKE node pools using gcloud container node-pools resize.