GCP-CLOUD-ARCHITECT practice question 2 of 10

You want to enable your running Google Kubernetes Engine cluster to scale as demand for your application changes. What should you do?

Full set: 333 questions

Domain Managing and provisioning a solution infrastructure

Answer options
A: Add additional nodes to your Kubernetes Engine cluster using the following command:gcloud container clusters resizeCLUSTER_Name – -size 10
B: Add a tag to the instances in the cluster with the following command:gcloud compute instances add-tagsINSTANCE - -tags enable-autoscaling max-nodes-10
C: Update the existing Kubernetes Engine cluster with the following command:gcloud alpha container clustersupdate mycluster - -enable-autoscaling - -min-nodes=1 - -max-nodes=10 Correct answer
D: Create a new Kubernetes Engine cluster with the following command:gcloud alpha container clusterscreate mycluster - -enable-autoscaling - -min-nodes=1 - -max-nodes=10and redeploy your application
Correct Answer:
C. Update the existing Kubernetes Engine cluster with the following command:gcloud alpha container clustersupdate mycluster - -enable-autoscaling - -min-nodes=1 - -max-nodes=10
Explanation

The question asks how to enable autoscaling on a running Google Kubernetes Engine (GKE) cluster. The gcloud container clusters update command is used to modify the configuration of an existing cluster. The --enable-autoscaling flag, along with --min-nodes and --max-nodes, specifically configures the cluster autoscaler on the specified running cluster, allowing it to automatically add or remove nodes based on workload demands.

Why Incorrect

A. The resize command manually sets a fixed number of nodes; it does not enable automatic scaling based on load.
B. Adding tags to Compute Engine instances is not the correct mechanism for configuring GKE cluster autoscaling, which is a cluster-level setting.
D. The create command builds a new cluster. This would require a disruptive application migration rather than updating the existing, running cluster.

References

1. Google Cloud Documentation. gcloud container clusters update. The command reference explicitly shows the --enable-autoscaling, --min-nodes, and --max-nodes flags for modifying an existing cluster.

2. Google Cloud Documentation. Autoscaling a cluster. Section: "Enabling cluster autoscaling". It states, "You can enable autoscaling on an existing cluster by using the gcloud command-line tool or the Google Cloud console." and provides the gcloud container clusters update command as the example.

Scroll to Top