Filters
How to search
  • Plain words find names, texts and examples.
  • "two words" finds the exact phrase.
  • --name or -x finds an option.
  • #word looks only inside commands.
  • @grep finds lessons and labs that use grep.
  • Filters: cat:network · in:labs · in:notes · level:rhcsa · ch:8 · root:yes. Put ! before a word to leave it out. OR between words means one of them.
  • ↑ ↓ to move · Enter to open · Esc to close · / to search

Chapter 7Name in the course: ML platforms on Kubernetes

Run AI workloads on Kubernetes

The skills of the whole path come together here: Kubernetes (CKA), security (CKS), GitOps (GitOps) — now for GPU training jobs, notebooks, pipelines and model servers. This is the daily work of an AI infrastructure engineer.

  • 5 Lessons
  • 3 Commands

$ run as a normal user# run as root (or with sudo)

7.1

Give pods GPUs

The NVIDIA device plugin (or the GPU Operator) makes GPUs a schedulable resource: nvidia.com/gpu.

helm install gpu-operator nvidia/gpu-operator -n gpu-operator --create-namespace
kubectl describe node gpu1 | grep nvidia.com/gpu
gpu-job.yaml
apiVersion: batch/v1
kind: Job
metadata: { name: train-gpu, namespace: ml }
spec:
  template:
    spec:
      restartPolicy: Never
      tolerations: [{ key: nvidia.com/gpu, operator: Exists, effect: NoSchedule }]
      containers:
        - name: train
          image: ghcr.io/s0sta/train:1.2
          resources:
            limits: { nvidia.com/gpu: 1, memory: 16Gi }

At work

Taint GPU nodes so only GPU jobs land there — GPUs are expensive to leave idle or to fill with web pods.

7.2

Know Kubeflow

Kubeflow is a set of ML tools on Kubernetes.

PartJob
NotebooksJupyter servers per user, with GPUs
PipelinesTraining pipelines as containers
KatibHyperparameter tuning
Training OperatorDistributed training (PyTorch, TensorFlow)
KServeModel serving

7.3

Share the cluster fairly

Many teams, few GPUs: use namespaces, quotas and queues.

  • One namespace per team with a ResourceQuota on requests.nvidia.com/gpu.
  • Priority classes: production inference above training above experiments.
  • Batch queues (Kueue) start jobs when GPUs are free.
gpu-quota.yaml
apiVersion: v1
kind: ResourceQuota
metadata: { name: gpu, namespace: team-a }
spec:
  hard:
    requests.nvidia.com/gpu: "2"

7.4

Secure the ML platform

The same controls as any platform, plus data protection.

  • Pod Security restricted for notebooks and jobs where possible; no privileged GPU pods for users.
  • NetworkPolicies: training jobs reach only the data store and the registry.
  • Workload identity (no keys in notebooks) to read data from cloud storage.
  • Signed images and models; scan large base images (CUDA images have many packages).
  • Audit who downloaded which model and dataset.

7.5

Plan your first MLOps project

The year-2 portfolio project (see the path).

  1. A small model trained by a nightly pipeline, tracked in MLflow.
  2. A FastAPI model server image, scanned and signed in CI.
  3. Deployed on the home cluster with Argo CD; canary for new versions.
  4. Prometheus metrics, a Grafana dashboard and a drift report.

All commands in this chapter