Google Associate Cloud Engineer Question 122
Select 3Google Cloud PlatformYou are tasked with deploying a containerized web application to Google Kubernetes Engine (GKE). The application is packaged as a Docker image hosted on Google Container Registry (GCR). Which steps are necessary to deploy this application successfully to a GKE cluster?
- A
Create a Kubernetes Deployment using kubectl apply with a YAML configuration file.
- B
Set up a Google Cloud Storage bucket to host the Docker image.
- C
Use gcloud container clusters get-credentials to authenticate kubectl with the GKE cluster.
- D
Configure Ingress to expose the application externally.
- E
Install the Docker client on the GKE nodes to pull the image.
Show answer and explanation
Correct answers: A, C, D
Explanation
To deploy a containerized application to GKE, you need to create a Kubernetes Deployment using kubectl with the appropriate configuration. Authentication of kubectl with the GKE cluster is necessary using gcloud container clusters get-credentials. Additionally, if you want the application to be accessible externally, setting up Ingress is required. The Docker images should be stored in Google Container Registry and GKE nodes inherently have the ability to pull these images without needing a separate Docker client installation.
- A. Correct.
Creating a Kubernetes Deployment using kubectl apply with a YAML file is a standard method to deploy applications to GKE.
- B. Incorrect.
Google Cloud Storage is not used for hosting Docker images; instead, they are stored in Google Container Registry.
- C. Correct.
Using gcloud container clusters get-credentials is necessary to authenticate kubectl with your GKE cluster.
- D. Correct.
Configuring Ingress is a common way to expose your application externally in a GKE environment.
- E. Incorrect.
GKE nodes do not require a separate Docker client installation to pull images from GCR, as this capability is built-in.