Soru

Zorluk: OrtaManaging Google Kubernetes Engine Resources

An infrastructure engineer manages a Google Kubernetes Engine (GKE) Standard cluster hosting a memory-intensive data processing workload in a node pool named `analytics-pool`. The current nodes using `e2-standard-4` machine types are consistently running out of memory. The engineer must upgrade `analytics-pool` to use `e2-standard-8` machine types with minimal disruption to running pods. Which operational procedure should the engineer perform?

  1. Create a new node pool with the `e2-standard-8` machine type, cordon and drain the nodes in `analytics-pool`, and then delete `analytics-pool` once workloads migrate.Cevap
  2. B
    Run `gcloud container node-pools update analytics-pool --machine-type=e2-standard-8` to change the VM instance size of the active nodes in place.
  3. C
    Configure the Horizontal Pod Autoscaler (HPA) targeting `analytics-pool` to automatically scale up the memory capacity of individual worker nodes.
  4. D
    Execute `gcloud container clusters update --enable-autopilot` on the cluster so GKE automatically resizes the existing node instances to fit larger workloads.

Cevap

Create a new node pool with the required machine type, cordon and drain the existing node pool nodes, and delete the original node pool after workloads successfully migrate.
Because node VM machine types in GKE node pools are immutable once created, changing node hardware specifications requires creating a new node pool with the desired machine type (`e2-standard-8`), safely draining workloads off the old nodes using `kubectl cordon` and `kubectl drain`, and deleting the old node pool once migration completes.

Adım Adım Çözüm

1
Provision a new node pool in the existing GKE cluster using `gcloud container node-pools create` with `--machine-type=e2-standard-8`.
New nodes with the larger memory footprint become ready to accept pods.
GKE node pool machine types are immutable after creation.
2
Cordon the old nodes in `analytics-pool` using `kubectl cordon` to prevent new pod scheduling, then execute `kubectl drain` to evict running pods.
Pods are gracefully terminated on old nodes and rescheduled onto the new `e2-standard-8` nodes.
Draining ensures workload continuity without unexpected downtime.
3
Delete the original `analytics-pool` using `gcloud container node-pools delete` after all pods migrate successfully.
Unused compute resources are removed, preventing unnecessary billing.
Cleans up deprecated cluster infrastructure.

Anahtar Kavram

GKE Node Pool Migration & Machine Type Immutability
Tahmini Süre:2m 0s
Bu soruyu puanla