Google Professional Cloud Developer Question 367
Select 3Google Cloud PlatformYou are tasked with deploying a containerized application to Google Kubernetes Engine (GKE). The application requires a stable public IP address and load balancing for external access. Which steps should you include in your deployment process?
- A
Create a Kubernetes Deployment and expose it using a Service of type LoadBalancer.
- B
Assign a static IP address to the LoadBalancer Service using an annotation in the Service definition.
- C
Create a Kubernetes PersistentVolume and attach it to the Deployment for external traffic.
- D
Configure a HorizontalPodAutoscaler to scale the Deployment based on CPU utilization.
- E
Set up a NodePort Service to expose the application externally with a fixed port.
Show answer and explanation
Correct answers: A, B, D
Explanation
To deploy a containerized application to GKE with external access, you need a Kubernetes Deployment for managing the application's pods, a Service of type LoadBalancer for exposing it externally with load balancing, and a static IP to ensure stability. Additionally, configuring a HorizontalPodAutoscaler helps maintain availability and performance by scaling the application based on resource utilization.
- A. Correct.
Correct: A Kubernetes Deployment and a Service of type LoadBalancer are required to deploy the containerized application and expose it externally with load balancing.
- B. Correct.
Correct: Assigning a static IP to the LoadBalancer ensures the application has a stable public IP address for external access.
- C. Incorrect.
Incorrect: PersistentVolumes are used for storage and are not directly related to exposing the application externally for traffic.
- D. Correct.
Correct: A HorizontalPodAutoscaler helps scale the application automatically, ensuring high availability and performance under varying load conditions.
- E. Incorrect.
Incorrect: A NodePort Service is not ideal for production use as it does not provide load balancing or a stable public IP.