Soru

Zorluk: OrtaManaging Google Kubernetes Engine Resources

A Cloud Engineer is managing a stateless web application running on a Google Kubernetes Engine (GKE) Standard cluster. To maintain performance during peak usage, the application must automatically scale its pod replica count whenever average CPU usage exceeds 75%. Additionally, if pods enter a Pending state due to insufficient compute capacity in the cluster, the underlying GKE node pool must automatically provision additional Compute Engine instances. Which TWO actions should the engineer perform to fulfill these operational requirements? (Select TWO.)

  1. Execute kubectl autoscale deployment web-app --cpu-percent=75 --min=2 --max=10 to create a Horizontal Pod Autoscaler for the application workload.Cevap
  2. Execute gcloud container node-pools update pool-1 --enable-autoscaling --min-nodes=2 --max-nodes=10 --cluster=prod-cluster --zone=us-central1-a to enable Cluster Autoscaler on the GKE node pool.Cevap
  3. C
    Execute gcloud container node-pools update pool-1 --enable-autoscaling --min-nodes=2 --max-nodes=10 to scale the number of pod replicas running inside the deployment.
  4. D
    Migrate the application workload to a GKE Autopilot cluster to allow manual modification of node OS kernel parameters for autoscaling.

Cevap

The correct operational actions are to configure Horizontal Pod Autoscaler (HPA) using `kubectl autoscale deployment` to scale pod replica counts based on CPU usage, and to enable Cluster Autoscaler on the node pool using `gcloud container node-pools update` to provision extra GKE nodes when pending pods cannot be scheduled.
Managing GKE resources efficiently requires configuring scaling at two distinct layers: pod-level workload scaling and node-level infrastructure scaling. Executing `kubectl autoscale deployment` creates a Horizontal Pod Autoscaler (HPA) resource that adjusts pod counts according to workload CPU utilization. Executing `gcloud container node-pools update --enable-autoscaling` configures the GKE Cluster Autoscaler to provision additional worker nodes whenever pending pods cannot be scheduled onto existing nodes.

Adım Adım Çözüm

1
Configure pod-level scaling based on CPU utilization
Deployment replicas scale dynamically between min and max bounds
Horizontal Pod Autoscaler monitors pod CPU metrics and adjusts the desired replica count when the 75% threshold is crossed.
2
Configure node-level scaling for infrastructure capacity
GKE node pool automatically adds Compute Engine instances when unschedulable pods are pending
Cluster Autoscaler monitors for pods that fail to schedule due to resource depletion and automatically scales up the node pool capacity.

Anahtar Kavram

Dual-Layer GKE Scaling (Horizontal Pod Autoscaler vs. Cluster Autoscaler)
Bu soruyu puanla