Everyone is talking about running AI on Kubernetes. But what are engineers actually stuck on when they sit down to do it? To find out, I went through the Kubernetes Discuss forum and searched for topics on GPUs, NVIDIA, DRA, Kueue, Kubeflow, LLMs, inference, MCP and AI agents.
The result was a little surprising. There are very few threads that say “how do I run vLLM” or “how do I deploy an LLM”. Most of the questions sit one layer below that. People want to know why Kubernetes cannot see their GPU, why two pods landed on the same card, how to schedule by GPU memory, and how to share a small pool of GPUs fairly across a team. Serving models and running agents come after those problems are solved.
This post walks through those questions in the order people hit them, and shows how to solve each one with the features available in Kubernetes today (v1.37 is the latest release at the time of writing).
What people are asking on the forum
Here are the main themes, with real thread titles as examples:
| Theme | Example threads on discuss.kubernetes.io |
|---|---|
| Making the GPU visible | “0/1 nodes are available: 1 Insufficient nvidia.com/gpu”, “Failed to enable gpu”, “How can I use nvidia gpu in kubernetes pod?” |
| Understanding GPU allocation | “Allocatable and Capacity resources like nvidia.com/gpu are always same”, “How can I know which gpu is scheduled” |
| Isolation and sharing | “Containers not allocated exclusive GPU when multiple Pods are deployed”, “Enable GPU time slicing”, “Custom resource limit for GPU Memory” |
| Smarter scheduling | “Consider GPU vRAM during scheduling”, “Why isn’t DRA prepare failure treated as a pod sync error?” |
| Team quotas and fair share | “Design architecture for submitting jobs via Kueue with different priorities” |
| ML platforms | “Kubeflow MPI communication issue”, “Istio-pilot error when deploying kubeflow”, “Machine Learning in onprem Kubernetes” |
| AI agents and LLM tooling | “Introducing k8s-mcp-server”, “Using tilt CLI through MCP for LLM workflows”, “Feedback wanted: read-only Kubernetes evidence graph for diagnostics and AI agents” |
So the story people are living through looks like this: get the GPU working, stop pods from fighting over it, schedule by what the model needs, share the GPUs fairly, then serve models and let agents in safely. Let’s go through each step.
1. Getting Kubernetes to see the GPU
The most common error on the forum is this one:
0/1 nodes are available: 1 Insufficient nvidia.com/gpu
Kubernetes does not know about GPUs on its own. A node only advertises nvidia.com/gpu after three things are in place:
- The NVIDIA driver is installed on the host.
- The NVIDIA Container Toolkit is configured for your container runtime (containerd or CRI-O).
- The NVIDIA device plugin (or a DRA driver, covered later) is running on the node.
The easiest way to get all three is the NVIDIA GPU Operator, which installs and manages them for you:
helm repo add nvidia https://helm.ngc.nvidia.com/nvidia
helm repo update
helm install gpu-operator nvidia/gpu-operator \
--namespace gpu-operator --create-namespace
If your hosts already have the driver installed, add --set driver.enabled=false. On MicroK8s, which shows up a lot on the forum, microk8s enable gpu wraps the same operator. Most “failed to enable gpu” threads come down to a driver version mismatch or the operator trying to install a driver on a host that already has one.
Check that the node now advertises GPUs:
kubectl get nodes -o custom-columns=NAME:.metadata.name,GPU:.status.allocatable.nvidia\.com/gpu
Then run a quick test pod:
apiVersion: v1
kind: Pod
metadata:
name: gpu-test
spec:
restartPolicy: Never
containers:
- name: cuda
image: nvidia/cuda:12.4.1-base-ubuntu22.04
command: ["nvidia-smi"]
resources:
limits:
nvidia.com/gpu: 1
If kubectl logs gpu-test shows the nvidia-smi table, the basics are working.
Why Allocatable and Capacity never change
One forum thread asks why nvidia.com/gpu under Allocatable stays the same even when pods are using GPUs. That is expected. Capacity and Allocatable describe what the node has, not what is free. To see what is in use, look at the “Allocated resources” section:
kubectl describe node <node-name> | grep -A 10 "Allocated resources"
For real usage numbers (memory used, SM utilization, temperature), use the DCGM exporter that ships with the GPU Operator and scrape it with Prometheus.
2. Why two pods ended up on the same GPU
Another popular thread: a user deployed several DeepStream pods on a node with two GPUs, each pod asking for one GPU, but the containers were not isolated. They could all see and use every card.
The usual cause is the NVIDIA_VISIBLE_DEVICES environment variable. Many CUDA and vendor images set it to all. If the container runtime is configured to read that variable, the container gets every GPU on the host, no matter what the device plugin allocated.
How to fix it:
- Do not set
NVIDIA_VISIBLE_DEVICESyourself in the pod spec. Let the device plugin set it. - Configure the device plugin to pass devices using volume mounts or CDI instead of the environment variable (
DEVICE_LIST_STRATEGY=volume-mountsorcdi-annotations), and setaccept-nvidia-visible-devices-envvar-when-unprivileged = falsein the NVIDIA Container Toolkit config. The GPU Operator can do both for you. - Never run GPU pods as privileged unless you really need it. Privileged containers can see all devices.
Run nvidia-smi -L inside each pod. Each one should list only the GPU it was given.
3. Sharing a GPU between pods
With the classic device plugin, a GPU is a whole number. A pod asks for 1 GPU and gets the entire card, even if the model only needs 6 GB of an 80 GB card. That is wasteful for notebooks, small models and dev work, and it is why “time slicing” and “GPU memory limit” come up so often. You have three options.
Time slicing
Time slicing makes one physical GPU show up as several nvidia.com/gpu resources. Pods take turns on the GPU. With the GPU Operator you configure it like this:
apiVersion: v1
kind: ConfigMap
metadata:
name: time-slicing-config
namespace: gpu-operator
data:
any: |-
version: v1
sharing:
timeSlicing:
resources:
- name: nvidia.com/gpu
replicas: 4
kubectl patch clusterpolicies.nvidia.com/cluster-policy --type merge \
-p '{"spec":{"devicePlugin":{"config":{"name":"time-slicing-config","default":"any"}}}}'
Each GPU now shows up as 4. The catch: there is no memory isolation. If one pod uses all the GPU memory, the others get out-of-memory errors. Use it for dev and light inference, not for production workloads that need guarantees.
MIG (Multi-Instance GPU)
On A100, H100, H200 and newer data center GPUs, MIG splits a card into hardware-isolated slices, each with its own memory and compute. Pods request a slice such as nvidia.com/mig-1g.10gb. This gives real isolation, but only on GPUs that support it. The forum thread “Consider GPU vRAM during scheduling” is from a team without MIG support, which is exactly why they were stuck.
MPS
NVIDIA MPS lets several processes share a GPU at the same time, with optional limits on memory and compute per client. It is supported by the device plugin and gives better throughput than time slicing for many small inference workloads, but isolation is still weaker than MIG.
For anything more flexible than these, you want DRA.
4. Dynamic Resource Allocation: scheduling by what the model needs
The best answer in the “Consider GPU vRAM during scheduling” thread was short: “I think DRA is what you want.” It is worth unpacking why.
Dynamic Resource Allocation (DRA) replaces “give me N of this thing” with “give me a device that matches these rules”. A DRA driver publishes each device with its attributes (model, memory, driver version, PCIe root, MIG profiles and so on) in ResourceSlice objects. Pods ask for devices through a ResourceClaim, and the scheduler picks a device that fits.
Where DRA stands today:
- v1.34: core DRA graduated to GA, with the
resource.k8s.io/v1API. - v1.36: admin access and prioritized lists went GA. Partitionable devices, consumable capacity, and device taints and tolerations went to beta and are on by default.
- v1.37: extended resource support went GA. A DRA driver can now serve classic requests like
nvidia.com/gpu: 1without a separate device plugin, which makes migration much easier.
Here is how you ask for “one NVIDIA GPU with at least 40 GiB of memory” using the NVIDIA DRA driver:
apiVersion: resource.k8s.io/v1
kind: ResourceClaimTemplate
metadata:
name: gpu-40gi
spec:
spec:
devices:
requests:
- name: gpu
exactly:
deviceClassName: gpu.nvidia.com
selectors:
- cel:
expression: device.capacity["gpu.nvidia.com"].memory.compareTo(quantity("40Gi")) >= 0
And a pod that uses it:
apiVersion: v1
kind: Pod
metadata:
name: llm-worker
spec:
resourceClaims:
- name: gpu
resourceClaimTemplateName: gpu-40gi
containers:
- name: app
image: nvidia/cuda:12.4.1-base-ubuntu22.04
command: ["nvidia-smi"]
resources:
claims:
- name: gpu
Run kubectl get resourceslices -o yaml to see the exact attribute and capacity names your driver publishes, because they differ between vendors and driver versions.
A few things DRA gives you that the device plugin cannot:
- Selection by attributes: GPU memory, model, architecture, or anything else the driver publishes.
- Shared claims: several pods can share one claim, which is useful for a sidecar and a main container, or a group of pods on the same device.
- Prioritized lists: “give me an H100, or if none is free, two A100s”. This uses
firstAvailableinstead ofexactlyin the request. - Partitionable devices and consumable capacity: carve up a device, or hand out part of its capacity, in a way the scheduler understands.
One forum thread asks why a DRA “prepare” failure does not show as a normal pod sync error. When debugging DRA, look in three places: the pod events, the ResourceClaim status (kubectl describe resourceclaim), and the logs of the DRA kubelet plugin pod on that node. Most failures show up in the kubelet plugin logs first.
5. Sharing GPUs fairly across a team with Kueue
Once GPUs work, the next problem is people. One forum post describes it well: each researcher should have 4 GPUs reserved, others can borrow them when they are idle, but the owner must be able to get them back.
The Kubernetes scheduler places pods. It does not decide whose job should run first, or hold jobs until there is room. That is the job of Kueue. Kueue admits whole jobs into a queue based on quota, and supports borrowing, preemption and fair sharing.
Here is a setup for the case above. First, describe the GPU type:
apiVersion: kueue.x-k8s.io/v1beta1
kind: ResourceFlavor
metadata:
name: a100
spec:
nodeLabels:
nvidia.com/gpu.product: NVIDIA-A100-SXM4-80GB
Then one ClusterQueue per researcher, all in the same cohort so they can borrow from each other:
apiVersion: kueue.x-k8s.io/v1beta1
kind: ClusterQueue
metadata:
name: cq-alice
spec:
cohort: research
namespaceSelector: {}
preemption:
reclaimWithinCohort: Any
withinClusterQueue: LowerPriority
resourceGroups:
- coveredResources: ["nvidia.com/gpu"]
flavors:
- name: a100
resources:
- name: "nvidia.com/gpu"
nominalQuota: 4
borrowingLimit: 8
Then a LocalQueue in the researcher’s namespace:
apiVersion: kueue.x-k8s.io/v1beta1
kind: LocalQueue
metadata:
name: alice
namespace: team-alice
spec:
clusterQueue: cq-alice
Jobs opt in with a label:
metadata:
labels:
kueue.x-k8s.io/queue-name: alice
What this does: Alice always has 4 GPUs. If Bob’s queue is idle, Alice can borrow up to 8 more. When Bob submits work, reclaimWithinCohort: Any lets Kueue preempt the borrowed jobs so Bob gets his 4 GPUs back. Add WorkloadPriorityClass objects if some jobs should always win within a queue. Check the Kueue docs for your version, as newer releases are moving to a newer API version.
6. Gang scheduling for distributed training and multi-node inference
Distributed training (PyTorch DDP, MPI, the “Kubeflow MPI communication issue” thread) and large multi-node inference have one thing in common: all the pods must start together. If 6 of 8 workers get scheduled and the other 2 wait, those 6 pods hold expensive GPUs and do nothing. Two jobs doing this at once can deadlock a cluster.
This is gang scheduling, and Kubernetes now handles it natively:
- v1.35 added the Workload API and gang scheduling as alpha.
- v1.36 moved the gang scheduling API to beta and added workload-aware preemption as alpha, so a whole group of pods is preempted as one unit instead of being broken apart.
- v1.37 moved the Workload and PodGroup APIs, workload-aware preemption, and shared DRA ResourceClaims for PodGroups to beta. It also added a new alpha CompositePodGroup API for multi-level groups with topology rules, aimed at the shapes that JobSet and LeaderWorkerSet create.
In practice, most teams still use a higher-level API on top:
- JobSet for training jobs with several roles (driver, workers, parameter servers).
- LeaderWorkerSet (LWS) for serving one model across several nodes, for example vLLM with tensor parallelism inside a node and pipeline parallelism across nodes.
- Kueue in front of both, so the whole group is admitted only when there is room for all of it.
For multi-node jobs, also pay attention to topology. Pods that talk over NCCL should land on nodes in the same rack or under the same network switch. Kueue’s topology-aware scheduling and the new CompositePodGroup topology rules are built for this.
7. Serving LLMs: from a Deployment to an inference gateway
Serving a model starts simple. Here is vLLM running an 8B model on one GPU:
apiVersion: apps/v1
kind: Deployment
metadata:
name: vllm-qwen3-8b
spec:
replicas: 2
selector:
matchLabels:
app: vllm-qwen3-8b
template:
metadata:
labels:
app: vllm-qwen3-8b
spec:
containers:
- name: vllm
image: vllm/vllm-openai:latest
args: ["--model", "Qwen/Qwen3-8B", "--port", "8000"]
ports:
- containerPort: 8000
resources:
limits:
nvidia.com/gpu: 1
readinessProbe:
httpGet:
path: /health
port: 8000
initialDelaySeconds: 60
volumeMounts:
- name: shm
mountPath: /dev/shm
volumes:
- name: shm
emptyDir:
medium: Memory
sizeLimit: 8Gi
Pin the image to a specific version in production. A few things to note:
- Startup time is long. Downloading and loading weights can take minutes. Use a generous readiness delay, and cache weights on a PVC or a node-local volume instead of pulling from Hugging Face on every start.
- Shared memory matters. The
/dev/shmvolume avoids errors when vLLM or PyTorch uses shared memory between processes. - CPU-based autoscaling does not work. GPU inference is limited by the GPU, the KV cache and the request queue. Scale on metrics like
vllm:num_requests_waitingusing KEDA or the HPA with custom metrics.
Why a normal load balancer is not enough
A regular Service sends requests round robin. That works for web apps, but LLM requests are very different from each other. One request might be 50 tokens, the next might be 20,000. One replica might already have the right prompt prefix in its KV cache, or the right LoRA adapter loaded. Round robin ignores all of this, so you get long queues on some replicas while others sit idle.
The Gateway API Inference Extension fixes this. It adds an InferencePool resource (stable at inference.networking.k8s.io/v1) and an Endpoint Picker (EPP). The EPP reads live metrics from each model server, such as KV cache usage, queue length and loaded LoRA adapters, and picks the best replica for each request.
apiVersion: inference.networking.k8s.io/v1
kind: InferencePool
metadata:
name: vllm-qwen3-8b
spec:
selector:
matchLabels:
app: vllm-qwen3-8b
targetPorts:
- number: 8000
endpointPickerRef:
name: vllm-qwen3-8b-epp
port:
number: 9002
failureMode: FailOpen
Then route traffic to the pool instead of a Service:
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: llm-route
spec:
parentRefs:
- name: inference-gateway
rules:
- backendRefs:
- group: inference.networking.k8s.io
kind: InferencePool
name: vllm-qwen3-8b
FailOpen means that if the EPP is down, the gateway still sends traffic to some replica instead of failing the request. Several gateways support this today, including Istio, kgateway, agentgateway and GKE Inference Gateway.
If you want to go further, llm-d builds on vLLM and the inference gateway to add KV cache aware routing and disaggregated serving, where the prefill and decode phases run on separate pods that can scale on their own. KServe is another common choice when you want a higher-level model serving API.
8. AI agents: operating Kubernetes and running on Kubernetes
The newest theme on the forum is agents. There are two sides to it.
Agents that operate your cluster
Threads like “Introducing k8s-mcp-server” and the “read-only Kubernetes evidence graph for diagnostics and AI agents” project show people connecting LLM agents to their clusters through MCP servers. The rule here is simple: give the agent the least access it needs, and start read-only.
apiVersion: v1
kind: ServiceAccount
metadata:
name: ai-agent
namespace: ops
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: ai-agent-readonly
rules:
- apiGroups: ["", "apps", "batch"]
resources: ["pods", "pods/log", "events", "services", "deployments", "replicasets", "jobs", "nodes"]
verbs: ["get", "list", "watch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: ai-agent-readonly
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: ai-agent-readonly
subjects:
- kind: ServiceAccount
name: ai-agent
namespace: ops
Notice what is missing: no secrets, no pods/exec, and no write verbs. An agent that reads logs and events can explain a CrashLoopBackOff. It does not need the power to delete a namespace. If you later want it to take action, add specific verbs on specific resources, and keep a human approval step for anything destructive. Turn on audit logging so you can see every call the agent made.
Agents that run on your cluster
Coding agents write and run code that nobody has reviewed. Running that in a normal pod next to your other workloads is risky. The Kubernetes SIG Apps Agent Sandbox project gives each agent a stateful, isolated sandbox with a stable identity, designed to run under stronger isolation such as gVisor or Kata Containers, with warm pools so new sandboxes start fast. Pair it with NetworkPolicies that only allow egress to the model API and the tools the agent needs.
A practical checklist
- Install the GPU Operator and confirm
nvidia-smiworks in a test pod. - Check that every GPU pod sees only its own GPUs (
nvidia-smi -L). - Pick a sharing model: whole GPUs for production, MIG for isolated slices, time slicing or MPS for dev.
- On v1.34 or later, plan your move to DRA. On v1.37, the extended resource support makes this a smooth switch.
- Put Kueue in front of GPU jobs with per-team quotas, a cohort for borrowing, and preemption to reclaim.
- Use JobSet or LeaderWorkerSet for multi-pod jobs, and gang scheduling so groups start together.
- Serve models with vLLM behind the Gateway API Inference Extension, and autoscale on queue depth, not CPU.
- Give AI agents read-only RBAC to start, audit everything, and run agent code in sandboxes.
Wrapping up
The forum tells a clear story. Most people are not stuck on which model to run. They are stuck on GPU plumbing, isolation, scheduling and sharing. The good news is that Kubernetes has moved fast here. DRA is GA, gang scheduling is in beta, inference-aware routing is stable, and agent sandboxing has its own project. The building blocks are ready. The work now is putting them together in the right order.
If you are working through any of these problems, the Kubernetes Discuss forum is a good place to ask, and you can share what you learn with the Kubezilla community.

One thought on “Kubernetes and AI in 2026: A Technical Deep Dive Into What Engineers Are Actually Asking”