20.7 Deploying LLMs on Kubernetes: GPUs, Replicas, and Rollouts
The capacity math in Serving, Capacity & Load Testing ends with a number: so many replicas, each needing so many GPUs, with a given set of engine flags. This section turns that number into a running fleet on Kubernetes. Kubernetes was designed for small, cheap, stateless pods that start in seconds and can be packed anywhere. An LLM replica is the opposite: it asks for whole GPUs that are scarce and expensive, it needs tens or hundreds of gigabytes of weights before it can answer anything, it takes minutes to start, and the way you route requests to it changes its throughput. Almost every default (round-robin Services, CPU autoscaling, surge rollouts, quick liveness probes) is wrong for it, and each wrong default has a cost you can compute.
Concepts from other sections (10)
This section uses these ideas. Each has a short definition and a link to the section that explains it in full. Tap a dotted term in the text to preview it.
- readiness probe / liveness probe: checks that, on failure, remove a Pod from its Service or restart its container, respectively. Read more: 10.1 Tracer deploy: images, a kind cluster, two Helm charts, and Jaeger in Systems Engineering
- KEDA: an operator that scales workloads on external metrics by creating and driving an HPA. Read more: 10.7 Durable and worker images and charts in Systems Engineering
- LeaderWorkerSet: a Kubernetes workload that creates, restarts, and scales a multi-pod replica as one unit. Read more: 20.7.5 Adapter fleets and operations
- device plugin: the node agent that advertises GPUs to Kubernetes as the integer extended resource
nvidia.com/gpu. Read more: 20.7.5 Adapter fleets and operations - MIG: hardware partitioning of one GPU into isolated instances, each requested as its own resource. Read more: 20.7.5 Adapter fleets and operations
- time-slicing: advertising one GPU as several, with no memory isolation between the pods that share it. Read more: 20.7.5 Adapter fleets and operations
- lead time: the delay from an autoscaling decision to a replica serving traffic, including node provisioning and cold start. Read more: 20.7.5 Adapter fleets and operations
- endpoint picker: a router that chooses a model-server pod per request from engine metrics, prefix affinity, and loaded adapters. Read more: 20.7.5 Adapter fleets and operations
- failure domain: the set of replicas lost together in one failure (a node, a zone, a cluster); the fleet is sized so the replicas outside the largest one still meet peak load. Read more: 20.7.5 Adapter fleets and operations
- Worker pool: stateless processes that long-poll a durable queue, execute tasks, and report results; because all state lives in the queue or engine, workers can crash, deploy, and autoscale freely. Read more: Chapter 7: Durable Orchestration and Workers in Systems Engineering
You build the deployment in the order a platform engineer would: the arithmetic that sets the pod’s shape and the replica count, the GPU node pool, getting weights from Hugging Face onto the node, the Deployment itself, rollouts, autoscaling, multi-node replicas, routing and the path a request takes through the cluster, disaggregated prefill and decode as Kubernetes objects, failure and failover, and running many models on one shared GPU cluster. Each step comes with the manifest and the reason for each field.
You should have read the chapter opening, LLM Systems & Inference, Inside an Inference Engine, which explains what each pod below is doing as it starts, and the memory budget and runbook in Serving, Capacity & Load Testing. The Kubernetes basics (Deployments, Services, Helm, KEDA) are built step by step in Containers and Kubernetes in Systems Engineering; this section assumes them and adds what changes when the workload is a GPU-bound model server. How weights move from the Hub to GPU memory is covered byte by byte in Model Loading: Hub to GPU.
Note: This layer moves fast. The manifests were written in October 2026 against Kubernetes 1.34, the NVIDIA GPU Operator, KEDA 2.x, LeaderWorkerSet v1, and vLLM 0.31. Pin image tags and chart versions to the ones you tested.
Learning objectives
- Derive a pod’s GPU request, the replica count, and the total GPU count from a model’s memory budget and a measured per-replica goodput.
- Explain how the NVIDIA device plugin exposes GPUs and how taints, labels, MIG, and time-slicing decide where a model pod lands.
- Choose a strategy for getting Hugging Face weights onto nodes, and compute the cold-start and scale-out cost of each.
- Write a vLLM Deployment whose probes, shared memory, rollout strategy, and termination grace match how a model server actually behaves.
- Autoscale on queue depth with enough lead time, run a model across nodes with LeaderWorkerSet, and size separate prefill and decode pools.
- Trace a request through the gateway, the endpoint picker, and the engine, and set proxy timeouts and drain periods from the longest stream.
- Size a fleet to survive the loss of a replica, a node, or a zone, and run disaggregated pools and many models on a shared GPU cluster.
In this part
Section titled “In this part”- Capacity and GPU nodes: Turn a measured per-replica capacity into a pod shape and node pool.
- Weight staging and deployment: Trace immutable model artifacts into a ready serving replica.
- Rollouts, autoscaling, and routing: Budget rollout and scale-out lead time with the required spare resources.
- Disaggregated pools and failover: Account for KV handoff, ownership, and failure domains across worker pools.
- Adapter fleets and operations: Operate model and adapter fleets using latency, quality, and memory evidence.