Google Professional Cloud Developer Question 366
Select 3Google Cloud PlatformYou are deploying a web application to Google Kubernetes Engine (GKE) with autoscaling enabled. The application must handle unpredictable traffic spikes while optimizing costs. What considerations should you prioritize to ensure the deployment is reliable and cost-efficient?
- A
Configure a Horizontal Pod Autoscaler (HPA) based on CPU or memory utilization.
- B
Deploy the application using a DaemonSet to ensure every node runs a copy of the pod.
- C
Set up cluster autoscaler to automatically adjust the number of nodes based on workload requirements.
- D
Use preemptible VM nodes in the GKE cluster to reduce costs and handle transient workloads.
- E
Create a PodDisruptionBudget to ensure a minimum number of pods remain available during maintenance or upgrades.
Show answer and explanation
Correct answers: A, C, E
Explanation
To handle unpredictable traffic spikes and optimize costs in a GKE deployment, you should use a Horizontal Pod Autoscaler (HPA) to dynamically manage pod replicas based on resource utilization, and a cluster autoscaler to adjust node counts automatically. Additionally, a PodDisruptionBudget ensures reliability during cluster operations. DaemonSets and preemptible VM nodes do not align well with the requirements for this scenario.
- A. Correct.
Configuring a Horizontal Pod Autoscaler (HPA) ensures that the number of pod replicas scales dynamically based on CPU or memory utilization, which is critical for handling unpredictable traffic spikes.
- B. Incorrect.
DaemonSets are designed to run one pod per node and are not suitable for scaling web applications. They are better suited for system-level workloads like logging or monitoring.
- C. Correct.
Cluster autoscaler adjusts the number of nodes in the cluster based on the resource demands of your workloads, ensuring cost efficiency while maintaining reliability during traffic spikes.
- D. Incorrect.
Preemptible VM nodes can reduce costs but are not ideal for workloads requiring high availability, as they can be terminated at any time. This introduces risks for handling unpredictable traffic spikes.
- E. Correct.
PodDisruptionBudget ensures a certain number of pods remain available during maintenance or upgrades, providing reliability and preventing downtime during cluster operations.