Question

Difficulty: HardManaging Google Kubernetes Engine Resources

Your organization runs a batch processing pipeline on a Google Kubernetes Engine (GKE) Standard cluster named `prod-cluster` in zone `us-central1-a`. During daily peak processing hours, incoming pod workloads enter a `Pending` state because the existing node pool named `analytics-pool` reaches its maximum capacity. You need to configure the cluster infrastructure so that GKE automatically provisions additional compute nodes in `analytics-pool` when pods cannot be scheduled due to resource constraints, up to a maximum limit of 15 nodes, and scales down node count during off-peak hours. Which command should you execute to meet this requirement?

  1. A
    kubectl autoscale deployment analytics-pool --min=2 --max=15 --cpu-percent=80
  2. gcloud container node-pools update analytics-pool --cluster=prod-cluster --enable-autoscaling --min-nodes=2 --max-nodes=15 --zone=us-central1-aAnswer
  3. C
    gcloud container node-pools update analytics-pool --cluster=prod-cluster --enable-spot-nodes --max-nodes=15 --zone=us-central1-a
  4. D
    gcloud container clusters update prod-cluster --enable-autopilot --node-pool=analytics-pool --zone=us-central1-a

Answer

The command 'gcloud container node-pools update analytics-pool --cluster=prod-cluster --enable-autoscaling --min-nodes=2 --max-nodes=15 --zone=us-central1-a' is the correct choice because it enables GKE Cluster Autoscaler on the specific node pool.
Enabling cluster autoscaling on a GKE Standard node pool via 'gcloud container node-pools update' with the '--enable-autoscaling', '--min-nodes', and '--max-nodes' flags allows GKE to automatically adjust the node pool capacity between the specified limits when pods cannot be scheduled.

Step-by-Step Solution

1
Identify the operational requirement.
The requirement is to scale compute nodes (infrastructure capacity) in response to unschedulable pending pods, which requires GKE Cluster Autoscaler rather than Horizontal Pod Autoscaler.
When pods are pending due to lack of node CPU/memory, increasing pod counts does not help; additional VM nodes must be provisioned.
2
Determine the appropriate Google Cloud CLI tool and resource target.
Target the specific node pool using 'gcloud container node-pools update analytics-pool'.
Node pool autoscaling settings are managed at the node pool level under the cluster.
3
Select the correct flags for node pool autoscaling.
Specify '--enable-autoscaling', '--min-nodes=2', '--max-nodes=15', '--cluster=prod-cluster', and '--zone=us-central1-a'.
These flags configure the minimum and maximum node thresholds for the GKE Cluster Autoscaler.

Key Concept

Configuring GKE Cluster Autoscaler on Existing Node Pools
Estimated Time:2m 0s
Rate this question