Google Associate Cloud Engineer Question 124
Select 3Google Cloud PlatformYou are tasked with deploying a containerized application on Google Kubernetes Engine (GKE). The application consists of a frontend and a backend service, both containerized using Docker. Which steps should you follow to successfully deploy and expose both services on GKE?
- A
Create Docker images for both frontend and backend services and push them to Container Registry.
- B
Create a Kubernetes Deployment for each service using the pushed Docker images.
- C
Use 'kubectl expose' command to create a Service resource for each Deployment.
- D
Create a single Kubernetes Deployment to manage both services.
- E
Use 'gcloud compute instances create' to deploy your containers on GKE.
Show answer and explanation
Correct answers: A, B, C
Explanation
To deploy a containerized application on GKE, you start by creating Docker images for your application components and pushing them to a container registry. Then, you create Kubernetes Deployments to manage and scale your containers. Finally, you use Kubernetes Services to expose your Deployments to external traffic. These steps leverage Kubernetes' ability to orchestrate and manage containerized applications efficiently.
- A. Correct.
Correct. You need to push your Docker images to a registry like Container Registry to make them accessible by GKE.
- B. Correct.
Correct. Creating a Deployment for each service ensures they run as individual pods managed by Kubernetes.
- C. Correct.
Correct. The 'kubectl expose' command is used to create a Service resource that exposes a Deployment to external traffic.
- D. Incorrect.
Incorrect. It's best practice to create separate Deployments for each service to manage scaling and updates independently.
- E. Incorrect.
Incorrect. 'gcloud compute instances create' is used for creating VM instances, not for deploying containers on GKE.