Soru

Zorluk: KolayManaging Google Kubernetes Engine Resources

A cloud engineering team needs to manually change the number of worker nodes in a Google Kubernetes Engine (GKE) node pool named pool-analytics inside an existing zonal cluster named analytics-cluster in zone us-central1-a. They want to set the target size to 5 nodes per zone using the Google Cloud CLI. Which command should they execute?

  1. gcloud container node-pools resize pool-analytics --cluster=analytics-cluster --zone=us-central1-a --num-nodes=5Cevap
  2. B
    kubectl autoscale deployment pool-analytics --min=5 --max=5 --zone=us-central1-a
  3. C
    gcloud container clusters update analytics-cluster --enable-autopilot --node-pool=pool-analytics --num-nodes=5
  4. D
    kubectl scale node pool-analytics --replicas=5

Cevap

The command `gcloud container node-pools resize pool-analytics --cluster=analytics-cluster --zone=us-central1-a --num-nodes=5` correctly resizes the specified GKE node pool.
Resizing a GKE node pool requires using the Google Cloud CLI command `gcloud container node-pools resize`. Specifying the node pool name alongside the `--cluster`, `--zone`, and `--num-nodes` flags correctly updates the underlying Compute Engine instance group size for that pool.

Adım Adım Çözüm

1
Identify the target resource and CLI utility.
GKE node pools are infrastructure components managed via `gcloud container node-pools` commands rather than `kubectl` workload commands.
Node pool sizing operates at the GCP infrastructure layer rather than inside the Kubernetes control plane.
2
Select the correct subcommand and flags.
Use `resize` with `--cluster`, `--zone` (or `--region`), and `--num-nodes` specifying the target count.
The `--num-nodes` flag sets the number of nodes per zone in the selected node pool.

Anahtar Kavram

Manually resizing GKE node pools using gcloud container node-pools resize.
Bu soruyu puanla