Medium1 markMultiple Choice
Domain 4.2: Managing GKE resourcesDomain 4.2GKEgcloudScaling

GCP ACE · Question 35 · Domain 4.2: Managing GKE resources

Your GKE cluster is running out of compute capacity. You need to manually increase the number of nodes in the 'default-pool' from 3 to 5.

Which command should you use?

Answer options:

A.

kubectl scale node-pool default-pool --replicas=5

B.

gcloud compute instance-groups managed resize default-pool --size=5

C.

gcloud container clusters resize [CLUSTER_NAME] --node-pool=default-pool --num-nodes=5

D.

kubectl resize cluster [CLUSTER_NAME] --nodes=5

How to approach this question

Remember that cluster infrastructure (nodes) is managed by gcloud, while workloads (pods) are managed by kubectl.

Full Answer

C.gcloud container clusters resize [CLUSTER_NAME] --node-pool=default-pool --num-nodes=5✓ Correct
To change the size of a GKE node pool, you use the `gcloud container clusters resize` command. You specify the cluster name, the target node pool, and the new number of nodes. You should not use `kubectl` or direct Compute Engine MIG commands for this.

Common mistakes

Trying to use `kubectl scale`, which is for scaling application pods, not infrastructure nodes.

Practice the full GCP Associate Cloud Engineer Practice Exam 3

50 questions · hints · full answers · grading

More questions from this exam