A company runs a stateless web application on a Google Kubernetes Engine (GKE) Standard cluster. During peak traffic hours, incoming requests cause high CPU utilization, requiring more Pod instances. However, when additional Pods are created, several remain stuck in a Pending status because the current worker nodes have exhausted their CPU and memory capacity. Which configuration strategy should the cloud engineer implement to automatically handle scaling for both the workload Pods and the underlying cluster node capacity?
- Configure a Horizontal Pod Autoscaler (HPA) for the deployment to adjust Pod replicas based on CPU utilization, and enable Cluster Autoscaler on the GKE cluster to automatically add nodes when Pods are unschedulable.Cevap
- BConfigure Cluster Autoscaler on the deployment to adjust Pod replica counts based on CPU metrics, and configure a Horizontal Pod Autoscaler (HPA) on the cluster to add worker nodes to the node pool.
- CProvision a new Spot VM node pool and set resource limits to zero so GKE can bypass physical node capacity restrictions during traffic surges without scaling infrastructure.
- DMigrate the deployment to a Compute Engine Managed Instance Group (MIG) autoscaling policy to directly manage Kubernetes Pod lifecycle and scheduling across zones.
Cevap
Configure a Horizontal Pod Autoscaler (HPA) for the deployment to adjust Pod replicas based on CPU utilization, and enable Cluster Autoscaler on the GKE cluster to automatically add nodes when Pods are unschedulable.
To resolve pending Pods caused by insufficient node capacity during traffic spikes, Google Cloud recommends combining Horizontal Pod Autoscaler (HPA) for workload Pod replica scaling with GKE Cluster Autoscaler for node infrastructure scaling. HPA reacts to resource utilization by increasing Pod counts, and Cluster Autoscaler detects Pending Pods to add new compute nodes to the node pool.
Adım Adım Çözüm
Anahtar Kavram
GKE Workload and Cluster Autoscaling Mechanisms