The NVIDIA GPU Operator on Kubernetes
How one operator installs and manages drivers, the container runtime, the device plugin and monitoring on every GPU node, automatically.
- Describe the NVIDIA software stack used in an AI environment.
- Describe AI cluster orchestration and job scheduling essentials.
- Explain the purpose and use case of various NVIDIA solutions.
Before a Kubernetes pod can use a GPU, the node needs four things: an NVIDIA driver, a container runtime that can pass the GPU into containers, a device plugin that tells Kubernetes the GPUs exist, and ideally monitoring. Doing that by hand on hundreds of nodes, and keeping versions in step through upgrades, is slow and error-prone. The GPU Operator automates all of it.
01What an "operator" is
In Kubernetes, an operator is a pattern for running complex software: a custom resource definition (CRD) describes the desired state ("these nodes should have driver version X, toolkit Y, monitoring on"), and a controller runs a reconcile loop that keeps the real state matching it. If a node is added, the operator sets it up. If you change a version, it rolls out the change. NVIDIA's operator runs its logic as a state machine, validating each stage before moving on.
02The components it manages
| Component | What it does |
|---|---|
| Node Feature Discovery (NFD) | Labels nodes with their hardware; the operator targets nodes with an NVIDIA PCI device (vendor ID 0x10DE) |
| NVIDIA Container Toolkit | Configures the container runtime (containerd, CRI-O, Docker) so containers can access GPUs |
| Containerised GPU driver | Installs the driver as a container instead of baking it into the OS image; can also use a pre-installed driver |
| Validation | Runs a small CUDA test (vectorAdd in the original release) to prove the stack works |
| Kubernetes device plugin | Registers GPUs with the kubelet so they appear as the extended resource nvidia.com/gpu |
| DCGM exporter | Exposes GPU metrics (utilisation, memory, temperature, power, errors) to Prometheus |
| GPU Feature Discovery | Adds labels such as GPU model and memory so jobs can target specific GPUs |
| MIG manager | Applies Multi-Instance GPU partition layouts on supported GPUs |
03How a pod asks for a GPU
Once the device plugin runs, GPUs are just another resource. A pod requests them in its limits, and the scheduler only places it on a node with enough free GPUs:
apiVersion: v1
kind: Pod
metadata:
name: cuda-test
spec:
containers:
- name: cuda
image: nvcr.io/nvidia/cuda:12.4.1-base-ubuntu22.04
command: ["nvidia-smi"]
resources:
limits:
nvidia.com/gpu: 1 # whole GPUs; extended resources are integers
Two Kubernetes rules worth remembering: extended resources like nvidia.com/gpu are integers and are not overcommitted, so by default a GPU belongs to one container. Sharing a GPU needs MIG, time-slicing or a scheduler such as Run:ai (see MIG).
04Installing it
The operator is installed with a Helm chart from NGC, and component versions are set in the chart's values file. It does not build the Kubernetes cluster for you; it prepares GPU nodes in an existing cluster. A sibling, the Network Operator, does the same job for networking components such as RDMA and InfiniBand drivers.
helm repo add nvidia https://helm.ngc.nvidia.com/nvidia
helm install --wait gpu-operator -n gpu-operator --create-namespace nvidia/gpu-operator
05Why operators love it
- Same image for every node. CPU and GPU nodes can share one OS image; the operator adds GPU software only where needed.
- Upgrades become declarative. Change a version in one place and the operator rolls it out.
- Monitoring by default. DCGM exporter feeds dashboards and alerts out of the box.
✦Key terms: flip the cards
- Know what the GPU Operator installs: driver, container toolkit, device plugin, DCGM exporter, feature discovery, MIG manager.
- Pods request GPUs with nvidia.com/gpu in resource limits.
- It uses the Kubernetes operator pattern and is installed via Helm from NGC.
- The GPU Operator does not create the Kubernetes cluster.
- By default a GPU cannot be shared between containers via the device plugin; sharing needs MIG, time-slicing or another scheduler.
?Quick quiz
1. Which component makes GPUs visible to the Kubernetes scheduler?
Why: The device plugin registers nvidia.com/gpu with the kubelet.
2. What does the GPU Operator primarily automate?
Why: It installs and manages driver, runtime, device plugin and monitoring.
3. How does a pod request one full GPU?
Why: GPUs are requested as an extended resource in limits.
4. Which component provides GPU metrics to Prometheus?
Why: DCGM exporter exposes GPU telemetry for Prometheus.
Score: 0 / 4
The original post is from 2019 and describes the first release. The component list below adds the parts that were introduced since (DCGM exporter, MIG manager and others), so it may be longer than in the post.