Google Associate Cloud Engineer Question 210
Select 3Google Cloud PlatformYou are managing a web application hosted on Google Cloud Platform. The application experiences varying loads throughout the day, with peak loads requiring more resources. You want to ensure that your application can handle these peaks efficiently using Google Kubernetes Engine (GKE). How should you configure autoscaling to handle both the varying loads and ensure cost efficiency?
- A
A. Configure Horizontal Pod Autoscaler to automatically adjust the number of pods based on CPU utilization.
- B
B. Use Vertical Pod Autoscaler to adjust the resource requests and limits for your pods based on historical usage.
- C
C. Set up a Static Pod deployment for consistent resource allocation.
- D
D. Enable Cluster Autoscaler to adjust the number of nodes in your cluster based on the demands of your workloads.
- E
E. Manually scale pods and nodes during peak times to ensure resource availability.
Show answer and explanation
Correct answers: A, B, D
Explanation
To efficiently manage varying loads and ensure cost efficiency in GKE, you should use a combination of Horizontal Pod Autoscaler, Vertical Pod Autoscaler, and Cluster Autoscaler. Horizontal Pod Autoscaler adjusts the number of pods based on real-time metrics, Vertical Pod Autoscaler optimizes resource requests and limits, and Cluster Autoscaler automatically adjusts the number of nodes to match the demands of your workloads. This combination allows for efficient scaling that adapts to both current and historical usage patterns, minimizing costs while maintaining performance.
- A. Correct.
A. Horizontal Pod Autoscaler is suitable for adjusting the number of running pods based on metrics like CPU utilization, which helps in handling varying loads.
- B. Correct.
B. Vertical Pod Autoscaler automatically adjusts the CPU and memory requests for containers, optimizing resource usage and costs.
- C. Incorrect.
C. Static Pods are not recommended for dynamic scaling as they are not managed by a controller and don’t support automatic scaling.
- D. Correct.
D. Cluster Autoscaler helps in dynamically adjusting the size of the cluster by adding or removing nodes based on the resources requested by pods.
- E. Incorrect.
E. Manually scaling is not efficient for handling dynamic loads as it requires constant monitoring and intervention.