
Answer-first summary for fast verification
Answer: Enable autoscaling on the existing GKE cluster by running `gcloud container clusters update [CLUSTER_NAME] --enable-autoscaling --min-nodes=1 --max-nodes=10`.
The correct approach is to update the existing GKE cluster to enable autoscaling with `gcloud container clusters update [CLUSTER_NAME] --enable-autoscaling --min-nodes=1 --max-nodes=10`. This command adjusts the cluster's node count automatically within the specified limits, aligning with the requirement to scale based on traffic. Other options either involve unnecessary cluster recreation, incorrect tagging methods, or manual scaling which doesn't meet the automatic scaling requirement.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
You have deployed your application to a default node pool on a GKE cluster and wish to configure cluster autoscaling to ensure profitability by limiting the number of Kubernetes nodes to 10. Your goal is to start small, scaling up with increased traffic and scaling down when traffic decreases. What is the best approach?
A
Create a new GKE cluster with autoscaling enabled by executing gcloud container clusters create [CLUSTER_NAME] --enable-autoscaling --min-nodes=1 --max-nodes=10 and redeploy your application.
B
Enable autoscaling on the existing GKE cluster by running gcloud container clusters update [CLUSTER_NAME] --enable-autoscaling --min-nodes=1 --max-nodes=10.
C
Add a tag to the instances in the cluster to enable autoscaling using gcloud compute instances add-tags [INSTANCE] --tags=enable-autoscaling,min-nodes=1,max-nodes=10.
D
Configure a Stackdriver alert to monitor application slowness. Upon triggering, manually adjust the cluster size with gcloud container clusters resize CLUSTER_Name --size.
No comments yet.