A Cloud Engineer needs to perform a manual blue-green node pool replacement in a Google Kubernetes Engine (GKE) cluster to move workloads from an old pool (pool-v1) to a newly configured pool (pool-v2) with zero application downtime. Arrange the operational steps below in the correct execution sequence.
- 1Execute gcloud container node-pools create to provision pool-v2 with the target machine specs.
- 2Run kubectl cordon on the nodes in pool-v1 to mark them as unschedulable.
- 3Run kubectl drain on the nodes in pool-v1 to gracefully evict running pods and trigger rescheduling onto pool-v2.
- 4Execute gcloud container node-pools delete to remove pool-v1 once all workloads are verified healthy on pool-v2.
Answer
The correct operational sequence begins by creating the new node pool (pool-v2), cordoning nodes in the old pool (pool-v1) to prevent new pod assignments, draining pool-v1 to migrate existing pods to pool-v2, and finally deleting pool-v1.
Safe blue-green replacement of a GKE node pool requires establishing target capacity first (`gcloud container node-pools create`), marking old nodes unschedulable (`kubectl cordon`), evicting workloads cleanly to the new pool (`kubectl drain`), and finally removing the decommissioned compute resources (`gcloud container node-pools delete`).
Step-by-Step Solution
Key Concept
GKE Manual Node Pool Migration and Maintenance Procedure