A DevOps team operates a high-traffic web application on Google Kubernetes Engine (GKE). During traffic bursts, CPU utilization across application pods increases significantly beyond target thresholds. Additionally, during peak events, scaling up pod instances causes newly created pods to remain in a Pending state because current cluster nodes lack available CPU and memory resources. The team needs to implement an automated scaling architecture to handle both pod-level CPU load spikes and node-level resource shortages. Which scaling configuration should they implement?
- Configure a Horizontal Pod Autoscaler (HPA) to dynamically adjust pod replica count based on CPU utilization, and enable Cluster Autoscaler to automatically add nodes when pods are unschedulable.Cevap
- BConfigure Cluster Autoscaler to increase pod replica count based on CPU metrics, and enable Vertical Pod Autoscaler (VPA) to provision additional GKE compute nodes when pods enter a Pending state.
- CMigrate the application workloads to GKE Autopilot using fixed static node pools, relying on static node limits to manage pod CPU spikes without changing cluster size.
- DProvision a Spot VM node pool with pod preemption policies to terminate and replace pending pods whenever node CPU utilization exceeds target thresholds.
Cevap
Configure a Horizontal Pod Autoscaler (HPA) to scale pod replicas based on CPU metrics, and enable Cluster Autoscaler to automatically add GKE nodes when pending pods cannot be scheduled.
The correct approach combines Horizontal Pod Autoscaler (HPA) and Cluster Autoscaler. HPA scales the number of running pod instances in a Deployment based on metric thresholds like CPU usage. When HPA creates additional pods that exceed total available node memory or CPU, GKE marks those pods as Pending. Cluster Autoscaler detects these pending unschedulable pods and provisions new GKE node instances in the node pool to accommodate them.
Adım Adım Çözüm
Anahtar Kavram
GKE Workload and Node Autoscaling Architecture
Tahmini Süre:1m 30s