A cloud engineer needs to ensure that a stateless application running on a Google Kubernetes Engine (GKE) cluster can handle traffic spikes. The requirement is to automatically scale up the container instances during high demand, and to automatically add compute nodes to the cluster if existing nodes run out of capacity to host those pods. Which TWO actions should the engineer perform to fulfill these requirements?
- Configure a Horizontal Pod Autoscaler (HPA) for the deployment to scale the pod replica count based on CPU utilization.Answer
- BConfigure Cluster Autoscaler to monitor container CPU usage and automatically adjust the deployment's pod replica count.
- Enable Cluster Autoscaler on the GKE cluster node pool to add worker nodes when pending pods cannot be scheduled due to insufficient resources.Answer
- DMigrate the deployment workload to a Spot VM node pool as the primary mechanism for expanding container replica counts.
Answer
The correct actions are configuring a Horizontal Pod Autoscaler (HPA) to scale the pod replica count based on workload demand, and enabling GKE Cluster Autoscaler on the node pool to add nodes when pending pods require additional compute capacity.
To manage scaling at both the application tier and the underlying cluster infrastructure tier in GKE, two distinct features must be configured. Horizontal Pod Autoscaler (HPA) dynamically adjusts the deployment's pod replica count based on metric thresholds like CPU usage. When the increase in pod count exceeds current cluster compute resources, Cluster Autoscaler automatically adds new worker nodes to the node pool so pending pods can be scheduled.
Step-by-Step Solution
Key Concept
Managing GKE resource scaling requires combining Horizontal Pod Autoscaler (HPA) for pod workload elasticity with Cluster Autoscaler for underlying compute node capacity.