Soru

Zorluk: ZorManaging Google Kubernetes Engine Resources

A cloud engineer is managing a Google Kubernetes Engine (GKE) Standard cluster hosting a critical microservice. During a peak traffic period, the Horizontal Pod Autoscaler (HPA) successfully increases the workload deployment replica count from 10 to 25. However, several newly created pods remain in a `Pending` state, displaying the scheduling error `0/3 nodes are available: 3 Insufficient memory`. Diagnostic checks confirm that the node pool's Cluster Autoscaler has reached its configured upper boundary of 3 nodes per zone. The application must scale out on compute nodes without altering container resource requests or converting the existing cluster operational mode. Which command should the engineer execute to allow the cluster to scale node capacity for the unscheduled workloads?

  1. gcloud container node-pools update pool-1 --cluster=prod-cluster --enable-autoscaling --min-nodes=1 --max-nodes=10 --zone=us-central1-aCevap
  2. B
    kubectl autoscale deployment web-app --max=50 --cpu-percent=80
  3. C
    gcloud container clusters update prod-cluster --enable-autopilot --zone=us-central1-a
  4. D
    gcloud container node-pools update pool-1 --cluster=prod-cluster --spot --zone=us-central1-a

Cevap

Execute `gcloud container node-pools update pool-1 --cluster=prod-cluster --enable-autoscaling --min-nodes=1 --max-nodes=10 --zone=us-central1-a` to expand the maximum node limit of the node pool, enabling the Cluster Autoscaler to provision new compute nodes.
The correct option updates the node pool autoscaling configuration via `gcloud container node-pools update` to raise `--max-nodes` from 3 to 10. When pods remain in `Pending` due to insufficient memory and the node pool has reached its maximum size, increasing `--max-nodes` empowers the Cluster Autoscaler to provision additional GKE nodes dynamically.

Adım Adım Çözüm

1
Analyze the cluster error state.
Pods are stuck in `Pending` state because nodes lack available memory (`3 Insufficient memory`) and the node pool has hit its max node limit.
The Horizontal Pod Autoscaler (HPA) successfully scaled the pod replicas, but Cluster Autoscaler cannot add worker nodes because it has reached `--max-nodes=3`.
2
Identify the proper scaling layer.
Cluster capacity issues must be resolved at the infrastructure layer using GKE Cluster Autoscaler node pool settings, not at the Kubernetes pod layer using HPA.
Adding more pod replicas via HPA exacerbates scheduling pressure when node capacity is capped.
3
Select the correct `gcloud` command to modify node pool autoscaling limits.
Updating the node pool autoscaling parameters using `gcloud container node-pools update` with `--max-nodes=10` increases the maximum node count constraint.
This allows GKE to automatically spin up additional GKE compute nodes to accommodate the pending pods.

Anahtar Kavram

Distinguishing between Horizontal Pod Autoscaler (HPA) pod-level scaling and Cluster Autoscaler node-level capacity management in GKE Standard clusters.
Tahmini Süre:2m 0s
Bu soruyu puanla