⚙️
Domain 3 · AI Operations · 22% of the exam

Kubernetes for AI clusters

The control plane, pods and deployments, how GPUs become schedulable resources, and why Kubernetes is the natural home for inference.

Lesson 25 of 29~14 min read4 quiz questions5 key terms
Exam objectives this lesson covers
  • Describe AI cluster orchestration and job scheduling essentials.
  • Identify the key considerations for virtualizing accelerated infrastructure.

Kubernetes is the open-source container orchestrator, hosted by the CNCF. You describe the desired state ("run three replicas of this inference service, each with one GPU") and Kubernetes keeps reality matching it: placing containers, restarting failures, scaling, routing traffic.

Control planekube-apiserverfront door / APIetcdcluster state storekube-schedulerplaces pods on nodescontroller-managerdesired → actual stateGPU node 1kubeletruntimedev pluginpodpodpodpodGPU node 2kubeletruntimedev pluginpodpodpodpod
Fig 1. The control plane decides; nodes run pods. On GPU nodes, a device plugin advertises GPUs so the scheduler can place GPU pods correctly.

01The components

ComponentRole
kube-apiserverThe front door; every action goes through its API
etcdConsistent key-value store holding all cluster state
kube-schedulerChooses a node for each new pod based on requested resources and constraints
kube-controller-managerRuns control loops that move actual state toward desired state
kubelet (each node)Makes sure the pod’s containers are running and healthy
kube-proxy (each node)Maintains network rules for Services
Container runtimeRuns containers (containerd, CRI-O)

02Objects you will hear about

03GPUs in Kubernetes

Kubernetes knows nothing about GPUs by itself. A device plugin registers them with the kubelet as an extended resource (nvidia.com/gpu). Pods request them in resources.limits. Extended resources are whole integers and cannot be overcommitted or shared between containers, so to share GPUs you use MIG slices (exposed as separate resources), time-slicing, or a GPU-aware scheduler such as Run:ai. The GPU Operator installs the device plugin, driver, toolkit and DCGM Exporter for you; GPU Feature Discovery labels nodes by GPU model so pods can target them.

apiVersion: apps/v1
kind: Deployment
metadata: { name: llm-api }
spec:
  replicas: 3
  selector: { matchLabels: { app: llm-api } }
  template:
    metadata: { labels: { app: llm-api } }
    spec:
      containers:
      - name: nim
        image: nvcr.io/nim/meta/llama-3.1-8b-instruct:latest
        resources:
          limits: { nvidia.com/gpu: 1 }

04Kubernetes vs Slurm

Kubernetes shines at always-on services: autoscaling, self-healing, rolling updates. That makes it the usual platform for inference. Its default scheduler places pods one by one and does not natively do gang scheduling (start all pieces of a multi-node job together), so large distributed training often runs on Slurm, or on Kubernetes with an add-on scheduler such as Run:ai. See Job scheduling for the comparison table.

A smart-city traffic system. Cars (containers) come and go constantly; the system opens extra lanes when traffic builds (autoscaling), clears breakdowns automatically (self-healing) and spreads cars across roads (load balancing). The goal is that traffic always flows.

✦Key terms: flip the cards

What the exam looks for
  • Control plane: apiserver, etcd, scheduler, controller-manager; node: kubelet, kube-proxy, runtime.
  • GPUs via device plugin and GPU Operator; request nvidia.com/gpu in limits.
  • Kubernetes suits inference services (autoscaling, self-healing); large training often uses Slurm or gang-aware schedulers.
Common traps
  • The default Kubernetes scheduler does not do gang scheduling.
  • Requesting a GPU in requests only is not how extended resources work; use limits.

?Quick quiz

1. Which component stores all Kubernetes cluster state?

Why: etcd is the cluster’s key-value store.

2. Which object best fits an always-on, replicated inference API?

Why: Deployments manage replicated, stateless services.

3. How does Kubernetes learn a node has GPUs?

Why: The NVIDIA device plugin advertises GPUs.

4. Why is Kubernetes a strong fit for inference?

Why: Service-oriented features suit always-on inference.

Score: 0 / 4

Original readingKubernetes Documentation ↗

This lesson explains the reading in plain language and adds the exam context around it. Read the original too: it is short, and seeing the vendor wording helps on exam day.

All lessons →
↑