
Answer-first summary for fast verification
Answer: `gcloud container clusters resize my-gcp-ace-proj-1 --node-pool my-gcp-ace-primary-node-pool --num-nodes 20`
The correct command is `gcloud container clusters resize my-gcp-ace-proj-1 --node-pool my-gcp-ace-primary-node-pool --num-nodes 20`. This command uses the `--num-nodes` parameter to specify the target number of nodes in the cluster, which is the recommended way to resize a node pool. The other options are incorrect for the following reasons: - Using `kubectl` with `container clusters update` is not valid as `kubectl` does not accept `container` as an operation. - The `gcloud container clusters update` command cannot be used to specify the number of nodes; it's used for updating node locations. - The `gcloud container clusters resize` command does not support the `--new-size` parameter; `--num-nodes` should be used instead. References: - [kubectl Overview](https://kubernetes.io/docs/reference/kubectl/overview/#operations) - [gcloud container clusters update](https://cloud.google.com/sdk/gcloud/reference/container/clusters/update) - [gcloud container clusters resize](https://cloud.google.com/sdk/gcloud/reference/container/clusters/resize)
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
You have a Kubernetes Engine cluster named 'my-gcp-ace-proj-1' with a node pool named 'my-gcp-ace-primary-node-pool'. To accommodate increased demand, you need to scale the number of nodes in your node pool from 10 to 20. Which command should you use to achieve this?
A
gcloud container clusters update my-gcp-ace-proj-1 --node-pool my-gcp-ace-primary-node-pool --num-nodes 20
B
gcloud container clusters resize my-gcp-ace-proj-1 --node-pool my-gcp-ace-primary-node-pool --num-nodes 20
C
kubectl container clusters update my-gcp-ace-proj-1 --node-pool my-gcp-ace-primary-node-pool --num-nodes 20
D
gcloud container clusters resize my-gcp-ace-proj-1 --node-pool my-gcp-ace-primary-node-pool --new-size 20