A Kubernetes administrator needs to migrate production workloads from an existing node pool (`pool-v1`) to a newly provisioned node pool (`pool-v2`) in a Google Kubernetes Engine (GKE) Standard cluster without incurring application downtime. Sequence the operational commands in the correct execution order to complete this migration safely.
- 1Provision the target node pool `pool-v2` with the desired machine configuration using `gcloud container node-pools create`.
- 2Cordon all nodes in `pool-v1` using `kubectl cordon` to mark them as unschedulable.
- 3Drain all nodes in `pool-v1` using `kubectl drain` to evict existing workloads and force rescheduling onto `pool-v2`.
- 4Delete the original node pool `pool-v1` using `gcloud container node-pools delete` once all workloads are running healthily on `pool-v2`.
Cevap
The correct operational sequence is: 1) Provision target node pool `pool-v2` using `gcloud container node-pools create`, 2) Cordon all nodes in `pool-v1` using `kubectl cordon`, 3) Drain nodes in `pool-v1` using `kubectl drain`, and 4) Delete `pool-v1` using `gcloud container node-pools delete`.
To migrate GKE workloads safely without downtime, you must first create target compute capacity (`gcloud container node-pools create`), prevent new pods from landing on old nodes (`kubectl cordon`), gracefully evict existing pods to trigger rescheduling onto new nodes (`kubectl drain`), and finally decommission old infrastructure (`gcloud container node-pools delete`).
Adım Adım Çözüm
Anahtar Kavram
GKE Blue-Green Node Pool Migration Sequence