Medium1 markMultiple Choice

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

You have successfully created a GKE cluster and configured your local kubectl to connect to it. You have a container image named gcr.io/my-project/my-app:v1.

Which command should you use to deploy this image to your cluster as a Deployment?

Answer options:

A.

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

B.

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

C.

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

D.

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

How to approach this question

Identify the Kubernetes CLI tool and the specific command to create a Deployment.

Full Answer

C.kubectl create deployment my-app --image=gcr.io/my-project/my-app:v1✓ Correct
Once a GKE cluster is running, you use `kubectl` to deploy applications. The imperative command to create a Deployment (which manages replica sets and pods) is `kubectl create deployment [NAME] --image=[IMAGE_URL]`.

Common mistakes

Using `gcloud` commands. Remember: `gcloud` builds the cluster; `kubectl` deploys the apps.

Practice the full GCP Associate Cloud Engineer Practice Exam 7

50 questions · hints · full answers · grading

More questions from this exam