Soru

Zorluk: ZorManaging Google Kubernetes Engine Resources

A Cloud Engineer needs to perform maintenance on a Google Kubernetes Engine (GKE) Standard cluster by replacing an existing node pool with a new machine-type node pool, while ensuring zero workload downtime. Arrange the operational CLI steps in the correct sequential order from first to last to complete this node pool migration safely.

  1. 1Create the new target node pool using `gcloud container node-pools create`.
  2. 2Mark nodes in the old pool as unschedulable using `kubectl cordon`.
  3. 3Gracefully evict running pods from old nodes using `kubectl drain --ignore-daemonsets`.
  4. 4Verify workload status and node placement using `kubectl get pods -o wide`.
  5. 5Decommission the old node pool using `gcloud container node-pools delete`.

Cevap

The correct sequence is: 1) Create the new target node pool using gcloud container node-pools create, 2) Mark nodes in the old pool as unschedulable using kubectl cordon, 3) Gracefully evict running pods from old nodes using kubectl drain --ignore-daemonsets, 4) Verify workload status and node placement using kubectl get pods -o wide, and 5) Decommission the old node pool using gcloud container node-pools delete.
Safe migration requires creating destination capacity first (gcloud container node-pools create), blocking new pod placement on old nodes (kubectl cordon), gracefully evicting existing workloads (kubectl drain), validating that all pods are healthy on the new pool (kubectl get pods -o wide), and finally deleting the deprecated node pool (gcloud container node-pools delete).

Adım Adım Çözüm

1
Provision target compute capacity in GKE.
A new node pool is initialized and joins the cluster.
Destination capacity must be available before evicting pods to prevent capacity shortages or Unschedulable pod states.
2
Cordon the old nodes in the cluster.
Nodes in the legacy node pool are marked as Unschedulable.
Ensures that any new pods or evicted workloads are routed exclusively to the new node pool.
3
Drain the old nodes.
Existing pods are evicted and rescheduled onto the new node pool.
Gracefully shuts down workloads on old hardware and recreates them on the newly provisioned infrastructure.
4
Inspect pod deployment status across nodes.
Pods are confirmed running and healthy on the new nodes.
Verification confirms that application traffic is served correctly before removing old compute resources.
5
Delete the old node pool.
The old node pool is removed from the cluster.
Safely reclaims resources and avoids unnecessary compute billing.

Anahtar Kavram

GKE Zero-Downtime Manual Node Pool Migration Workflow
Bu soruyu puanla