Google Professional Cloud DevOps Engineer Question 108
Select 3Google Cloud PlatformYour organization is running a web application on Google Kubernetes Engine (GKE). The application experiences unpredictable traffic spikes. Your team wants to ensure the application scales automatically to handle these spikes while optimizing costs. Which of the following configuration steps should you take to achieve this?
- A
Enable Horizontal Pod Autoscaler (HPA) and configure it to scale based on CPU utilization.
- B
Set up a Cluster Autoscaler to automatically adjust the size of the underlying node pool.
- C
Manually provision additional nodes in the GKE cluster during high-traffic periods.
- D
Configure a fixed number of replicas for your application deployment to ensure consistent performance.
- E
Define resource requests and limits for your Pods to help HPA and Cluster Autoscaler make informed scaling decisions.
Show answer and explanation
Correct answers: A, B, E
Explanation
To handle unpredictable traffic spikes while optimizing costs, you should leverage both Horizontal Pod Autoscaler (HPA) and Cluster Autoscaler. HPA scales Pods based on metrics like CPU utilization, while Cluster Autoscaler adjusts the size of the node pool to meet the cluster's resource demands. Defining resource requests and limits for Pods is critical to enabling effective scaling decisions. Manual scaling or fixed replicas do not provide the dynamic, cost-effective scaling needed for this scenario.
- A. Correct.
Correct: Horizontal Pod Autoscaler (HPA) adjusts the number of Pods in a Deployment or ReplicaSet based on metrics like CPU utilization, making it suitable for handling traffic spikes.
- B. Correct.
Correct: Cluster Autoscaler adjusts the size of the node pool based on workload demands, ensuring the cluster can handle increased Pod requirements.
- C. Incorrect.
Incorrect: Manually provisioning nodes is not an automated solution and contradicts the goal of autoscaling. It is error-prone and less efficient.
- D. Incorrect.
Incorrect: Configuring a fixed number of replicas does not allow the application to scale dynamically, which is essential for unpredictable traffic spikes.
- E. Correct.
Correct: Defining resource requests and limits ensures that both HPA and Cluster Autoscaler can make informed decisions about scaling Pods and nodes, optimizing resource usage.