
Answer-first summary for fast verification
Answer: Use `gcloud container clusters resize` to add more nodes to the node pool.
The correct answer is to use `gcloud container clusters resize` to add more nodes to the node pool. This is because the existing nodes are maxed out, leading to 'Insufficient cpu' errors for new pods. While enabling cluster autoscaling would be ideal, it's not listed among the options. The `kubectl container clusters resize` command does not exist, making it an incorrect option. Editing the managed instance group is not applicable since GKE clusters do not use managed instance groups; instead, the cluster master manages node lifecycles. Therefore, manually resizing the cluster with `gcloud container clusters resize` is the appropriate solution under the given circumstances.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
After deploying a workload to your GKE cluster using kubectl apply -f app.yaml and exposing it via a LoadBalancer service with kubectl apply -f service.yaml, you enabled horizontal pod autoscaler to manage increased load by executing kubectl autoscale deployment [YOUR DEPLOYMENT] –cpu-percent=50 –min=1 –max=10. Despite the autoscaler launching new pods, they fail with 'Insufficient cpu'. What is the most effective solution to resolve this issue?
A
Edit the managed instance group of the cluster and enable autoscaling.
B
Use kubectl container clusters resize to add more nodes to the node pool.
C
Edit the managed instance group of the cluster and increase the number of VMs by 1.
D
Use gcloud container clusters resize to add more nodes to the node pool.
No comments yet.