Skip to content
GPU infrastructure on Kubernetes · Chapter 1 of 19 Preface

Preface

GPUs are the most expensive components in the data center, and most of the time they end up in a Kubernetes cluster. There, three AI teams are waiting, each with urgent jobs, and a platform team that has to make sure that every card gets used, none twice, and that a failure at night does not cost a whole week of training. If you are that platform team, you need more than nvidia.com/gpu: 1 in the manifest.

This course builds a GPU platform on Kubernetes without a single graphics card. What makes this possible is Mokka from NVIDIA’s test project k8s-test-infra: on an ordinary node, it simulates the driver interface NVML through which all NVIDIA tools talk to the GPU. Everything above it is real software, unchanged, just as on a server with eight A100s: Device Plugin, GPU Feature Discovery, GPU Operator, the DRA driver, Kueue, the DCGM Exporter, Prometheus. You schedule, share and monitor GPUs, make them fail and bring them back, on a kind cluster in a VM.

The honesty rule. What is simulated are the GPUs themselves: model, memory, metrics, failures. Mokka cannot compute. Every day says what is real about the simulation and what is not. Where compute power matters (Day 14), the book shows openly that a model runs on the CPU here, and describes what would be different on real hardware, without a single invented output.

The book is aimed at DevOps and platform engineers and Kubernetes admins who have to run GPU nodes for AI teams. You should be confident with Pods, Deployments, Helm and kubectl. You do not need any knowledge of machine learning, nor any CUDA skills.

Scope. How to run language models as a service with vLLM and a gateway is shown in “LLMs on Kubernetes hands-on”. This course is about the layer below: GPUs as a resource in the cluster.

How the Book Works

  • One day, one topic. Each day has a goal, a time estimate, a short briefing and 3 to 7 drills. You type every command yourself and compare with “Expected”.
  • Failures are part of the program. Too many GPUs requested, quota full, driver gone, Xid errors: every fault is triggered on purpose, and you read it at the spot where it shows up in operations. Where something behaved differently than expected, the book says so as Tried it, including the cause.
  • No helper scripts. Every manifest is written out as a heredoc, every command on its own. Everything runs on the lab VM, kubectl talks to the kind cluster gpu.
  • Speed drills, checkpoint, challenge, interview and enterprise notes close every day. The challenge is a task without instructions, with a hint and a solution.

At the end:

  • Competition (Day 15): the platform with three teams, five faults and a challenge, against the clock.
  • Appendix A is the cheat sheet with commands, failure patterns and the pitfalls from the book. Appendix B is the final exam with ten tasks.

The Days at a Glance

Day Topic Duration
Part A · GPUs in the Cluster
0 The Training Ground: kind, Mokka, eight simulated A100s approx. 60 min
1 How a GPU Gets into the Container approx. 60 min
2 The Device Plugin approx. 60 min
3 Node Feature Discovery and GPU Feature Discovery approx. 60 min
4 Reserving GPU Nodes approx. 60 min
Part B · Sharing and Managing GPUs
5 Sharing GPUs with Time-Slicing approx. 60 min
6 MIG – Cutting a GPU into Real Pieces approx. 75 min
7 The GPU Operator approx. 75 min
8 Dynamic Resource Allocation I approx. 75 min
9 Dynamic Resource Allocation II approx. 75 min
Part C · Teams, Operations, Failures
10 Kueue I – GPU Quotas per Team approx. 75 min
11 Kueue II – Borrowing, Reclaiming, Priorities approx. 75 min
12 GPU Monitoring approx. 90 min
13 GPU Failures approx. 90 min
14 A Model on the Cluster approx. 75 min
15 Competition – the Broken GPU Platform approx. 90 min

Time: Days 0 to 14 add up to just under 18 hours (1065 minutes), the competition and the final exam add an hour and a half and two hours, a good 21 hours in total. With one training day per evening and five evenings per week, you are through in three weeks.

The Training Ground

VM Role In the lab
Lab VM Docker and the kind cluster gpu with three nodes 4 vCPU, 8 GB RAM
Node Role
gpu-control-plane Control plane
gpu-worker CPU node for normal workloads (and the model on Day 14)
gpu-worker2 GPU node with 8 simulated A100s (Mokka)
  • One VM with Ubuntu 24.04, Docker and internet access. 8 GB RAM is enough: with the entire setup including Prometheus and Grafana (from Day 12 on), the lab VM used 3.6 GiB.
  • The images of the GPU software are large: for Day 14, each node pulls an image of 3.4 GB. Plan for at least 30 GB of free disk space.
  • Proxmox, VMware or a cloud VM, it does not matter. The outputs in the book come from amd64.

Versions

Component Version Day
kind / Kubernetes (kindest/node) / Helm v0.33.0 / v1.37.0 / v4.3.2 0
Mokka (nvml-mock) 0.7.0 0
Node Feature Discovery / Device Plugin and GFD (chart nvidia-device-plugin) 0.19.0 / 0.18.2 2, 3
GPU Operator v26.3.3 7
DRA driver (dra-driver-nvidia-gpu) 0.5.1 8
Kueue 0.20.7 10
kube-prometheus-stack 93.9.0 12
Ollama / model 0.40.17 / qwen2.5:0.5b 14

What You Can Do Afterwards

  • Explain how a GPU gets into a container, and check GPU Pods with nvidia-smi.
  • Detect GPU nodes with labels, taints and feature discovery, and reserve them for GPU work.
  • Share GPUs with time-slicing and MIG, and name the limits of both approaches.
  • Control the GPU Operator with a ClusterPolicy instead of maintaining individual parts by hand.
  • Allocate GPUs with Dynamic Resource Allocation: ResourceSlices, DeviceClasses, claims, CEL selectors, prioritized lists, and keep the old nvidia.com/gpu path working on top of it.
  • Enforce quotas per team with Kueue, configure borrowing and reclaiming, assign priorities.
  • Monitor GPUs with DCGM Exporter, Prometheus and Grafana, and write alerts that fire at the right time.
  • Classify GPU failures and work through the sequence from cordon to uncordon cleanly.
  • Run a model as a service on the cluster and calculate its memory requirements.

What Was Tested

All commands and outputs come from real runs on the described training ground, in November 2026, shortened where it makes sense. Pod names, times and metrics will differ for you, the order of magnitude should match. The GPUs are simulated, their values (temperature, utilization, failures) come from Mokka.

Note: This course is an independent practice course. NVIDIA, A100, H100 and CUDA are trademarks of NVIDIA Corporation. Mokka (NVIDIA/k8s-test-infra) is a test double: it simulates the driver interface NVML, not compute power. Kubernetes is a trademark of the Linux Foundation, Kueue and Node Feature Discovery are projects of the Kubernetes SIGs. The book is not affiliated with these organizations and projects and is neither reviewed nor endorsed by them.

The passwords in the book (lab-grafana-123) apply to the lab only.

Enjoy the drills.

Contents

More