Medium1 markMultiple Choice

GCP ACE · Question 23 · Domain 3.2: Deploying and implementing GKE resources

You have successfully provisioned a GKE cluster and authenticated your local kubectl tool to it. You have a container image stored in Google Container Registry at gcr.io/my-project/my-app:v1.

Which command should you use to deploy this image to your GKE cluster?

Answer options:

A.

kubectl create deployment my-app --image=gcr.io/my-project/my-app:v1

B.

gcloud run deploy my-app --image=gcr.io/my-project/my-app:v1

C.

docker run -d gcr.io/my-project/my-app:v1

D.

gcloud container deploy my-app --image=gcr.io/my-project/my-app:v1

How to approach this question

Differentiate between infrastructure provisioning (gcloud) and Kubernetes workload management (kubectl).

Full Answer

A.kubectl create deployment my-app --image=gcr.io/my-project/my-app:v1✓ Correct
kubectl create deployment my-app --image=gcr.io/my-project/my-app:v1
While `gcloud` is used to create the GKE cluster, you use the standard Kubernetes command-line tool, `kubectl`, to deploy applications to it. The `kubectl create deployment` command creates a Kubernetes Deployment object, instructing the cluster to pull the specified image and run it in Pods.

Common mistakes

Trying to use `gcloud` to deploy pods, or using `docker run` which only executes locally.

Practice the full GCP Associate Cloud Engineer Practice Exam 5

50 questions · hints · full answers · grading

More questions from this exam