Google Professional Cloud DevOps Engineer Question 236
Select 2Google Cloud PlatformYour team manages a web application hosted on Google Kubernetes Engine (GKE). During peak traffic hours, the application experiences performance degradation due to insufficient resources. Your goal is to ensure the application scales automatically to handle increasing traffic without manual intervention. Which actions should you take to add capacity effectively?
- A
Configure Horizontal Pod Autoscaler (HPA) for the application to adjust the number of pods based on CPU or memory utilization.
- B
Use a larger machine type for the existing GKE nodes to increase the available resources.
- C
Enable node auto-provisioning in the GKE cluster to automatically add new nodes when required.
- D
Manually add more nodes to the GKE cluster to handle peak traffic.
- E
Set up a pre-configured static number of pods and nodes to handle maximum expected traffic.
Show answer and explanation
Correct answers: A, C
Explanation
To add capacity effectively in a GKE environment, you should enable both Horizontal Pod Autoscaler (HPA) for pods and node auto-provisioning for the infrastructure. HPA ensures that the application scales horizontally by adding or removing pods based on utilization metrics, while node auto-provisioning ensures that the cluster infrastructure can scale dynamically to accommodate these changes. These strategies align with DevOps best practices for automation and scalability.
- A. Correct.
Horizontal Pod Autoscaler (HPA) adjusts the number of pods in response to application demand, enabling automatic scaling at the application level. This is an effective strategy for handling fluctuating traffic.
- B. Incorrect.
Using a larger machine type increases the resource capacity per node, but it does not automatically address scaling to meet dynamic traffic demands.
- C. Correct.
Node auto-provisioning automatically adds nodes to the cluster when required, ensuring that the cluster has sufficient resources to handle increased pod demand.
- D. Incorrect.
Manually adding nodes is not an optimal solution because it requires constant monitoring and intervention, which is not in line with the principles of automated DevOps practices.
- E. Incorrect.
Pre-configuring a static number of pods and nodes does not account for dynamic traffic patterns and can lead to either over-provisioning (increased costs) or under-provisioning (performance issues).