A DevOps engineer is managing a stateless microservice deployed on a Google Kubernetes Engine (GKE) Standard cluster. The application experiences unpredictable traffic surges. You must configure scaling so that the microservice automatically increases its pod count when average CPU utilization exceeds , and the underlying cluster automatically adds worker nodes whenever pods cannot be scheduled due to insufficient CPU capacity. Which TWO actions should you perform to meet these requirements?
- Create a Horizontal Pod Autoscaler (HPA) resource targeting the deployment with a target CPU utilization of .Answer
- Enable the Cluster Autoscaler on the GKE node pool so new nodes are provisioned when pods are in a Pending state due to resource constraints.Answer
- CConfigure Cluster Autoscaler to monitor pod CPU usage thresholds and trigger pod replica scaling within existing nodes.
- DProvision a GKE Autopilot cluster with fixed node pool limits and disable Horizontal Pod Autoscaler to guarantee zero node management overhead for custom kernel modules.
Answer
To handle both workload replica scaling and underlying node infrastructure scaling, create a Horizontal Pod Autoscaler targeting the deployment to manage pod counts based on CPU usage, and enable Cluster Autoscaler on the GKE node pool to manage node capacity when pods are pending.
Proper GKE scaling requires combining Horizontal Pod Autoscaler (HPA) to scale pod replicas based on workload metrics like CPU usage, and Cluster Autoscaler to expand node pool capacity when unschedulable pods are in a Pending state due to resource deficits.
Step-by-Step Solution
Key Concept
Differentiating Horizontal Pod Autoscaler (HPA) for pod workload scaling and Cluster Autoscaler for node infrastructure scaling in GKE.