Question

Difficulty: MediumDeploying and Managing Google Kubernetes Engine (GKE) Clusters and Workloads

An organization runs a production application on an existing Standard Google Kubernetes Engine (GKE) cluster. The data science team needs to deploy a batch data processing job that is stateless, fault-tolerant, and designed to handle sudden instance terminations gracefully. To minimize compute expenses, management requests running this batch job on cost-optimized infrastructure without risking the availability of existing critical stateful workloads running on standard nodes. Which deployment strategy should the Cloud Engineer execute to satisfy these requirements?

  1. Create a dedicated node pool configured with Spot VMs using gcloud container node-pools create with the --spot flag, apply node taints to the pool, and add corresponding tolerations in the batch job manifest.Answer
  2. B
    Create a dedicated node pool configured with Spot VMs using gcloud container node-pools create with the --spot flag, and migrate the existing stateful database workloads onto this new pool to maximize cluster-wide cost savings.
  3. C
    Migrate the entire GKE cluster to GKE Autopilot mode, because GKE Autopilot automatically converts all standard node pools to Spot instances by default without requiring workload manifests.
  4. D
    Execute gcloud config set container/use_spot true to modify node types at the cluster level, and then re-fetch cluster credentials using kubectl config set-context.

Answer

Create a dedicated node pool configured with Spot VMs using gcloud container node-pools create with the --spot flag, apply node taints to the pool, and add corresponding tolerations in the batch job manifest.
Spot VMs are designed for fault-tolerant and stateless batch processing. Provisioning a dedicated Spot node pool with node taints ensures cost minimization for the batch processing job while protecting critical stateful workloads from being scheduled on preemptible nodes.

Step-by-Step Solution

1
Identify workload characteristics and compute requirements.
The batch job is stateless and fault-tolerant, making it an ideal candidate for GKE Spot VMs to lower compute costs.
Spot VMs offer steep discounts in exchange for preemptibility, which fits stateless, restartable batch jobs.
2
Provision a dedicated Spot node pool using gcloud CLI.
Execute `gcloud container node-pools create <pool-name> --cluster=<cluster-name> --spot --node-taints=workload=batch:NoSchedule`.
Creating a separate node pool ensures compute isolation, while the `--spot` flag provisions preemptible capacity.
3
Configure scheduling restrictions to isolate stateful workloads.
Taint the Spot node pool so regular pods without tolerations avoid it, and add matching tolerations/nodeAffinity to the batch Pod specification.
This guarantees that critical stateful workloads remain safely on standard nodes while batch pods schedule onto the Spot nodes.

Key Concept

GKE Spot Node Pools and Workload Scheduling Isolation
Rate this question