An organization needs to migrate workloads from an existing GKE Standard node pool to a new node pool featuring larger machine types to handle increased memory demand. To prevent application downtime during the migration, in what sequence should a cloud engineer execute the following operational steps?
- 1Provision a new node pool within the existing GKE cluster using the required larger machine type.
- 2Cordon all nodes in the old node pool using `kubectl cordon` to mark them as unschedulable.
- 3Drain the nodes in the old node pool using `kubectl drain --ignore-daemonsets` to gracefully evict running workloads.
- 4Delete the old node pool using `gcloud container node-pools delete` once all workloads have successfully migrated.
Answer
The operational sequence must start with provisioning the new node pool, followed by cordoning the old nodes, draining the old nodes to evict Pods to the new pool, and finally deleting the old node pool.
To achieve zero downtime during node pool replacement in GKE Standard, new compute capacity must be created first. Nodes in the old pool are then cordoned so no new Pods are placed on them. Next, `kubectl drain` gracefully evicts active Pods, causing Kubernetes deployment controllers to recreate them on the newly provisioned node pool. Finally, after verifying all workloads are running safely on the new nodes, the old node pool can be deprovisioned.
Step-by-Step Solution
Key Concept
Zero-downtime GKE Node Pool Migration