Question

Difficulty: MediumManaging Google Kubernetes Engine Resources

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.

  1. 1Execute gcloud container node-pools create to provision pool-v2 with the target machine specs.
  2. 2Run kubectl cordon on the nodes in pool-v1 to mark them as unschedulable.
  3. 3Run kubectl drain on the nodes in pool-v1 to gracefully evict running pods and trigger rescheduling onto pool-v2.
  4. 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

1
Provision pool-v2 using gcloud container node-pools create
The target node pool is created and joins the cluster in a Ready state.
New compute capacity must be available before evicting existing workloads to prevent pods from stalling in a Pending state.
2
Cordon pool-v1 nodes using kubectl cordon
Nodes in pool-v1 are marked Unschedulable.
This prevents the Kubernetes control plane from placing any new or rescheduled pods back onto the pool being decommissioned.
3
Drain pool-v1 nodes using kubectl drain
Pods on pool-v1 are gracefully evicted and rescheduled onto pool-v2.
Drain respects pod disruption budgets and termination grace periods, migrating workloads to the available pool-v2 capacity without outage.
4
Delete pool-v1 using gcloud container node-pools delete
The legacy node pool resources are released and removed from GCP.
Once all workloads are confirmed healthy on pool-v2, deleting pool-v1 cleans up legacy compute resources.

Key Concept

GKE Manual Node Pool Migration and Maintenance Procedure
Rate this question