Soru

Zorluk: ZorManaging Google Kubernetes Engine Resources

A cloud engineer must migrate non-critical batch processing workloads on a Google Kubernetes Engine (GKE) Standard cluster named `prod-cluster` to a dedicated Spot VM node pool to lower compute expenses. The engineer must prevent general workloads from being scheduled onto the Spot nodes while ensuring existing batch pods transition smoothly without resource contention. In what chronological sequence should the engineer perform the following operational steps?

  1. 1Execute `gcloud container node-pools create spot-batch-pool --cluster=prod-cluster --zone=us-central1-a --spot --node-taints=workload=batch:NoSchedule` to provision the new cost-optimized infrastructure.
  2. 2Update the batch deployment YAML manifest to add a toleration for `workload=batch:NoSchedule` and a node selector for `cloud.google.com/gke-spot=true`.
  3. 3Run `kubectl apply -f batch-deployment.yaml` to deploy the updated pod specifications to the GKE cluster.
  4. 4Execute `gcloud container node-pools delete standard-batch-pool --cluster=prod-cluster --zone=us-central1-a` after verifying that all batch pods are running on the Spot pool.

Cevap

The correct operational sequence is: 1) Provision the new Spot VM node pool with a `NoSchedule` taint using `gcloud container node-pools create`; 2) Update the batch deployment manifest with matching tolerations and Spot node selectors; 3) Apply the manifest using `kubectl apply` to launch pods on the Spot pool; 4) Delete the legacy standard node pool using `gcloud container node-pools delete` after verifying migration success.
Order requires establishing the tainted infrastructure first, configuring workload specifications to tolerate the taint, applying those specifications to migrate running pods, and finally deleting the legacy node pool once migration is complete.

Adım Adım Çözüm

1
Provision the new Spot node pool with node taints
The GKE cluster receives new Spot VM nodes configured with a `workload=batch:NoSchedule` taint.
Infrastructure must be provisioned and tainted first so that general cluster workloads cannot accidentally schedule on Spot instances.
2
Configure workload manifests with tolerations and selectors
The batch deployment YAML is prepared to allow scheduling past the taint and target the Spot node pool.
Without explicit tolerations in the pod template, Kubernetes scheduler will reject scheduling pods on tainted nodes.
3
Apply updated deployment configuration to the cluster
Kubernetes triggers a rolling update, scheduling batch pods onto the active Spot VM nodes.
Deploying the configuration updates the running workloads without causing downtime.
4
Decommission the redundant standard node pool
The standard node pool is removed and resources are released, preventing unnecessary compute costs.
Legacy nodes should only be decommissioned once all workloads have successfully migrated and verified.

Anahtar Kavram

GKE Node Pool Migration and Workload Isolation using Spot VMs, Taints, and Tolerations
Bu soruyu puanla