A cloud administrator needs to upgrade the machine type of a node pool in a production Google Kubernetes Engine (GKE) Standard cluster to handle increased resource demands without incurring workload downtime. What is the correct sequence of steps to perform this node pool migration safely?
- 1Create a new node pool (`pool-v2`) with the target machine type using `gcloud container node-pools create`.
- 2Mark nodes in the existing node pool (`pool-v1`) as unschedulable using `kubectl cordon`.
- 3Evict workloads from the existing node pool (`pool-v1`) using `kubectl drain`.
- 4Delete the original node pool (`pool-v1`) using `gcloud container node-pools delete`.
Answer
The correct sequence begins with provisioning the new node pool (`pool-v2`), followed by cordoning nodes in the old pool (`pool-v1`), draining the old pool to migrate pods, and finally deleting the old node pool once migration completes.
In GKE node pool migrations, zero-downtime is achieved by following a structured blue-green workflow. First, provision new capacity (`pool-v2`). Second, cordon the original nodes (`pool-v1`) to prevent new pod assignments. Third, drain the original nodes to gracefully evict running pods so Kubernetes deployment controllers recreate them on `pool-v2`. Fourth, delete `pool-v1` after verifying all pods are running successfully on the new nodes.
Step-by-Step Solution
Key Concept
GKE Blue-Green Node Pool Migration Sequence