Soru

Zorluk: KolayManaging Google Kubernetes Engine Resources

You are managing a Google Kubernetes Engine (GKE) cluster and need to migrate running workloads from an existing node pool to a newly required machine type with minimal downtime. What is the correct sequence of steps to complete this node pool migration?

  1. 1Create a new node pool with the target machine type using gcloud container node-pools create.
  2. 2Mark the existing nodes as unschedulable using kubectl cordon.
  3. 3Evict running workloads from the old nodes using kubectl drain.
  4. 4Delete the old node pool using gcloud container node-pools delete.

Cevap

The correct sequence for migrating workloads to a new node pool is: 1) Provision the new node pool with gcloud container node-pools create, 2) Mark the old nodes as unschedulable with kubectl cordon, 3) Gracefully evict workloads from old nodes with kubectl drain, and 4) Delete the old node pool with gcloud container node-pools delete.
When performing a manual GKE node pool migration, compute capacity must first be provisioned using 'gcloud container node-pools create'. Once the new nodes are ready, old nodes are marked unschedulable with 'kubectl cordon' to prevent new placements. Executing 'kubectl drain' then evicts Pods, allowing Kubernetes to reschedule them onto the new node pool. Finally, 'gcloud container node-pools delete' removes the empty old node pool safely.

Adım Adım Çözüm

1
Provision target compute capacity
New nodes are added to the cluster with the desired specification.
Replacement nodes must exist so evicted Pods have available capacity for rescheduling.
2
Disable scheduling on old nodes
Old nodes are cordoned and marked Unschedulable.
Prevents new Pods from being placed on nodes that are about to be decommissioned.
3
Evict workloads from old nodes
Running Pods are safely evicted and recreated on the newly provisioned node pool.
Draining ensures workloads migrate to active capacity without sudden termination.
4
Decommission old node pool
The old node pool is removed from the GKE cluster.
Cleaning up empty infrastructure prevents unnecessary cloud resource charges.

Anahtar Kavram

GKE Node Pool Migration Procedure
Bu soruyu puanla