Google Associate Cloud Engineer Question 121
Select 3Google Cloud PlatformYou are tasked with deploying a containerized web application on Google Kubernetes Engine (GKE). The application needs to be accessible to users over the internet. Which of the following steps should you perform to expose your application publicly on GKE?
- A
Create a Deployment for your application.
- B
Use a Service of type ClusterIP to expose the Deployment.
- C
Use a Service of type LoadBalancer to expose the Deployment.
- D
Configure a Network Endpoint Group (NEG) for the application.
- E
Ensure the firewall rules allow traffic on the appropriate port.
Show answer and explanation
Correct answers: A, C, E
Explanation
To expose a containerized application on GKE publicly, you start by creating a Deployment to manage your application pods. Then, you need a Service of type LoadBalancer, which assigns an external IP address to your application, making it accessible over the internet. Additionally, you must configure firewall rules to allow traffic on the necessary ports. Using a Service of type ClusterIP would not suffice as it only exposes the application internally within the cluster.
- A. Correct.
Creating a Deployment is necessary to manage the application pods and their lifecycle.
- B. Incorrect.
A Service of type ClusterIP is only accessible within the cluster, not from the internet.
- C. Correct.
A Service of type LoadBalancer provisions an external IP to make the application accessible over the internet.
- D. Incorrect.
Configuring a Network Endpoint Group is not necessary for simply exposing a GKE application using Services.
- E. Correct.
Firewall rules must allow traffic on the ports used by the application to ensure it is accessible from the internet.