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'?
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
Q01You are starting a new project in Google Cloud and need to create a new GCP project and enable th...EasyQ02A new team member has joined your operations team. They need to be able to view all Compute Engin...MediumQ03Your company is migrating to Google Cloud. You currently manage all employee identities in an on-...MediumQ04Your development team is experimenting with new GCP services in a sandbox project. The finance te...MediumQ05Your company wants to perform complex, custom SQL analysis on their Google Cloud billing data to ...Easy
Expert