Medium1 markMultiple Choice

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

You need to create a new Google Kubernetes Engine (GKE) standard cluster named 'web-cluster' with 3 nodes in the us-central1-a zone using the command line.

Which gcloud command should you use?

Answer options:

A.

gcloud container clusters create web-cluster --zone us-central1-a --num-nodes 3

B.

gcloud compute clusters create web-cluster --zone us-central1-a --num-nodes 3

C.

kubectl create cluster web-cluster --zone us-central1-a --nodes 3

D.

gcloud gke clusters create web-cluster --zone us-central1-a --num-nodes 3

How to approach this question

Remember the gcloud command group for Kubernetes Engine. It is 'container', not 'gke' or 'compute'.

Full Answer

A.gcloud container clusters create web-cluster --zone us-central1-a --num-nodes 3✓ Correct
gcloud container clusters create web-cluster --zone us-central1-a --num-nodes 3
In the Google Cloud SDK, all commands related to Google Kubernetes Engine (GKE) are grouped under `gcloud container`. Therefore, to create a cluster, you use `gcloud container clusters create [CLUSTER_NAME]`. The `--zone` and `--num-nodes` flags specify the location and size.

Common mistakes

Using `kubectl` to try and create the cluster infrastructure, or guessing `gcloud gke`.

Practice the full GCP Associate Cloud Engineer Practice Exam 5

50 questions · hints · full answers · grading

More questions from this exam