How would you architect a Kubernetes cluster to manage a heterogeneous fleet of GPUs simultaneously running massive distributed training jobs and latency-sensitive inference services without catastrophic degradation?
An in-depth look at designing a robust Kubernetes orchestration layer to optimise GPU utilisation across diverse, conflicting machine learning workloads.
What the interviewer is scoring
- Whether the candidate understands how to configure and leverage Kubernetes device plugins for GPU scheduling.
- That they can explain techniques for GPU sharing, such as Multi-Instance GPU (MIG) or time-slicing.
- Does the candidate propose strategies to isolate noisy neighbour training jobs from critical inference services?
- Whether they can articulate how to implement auto-scaling for GPU node pools based on custom metrics.
- That they recognise the complexities of network topology and storage attachment for distributed training.
Answer
Short answer
An in-depth look at designing a robust Kubernetes orchestration layer to optimise GPU utilisation across diverse, conflicting machine learning workloads.
Treating a GPU like an expensive CPU
The naive platform engineer treats a GPU like a slightly more expensive CPU. They deploy the standard NVIDIA device plugin, let Kubernetes exclusively allocate full GPUs to single containers, and call it a day. This inevitably results in a cluster where inference services requesting a fraction of a GPU's capacity hoard massive resources, while distributed training jobs starve. Furthermore, they mix workloads indiscriminately, allowing resource-hungry training runs to saturate network fabric and storage I/O, creating a "noisy neighbour" effect that completely destroys inference response times.
Engineering isolation and resource density
A true enterprise GPU orchestration platform must aggressively optimise for density while maintaining strict workload isolation. The default behaviour of exclusive GPU allocation is unacceptable for small inference models. Resource efficiency demands GPU sharing mechanisms. For modern hardware architectures, Multi-Instance GPU (MIG) provides hardware-level partitioning, guaranteeing memory and compute bandwidth. For older generations, software-based time-slicing is necessary, though it requires meticulous monitoring of context-switching overhead.
flowchart TD
A["Workload Submission"] --> B["K8s API Server"]
B --> C["Custom Scheduler"]
C --> D{"Workload Type?"}
D -- "Training Job" --> E["Identify Interconnected Node Pool"]
D -- "Inference Service" --> F["Identify MIG/Time-sliced Nodes"]
E --> G["Allocate NVLink/InfiniBand Nodes"]
F --> H["Allocate Partitioned GPU Resources"]
G --> I["Mount High-Performance Storage"]
H --> J["Deploy Serving Container"]
I --> K["Begin Distributed Training"]Isolation is non-negotiable. Latency-sensitive inference services must be physically and logically segregated from distributed training workloads. This requires extensive use of node taints, tolerations, and affinity rules to force workloads onto distinct node pools. Network policies and Quality of Service (QoS) guarantees must be enforced at the fabric level to ensure inference traffic is never queued behind bulk data synchronisation tasks.
Topology-aware scheduling and custom telemetry
Distributed training introduces networking complexities that default Kubernetes schedulers simply cannot comprehend. A massive training run requires high-bandwidth, low-latency communication across multiple nodes. A topology-aware custom scheduler is required to interrogate the physical network layout—identifying nodes sharing a top-of-rack switch or an InfiniBand fabric—and strategically placing pods to minimise communication hops.
Autoscaling this environment based on CPU or memory is an exercise in futility. A robust monitoring stack must scrape low-level telemetry: streaming multiprocessor (SM) utilisation, memory allocation, and NVLink bandwidth. The Kubernetes Custom Metrics API must feed these metrics into Horizontal Pod Autoscalers to dynamically scale inference replicas, while cluster autoscalers must preemptively manage the agonizing delays associated with booting and bootstrapping large GPU instances. Finally, high-performance, parallel file systems must be integrated via Container Storage Interface (CSI) drivers with aggressive local caching to keep the GPUs fed with data.
Orchestrating a large-scale GPU cluster demands advanced Kubernetes scheduling techniques, deep hardware topology awareness, and custom metric-driven autoscaling to achieve a harmonious balance between resource utilisation and strict performance isolation.
© 2026 Preptima. Originally published at preptima.com.
Likely follow-ups
- How would your design change if the cluster also needed to support a third workload type, such as batch data processing, on the same GPU nodes?
- What happens to in-flight inference requests when a MIG partition needs to be reconfigured?
- How do you decide when time-slicing is acceptable versus when you must insist on MIG or dedicated GPUs?
Related questions
- Pods are being evicted during node pressure even though your CPU dashboards look fine. Where do you look, and what would you change so it stops?hardAlso on kubernetes4 min
- A DAG that finished in an hour now takes nine and blocks everything behind it. How do you find out where the time went?hardAlso on orchestration6 min
- Every rolling update drops a small number of requests. Where do they go?hardAlso on kubernetes4 min
- How would you autoscale a GPU inference service?hardAlso on gpu6 min