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?
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
Q01You are starting a new initiative and need to create a new Google Cloud project using the command...EasyQ02A developer on your team needs to manage App Engine applications, including deploying new version...MediumQ03You have created a new Google Cloud project. You need to allow a specific group of developers to ...MediumQ04Which statement best describes the relationship between Google Cloud projects and billing accounts?EasyQ05Your company wants to be notified immediately in their Slack channel whenever their monthly Googl...Medium
Expert