Google Associate Cloud Engineer Question 214
Select 2Google Cloud PlatformYou are managing a web application deployed on Google Kubernetes Engine (GKE) that experiences fluctuating user traffic throughout the day. To optimize resource utilization and cost, you need to configure autoscaling appropriately. Which of the following configurations should you implement to ensure efficient scaling of your application based on CPU utilization and user requests?
- A
Configure a Horizontal Pod Autoscaler (HPA) to scale the number of pods based on CPU utilization.
- B
Implement a Vertical Pod Autoscaler (VPA) to automatically adjust CPU and memory requests for each pod.
- C
Use a Managed Instance Group with autoscaling based on CPU utilization.
- D
Deploy a Global Load Balancer to distribute traffic across multiple regions.
Show answer and explanation
Correct answers: A, B
Explanation
For a web application running on GKE, implementing both Horizontal Pod Autoscaler (HPA) and Vertical Pod Autoscaler (VPA) ensures that your application can efficiently scale out by increasing the number of pods during high CPU load and optimize resource requests per pod. This combination allows for effective management of fluctuating traffic and resource usage.
- A. Correct.
The Horizontal Pod Autoscaler (HPA) is used to automatically adjust the number of pods in a Kubernetes cluster based on observed CPU utilization or other select metrics. This is suitable for handling fluctuating user traffic.
- B. Correct.
The Vertical Pod Autoscaler (VPA) automatically adjusts the CPU and memory requests for your pods, ensuring that each pod has the necessary resources without over-provisioning. This complements horizontal scaling by optimizing resource usage.
- C. Incorrect.
Managed Instance Groups and their autoscaling are related to Compute Engine virtual machine instances, not Kubernetes pods. Thus, this option is not directly applicable to GKE.
- D. Incorrect.
A Global Load Balancer is used to distribute incoming network traffic across multiple regions or backends but does not manage autoscaling of resources within a Kubernetes cluster.