Kubernetes for LLM Inference: Scaling AI Workloads in Production

How to run LLM inference on Kubernetes with GPU scheduling, autoscaling, and production-grade serving. Covers vLLM deployment, GPU node pools, HPA configuration, and cost management.

September 8, 2026

Kubernetes can run LLM inference reliably when a team needs repeatable GPU scheduling, controlled releases, health-based routing, and scaling across several model-server replicas. It is most useful for sustained production workloads and existing platform teams, not as a shortcut around the operational work required to serve large models.

When Kubernetes LLM Inference Is Worth the Complexity

Kubernetes LLM inference places a model server such as vLLM inside pods scheduled onto GPU nodes. Services route requests to ready replicas, deployments manage updates, and autoscalers adjust workload or node capacity from observed demand. The pattern gives operators standard controls, but model weight distribution, GPU capacity, long startup times, and inference-aware routing still need deliberate design.

A single virtual machine is often enough for a prototype or steady low-volume service. Kubernetes becomes useful when the application needs multiple replicas, separate model pools, staged releases, failure recovery, shared cluster governance, or scaling across GPU node groups. Teams without Kubernetes operations experience should compare a managed inference service before owning this stack.

Array.im's LLMOps and MLOps guidance can help frame the observability and release practices around the serving layer. The cluster is only one part of production LLM deployment.

Prepare GPU Nodes and Scheduling Rules

Install the vendor device plugin so Kubernetes advertises GPU resources to the scheduler. A pod then requests a resource such as nvidia.com/gpu: 1. Use node labels, taints, tolerations, and affinity to keep model-serving pods on the intended accelerator type and prevent unrelated workloads from consuming scarce GPU nodes.

Match the model and numerical precision to available GPU memory. Account for weights, key-value cache, runtime overhead, and the maximum concurrent workload. A pod that barely loads at startup may fail under longer contexts or larger batches. Test the actual model, context distribution, and serving configuration on the chosen hardware.

Keep GPU node pools separate by accelerator class when the cluster serves different models. Node autoscaling can add machines for unschedulable pods, but GPU provisioning and image startup may take minutes. Capacity planning must cover the delay instead of assuming immediate elasticity.

Deploy vLLM with Stable Model Storage and Health Checks

The official vLLM Kubernetes documentation shows native deployment and service patterns for CPU or GPU serving. In production, pin a tested image tag rather than using latest. Pin the model revision too, because an upstream change can alter behavior or break compatibility during a restart.

Model weights may come from a persistent volume, an object-store download, or a prepared container layer. The best choice depends on model size, rollout frequency, node storage, and security requirements. Protect repository tokens with Kubernetes secrets and limit their scope. Avoid logging credentials or full prompts.

Readiness should remain false until weights are loaded and the server can accept inference requests. Liveness checks need enough startup tolerance to avoid restarting a healthy pod during a long model load. Add a startup probe when initialization is slow, a readiness probe for traffic admission, and a liveness probe for deadlock recovery.

Choose Metrics That Reflect Inference Demand

CPU use is a poor scaling signal for a GPU-bound model server. GPU utilization can also mislead because continuous batching may keep a device busy while queues grow. Useful signals include queued requests, time to first token, tokens generated per second, active sequences, request latency, and rejected requests.

Kubernetes Horizontal Pod Autoscaling can consume resource, custom, or external metrics. Export vLLM and GPU metrics to a monitoring system, expose the chosen signal through a compatible metrics adapter, and define a target that matches the service objective. Test the full path under load before trusting it.

Scaling has two layers. The workload autoscaler creates more pods, while the node autoscaler creates GPU nodes when those pods cannot be scheduled. A new pod is not useful until a node exists, weights are available, and readiness passes. Maintain warm capacity for latency-sensitive traffic and use scheduled or predictive scaling for known peaks.

Control Rollouts, Routing, and Failure Recovery

A standard rolling update can temporarily require enough GPU memory for old and new replicas at once. Set surge and unavailable values that the cluster can actually schedule. For large models, a blue-green or canary pool may be safer. Send a small traffic share to the new model server, compare errors and latency, then expand gradually.

Round-robin routing ignores prompt length, cache locality, and replica queue depth. Basic services may tolerate it, but higher-volume deployments benefit from inference-aware routing. Preserve request cancellation so abandoned generations stop consuming GPU time. Apply maximum input and output lengths at the gateway as well as the model server.

Retries require restraint. Repeating a long generation after a connection loss may double compute and still return a duplicate result. Use request identifiers, distinguish safe transport retries from completed generations, and give clients a way to query job status for asynchronous work.

Operate Kubernetes AI Workloads with Cost Visibility

Measure cost per useful unit, such as a successful request or one million generated tokens, at the latency target the product requires. GPU hourly price alone hides idle time, failed generations, overprovisioning, engineering effort, storage, networking, and monitoring.

Track GPU allocation and actual utilization by model pool. Separate pre-production load tests from customer traffic. Shut down experimental pools when unused, but do not promise scale-to-zero response times until cold starts have been measured. An RAG workload may also need independently scaled embedding, retrieval, and re-ranking services.

Kubernetes is a sound serving foundation when the organization can operate it and demand justifies the control. Start with one measured model deployment, prove health checks and load behavior, then add autoscaling and advanced routing from observed bottlenecks.

Found this helpful?

Share this page with others