Soru

Zorluk: ZorManaging Google Kubernetes Engine Resources

A cloud engineer is managing a Google Kubernetes Engine (GKE) Standard cluster named `app-cluster` in zone `us-east1-b`. During a peak traffic period, the engineer scales up a web service Deployment, but several new Pods remain stuck in a `Pending` state with `Insufficient cpu` event messages. The existing node pool named `web-pool` has reached its current node limit, and node autoscaling is disabled. The engineer needs to enable node autoscaling specifically for `web-pool` so that GKE dynamically provisions additional underlying Compute Engine instances when Pods cannot be scheduled, establishing a minimum limit of 2 nodes and a maximum limit of 8 nodes. Which `gcloud` command must the engineer execute to resolve this issue?

  1. gcloud container node-pools update web-pool --cluster=app-cluster --zone=us-east1-b --enable-autoscaling --min-nodes=2 --max-nodes=8Cevap
  2. B
    kubectl autoscale deployment web-app --min=2 --max=8 --cpu-percent=80
  3. C
    gcloud container clusters update app-cluster --zone=us-east1-b --enable-autoscaling --min-nodes=2 --max-nodes=8
  4. D
    gcloud container clusters update app-cluster --zone=us-east1-b --enable-autopilot

Cevap

Execute `gcloud container node-pools update web-pool --cluster=app-cluster --zone=us-east1-b --enable-autoscaling --min-nodes=2 --max-nodes=8`.
The correct command uses `gcloud container node-pools update` targeted at the `web-pool` node pool in cluster `app-cluster`. Providing `--enable-autoscaling` along with `--min-nodes=2` and `--max-nodes=8` configures GKE Cluster Autoscaler to automatically adjust the node count when pending Pods require additional compute resources.

Adım Adım Çözüm

1
Identify the root cause of the `Pending` Pods.
Pods are unschedulable because the node pool lacks available CPU resource capacity, and node autoscaling is currently disabled on the cluster's node pool.
Cluster Autoscaler must be enabled on the node pool level to automatically provision new Compute Engine nodes when unschedulable Pods are detected.
2
Differentiate between Horizontal Pod Autoscaler (HPA) and Cluster Autoscaler.
HPA scales Pod replica counts, whereas Cluster Autoscaler scales the underlying Compute Engine VM nodes within node pools.
Because Pod replicas are already scaled up and waiting for node capacity, Cluster Autoscaler configuration is required.
3
Select the correct `gcloud` CLI command and flags for node pool autoscaling.
`gcloud container node-pools update web-pool` combined with `--enable-autoscaling`, `--min-nodes=2`, and `--max-nodes=8` properly targets the specific node pool and defines its scaling boundaries.
Node pool autoscaling bounds must be set at the node pool resource level rather than the cluster resource level.

Anahtar Kavram

Configuring GKE Cluster Autoscaler on node pools to resolve unschedulable Pod resource constraints.
Tahmini Süre:2m 0s
Bu soruyu puanla