A cloud operations engineer manages a regional Google Kubernetes Engine (GKE) Standard cluster hosting stateless web services and background batch workloads. During peak traffic events, newly created Pods remain in the `Pending` state with `Insufficient cpu` status events, even though the cluster has autoscaling enabled globally. Investigation reveals that the specific node pool handling these Pods was created with a fixed size of 3 nodes and lacks node-pool-level autoscaling settings. Which command should the engineer execute to enable automatic node scaling for this specific node pool so it can scale from 3 up to 10 nodes when Pods cannot be scheduled?
- Run `gcloud container node-pools update <pool-name> --cluster=<cluster-name> --enable-autoscaling --min-nodes=3 --max-nodes=10` with the appropriate region or zone.Cevap
- BApply a `HorizontalPodAutoscaler` manifest targeting the node pool compute instances with `minReplicas: 3` and `maxReplicas: 10`.
- CRun `gcloud container clusters update <cluster-name> --enable-autopilot` to automatically convert the cluster mode to manage node provisioning.
- DRecreate the workload node pool as a Spot VM node pool without autoscaling flags, relying on preemption events to trigger automatic node replacement.
Cevap
Execute `gcloud container node-pools update <pool-name> --cluster=<cluster-name> --enable-autoscaling --min-nodes=3 --max-nodes=10` with the target region or zone flag.
The correct command uses `gcloud container node-pools update` with `--enable-autoscaling --min-nodes=3 --max-nodes=10`. In GKE Standard clusters, even if autoscaling mechanisms are enabled at the cluster level, individual node pools require explicit autoscaling flags and min/max node boundaries to dynamically adjust node counts when Pods cannot be scheduled due to resource constraints.
Adım Adım Çözüm
Anahtar Kavram
GKE Cluster Autoscaler configuration requires setting `--enable-autoscaling`, `--min-nodes`, and `--max-nodes` on specific node pools via `gcloud container node-pools update`.