Medium1 markMultiple Choice

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

You have successfully created a GKE cluster and authenticated your local kubectl tool to it. You now want to deploy a containerized application using an image named 'nginx:latest'.

Which command should you use to create a deployment named 'my-nginx'?

Answer options:

A.

gcloud container deploy my-nginx --image=nginx:latest

B.

kubectl run my-nginx --image=nginx:latest

C.

kubectl create deployment my-nginx --image=nginx:latest

D.

docker run --name my-nginx nginx:latest

How to approach this question

Identify the correct Kubernetes CLI (kubectl) command for creating a Deployment.

Full Answer

C.kubectl create deployment my-nginx --image=nginx:latest✓ Correct
kubectl create deployment my-nginx --image=nginx:latest
To deploy applications inside a GKE cluster, you use `kubectl`. The imperative command to create a Deployment is `kubectl create deployment [NAME] --image=[IMAGE]`. (Note: `kubectl run` now creates a Pod, not a Deployment).

Common mistakes

Using `gcloud` instead of `kubectl`, or using `kubectl run` expecting it to create a Deployment.

Practice the full GCP Associate Cloud Engineer Practice Exam 3

50 questions · hints · full answers · grading

More questions from this exam