Soru

Zorluk: OrtaManaging Google Kubernetes Engine Resources

An organization runs a web application on a Google Kubernetes Engine (GKE) Standard cluster. During a high-traffic event, existing pods reach high CPU utilization and incoming pod replicas fail to schedule, remaining in a Pending state because the cluster node pool has reached its compute capacity. You need to ensure the cluster automatically provisions additional Compute Engine worker nodes whenever pods are unschedulable due to resource limitations. Which action should you take?

  1. Enable Cluster Autoscaler on the GKE cluster node pool using gcloud container clusters update with the --enable-autoscaling flag.Cevap
  2. B
    Execute kubectl autoscale deployment to automatically provision additional Compute Engine nodes when CPU utilization increases.
  3. C
    Reconfigure the node pool to use Spot VMs to automatically provision additional nodes whenever pods enter a Pending state.
  4. D
    Run gcloud container clusters update with the --enable-autopilot flag to convert the existing Standard cluster into an Autopilot cluster.

Cevap

Enable Cluster Autoscaler on the GKE cluster node pool using gcloud container clusters update with the --enable-autoscaling flag.
The Cluster Autoscaler automatically adds nodes to a GKE node pool when pods cannot be scheduled due to insufficient CPU or memory resources on existing nodes. Enabling autoscaling using gcloud container clusters update with --enable-autoscaling configures GKE to dynamically provision Compute Engine instances as demand increases.

Adım Adım Çözüm

1
Identify the resource bottleneck in the GKE cluster.
Pods are remaining in a Pending state because the cluster node pool has run out of CPU compute capacity.
When existing nodes cannot accommodate pod resource requests, additional infrastructure capacity (VM nodes) is required.
2
Select the appropriate GKE autoscaling mechanism for infrastructure nodes.
Cluster Autoscaler must be enabled for the node pool.
Cluster Autoscaler monitors for unschedulable pods and automatically resizes the node pool, whereas HPA only scales pod replica counts.
3
Execute the management command to configure node scaling.
Run gcloud container clusters update CLUSTER_NAME --enable-autoscaling with min and max node limits.
This updates the GKE control plane to dynamically add Compute Engine instances when pending pods demand capacity.

Anahtar Kavram

GKE Cluster Autoscaler vs. Horizontal Pod Autoscaler (HPA)
Bu soruyu puanla