Soru

Zorluk: OrtaManaging Google Kubernetes Engine Resources

Your company hosts a microservices workload on a Google Kubernetes Engine (GKE) cluster. During high traffic spikes, CPU consumption increases significantly across existing pods, resulting in high response latency. The existing cluster nodes have adequate spare CPU and memory resources to handle additional pod workloads. You need to configure automated scaling so that new pod replicas are scheduled when CPU utilization reaches a high threshold. What operational action should you take?

  1. Configure a Horizontal Pod Autoscaler (HPA) targeting the Deployment using the kubectl autoscale command.Cevap
  2. B
    Enable Cluster Autoscaler on the GKE cluster node pool using the gcloud container node-pools update command with the --enable-autoscaling flag.
  3. C
    Migrate the existing cluster from GKE Standard mode to GKE Autopilot mode using gcloud container clusters update.
  4. D
    Recreate the GKE node pool using Spot VMs by providing the --spot flag in the gcloud container node-pools create command.

Cevap

Configure a Horizontal Pod Autoscaler (HPA) targeting the Deployment using the kubectl autoscale command.
Configuring a Horizontal Pod Autoscaler (HPA) using kubectl autoscale dynamically adjusts the number of pod replicas based on CPU utilization. Because the cluster nodes already possess adequate CPU and memory capacity, adding pod replicas effectively distributes the load without needing to scale node pool infrastructure.

Adım Adım Çözüm

1
Identify the bottleneck location
Individual pod instances are experiencing CPU pressure, but the underlying GKE nodes have unallocated capacity.
When nodes have sufficient CPU and memory, additional pod replicas can be scheduled without expanding node count.
2
Select the appropriate GKE autoscaling mechanism
Choose Horizontal Pod Autoscaler (HPA) over Cluster Autoscaler.
HPA scales pod replicas based on workload metrics like CPU, whereas Cluster Autoscaler scales compute node instances.
3
Apply the HPA operational command
Run kubectl autoscale deployment with the targeted CPU utilization threshold.
This creates a HorizontalPodAutoscaler resource to automatically manage pod replica counts.

Anahtar Kavram

Managing GKE Workload Autoscaling with Horizontal Pod Autoscaler (HPA)
Tahmini Süre:1m 30s
Bu soruyu puanla