Question

Difficulty: HardManaging Google Kubernetes Engine Resources

A cloud operations engineer manages a regional Google Kubernetes Engine (GKE) Standard cluster hosting stateless web services and background batch workloads. During peak traffic events, newly created Pods remain in the `Pending` state with `Insufficient cpu` status events, even though the cluster has autoscaling enabled globally. Investigation reveals that the specific node pool handling these Pods was created with a fixed size of 3 nodes and lacks node-pool-level autoscaling settings. Which command should the engineer execute to enable automatic node scaling for this specific node pool so it can scale from 3 up to 10 nodes when Pods cannot be scheduled?

  1. Run `gcloud container node-pools update <pool-name> --cluster=<cluster-name> --enable-autoscaling --min-nodes=3 --max-nodes=10` with the appropriate region or zone.Answer
  2. B
    Apply a `HorizontalPodAutoscaler` manifest targeting the node pool compute instances with `minReplicas: 3` and `maxReplicas: 10`.
  3. C
    Run `gcloud container clusters update <cluster-name> --enable-autopilot` to automatically convert the cluster mode to manage node provisioning.
  4. D
    Recreate the workload node pool as a Spot VM node pool without autoscaling flags, relying on preemption events to trigger automatic node replacement.

Answer

Execute `gcloud container node-pools update <pool-name> --cluster=<cluster-name> --enable-autoscaling --min-nodes=3 --max-nodes=10` with the target region or zone flag.
The correct command uses `gcloud container node-pools update` with `--enable-autoscaling --min-nodes=3 --max-nodes=10`. In GKE Standard clusters, even if autoscaling mechanisms are enabled at the cluster level, individual node pools require explicit autoscaling flags and min/max node boundaries to dynamically adjust node counts when Pods cannot be scheduled due to resource constraints.

Step-by-Step Solution

1
Identify the cause of unschedulable Pending Pods
Pods are stuck in Pending state because the host node pool has reached its fixed node capacity limit of 3 nodes.
Cluster Autoscaler requires node-pool-level minimum and maximum boundary configurations to expand node capacity.
2
Select the correct GKE CLI utility and command subgroup
Use `gcloud container node-pools update` to alter configuration settings of an existing node pool.
Cluster-level updates modify global cluster settings, while node-pool-specific parameters must be updated via the `node-pools` subgroup.
3
Apply the autoscaling flags with bounds
Pass `--enable-autoscaling --min-nodes=3 --max-nodes=10` along with cluster identification parameters.
This enables Cluster Autoscaler to dynamically provision additional Compute Engine instances within the 3 to 10 node range when pending Pods request resources.

Key Concept

GKE Cluster Autoscaler configuration requires setting `--enable-autoscaling`, `--min-nodes`, and `--max-nodes` on specific node pools via `gcloud container node-pools update`.
Rate this question