Medium1 markMultiple Choice

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

You need to deploy a new Google Kubernetes Engine (GKE) Standard cluster named 'prod-cluster' with 3 nodes in the us-east1-b zone using the command line.

Which gcloud command should you use?

Answer options:

A.

gcloud compute clusters create prod-cluster --nodes=3 --zone=us-east1-b

B.

gcloud container clusters create prod-cluster --num-nodes=3 --zone=us-east1-b

C.

kubectl create cluster prod-cluster --nodes=3 --zone=us-east1-b

D.

gcloud kubernetes clusters create prod-cluster --num-nodes=3 --zone=us-east1-b

How to approach this question

Remember that in gcloud, GKE is managed under the 'container' component.

Full Answer

B.gcloud container clusters create prod-cluster --num-nodes=3 --zone=us-east1-b✓ Correct
gcloud container clusters create prod-cluster --num-nodes=3 --zone=us-east1-b
To manage Google Kubernetes Engine (GKE) resources using the Cloud SDK, you use the `gcloud container` command group. The correct command to create a cluster is `gcloud container clusters create [CLUSTER_NAME]`. You then use flags like `--num-nodes` and `--zone` to configure it. `kubectl` is used later to deploy applications *onto* the cluster, not to create the cluster infrastructure.

Common mistakes

Using `kubectl` to try and create the cluster, or using `gcloud compute` instead of `gcloud container`.

Practice the full GCP Associate Cloud Engineer Practice Exam 6

50 questions · hints · full answers · grading

More questions from this exam