Training a model on one GPU is a Python script. Training it on four nodes with eight GPUs each is a different job: you need pods that start together, know their rank and the address of rank 0, share the right environment variables, and fail or finish as a group. Writing that as raw Kubernetes Jobs, or learning a separate custom resource for each framework, is where teams lose weeks. Kubeflow Trainer is the part of Kubeflow that turns this into one object. You submit a TrainJob that names a runtime and says how many nodes you want; the controller builds the pods. The CNCF Landscape lists Kubeflow as a Graduated project and lists “Kubeflow Training Operator” under Training › Distributed Training in its AI Native group.
CNCF daily · Sprint 6, post 15 of 26 · Training (Distributed Training) · CNCF Graduated (Kubeflow)
At a glance
| Category | Orchestration & Management › Scheduling & Orchestration (Kubeflow); also Training › Distributed Training in the AI Native group |
| CNCF status | Kubeflow is Graduated. The Landscape records acceptance on 2023-07-25 as incubating and graduation on 2026-07-24; CNCF announced it on 17 August 2026 |
| Component | Kubeflow Trainer, a subproject; the older Training Operator v1 is its predecessor |
| API | TrainJob, TrainingRuntime and ClusterTrainingRuntime in the trainer.kubeflow.org group (served as v1alpha1 in the docs I read) |
| Built on | Kubernetes JobSet, which the Trainer install also deploys |
| Runtimes | PyTorch, JAX, XGBoost, MPI and Flux (HPC) per the project’s docs and the v2.2 release post |
| Version seen | The docs “latest” page shows v2.4.0; Trainer v2.2 was announced on 20 March 2026 |
| Requirements | Kubernetes 1.31 or newer and kubectl 1.31 or newer, per the install guide |
| Python SDK | pip install kubeflow, with TrainerClient and CustomTrainer |
| Runs as | Controller in kubeflow-system, plus the JobSet controller |
The problem Kubeflow Trainer solves
| Question | Hand-built Jobs and scripts | Kubeflow Trainer |
|---|---|---|
| Starting N pods that act as one job | You write the headless service, ranks and env vars | The runtime sets them |
| A new framework | A new custom resource and a new YAML style | The same TrainJob, a different runtime name |
| Platform and data-science split | Both edit the same large manifest | The platform team owns runtimes; scientists set nodes and code |
| Queueing and quotas | Pods sit Pending and fight each other | Works with Kueue for admission |
| Running from a notebook | Convert code into YAML by hand | The Python SDK submits a function |
| Failure handling | Check each pod | One object with one status, and a deadline field in newer versions |
Key concepts
| Term | Meaning |
|---|---|
| TrainJob | One training run: which runtime, how many nodes, the image or script, resources |
| ClusterTrainingRuntime | A cluster-wide template for a framework (for example torch-distributed), owned by the platform team |
| TrainingRuntime | The same, but namespaced |
| JobSet | The Kubernetes API that runs a group of related Jobs; Trainer expands a TrainJob into one |
| Trainer step | The part of the TrainJob you set: nodes, processes per node, command, resources |
| Python SDK | TrainerClient runs a Python function as a distributed job without YAML |
| Kueue | Optional job queueing and quota; the Kueue docs say Trainer v2.0.0 is the minimum version |
| Training Operator v1 | The older framework-specific CRDs such as PyTorchJob, replaced by TrainJob in v2 |
Architecture
Blue is the user and storage, grey is scheduling and pods and teal is the Trainer API and model source. Open the zoomable diagram, or download it as SVG or PNG.
| Component | Responsibility |
|---|---|
| Data scientist | Submits a TrainJob with kubectl or the Python SDK. |
| TrainJob | The request: runtime name, nodes, code and resources. |
| ClusterTrainingRuntime | The platform team’s template: image, framework setup and defaults. |
| Kueue (optional) | Holds the job until quota is available. |
| Trainer controller | Watches TrainJobs and builds the JobSet from the runtime. |
| JobSet | Creates and tracks the group of training pods. |
| Training pods | Run the training code on GPU nodes. |
| MatrixHub | Supplies base model weights from inside the cluster. See the MatrixHub brief. |
| Checkpoints | Saved to S3 so a run can resume and the model can be served. |
From TrainJob to a saved model
- Create. The TrainJob names a runtime and four nodes.
- Expand. The controller reads the runtime template.
- Start. It creates a JobSet with one pod per node.
- Report. The pods train with ranks and environment already set; the TrainJob status shows complete or failed.
- Save. The training code writes a checkpoint to S3 for serving.
Open the zoomable flow diagram, or download it as SVG or PNG.
Real world: retraining the demand-forecast model
The ERP’s demand-forecast model is retrained on the last quarter of sales data. On one GPU it takes a day, which is too long. The data scientist wants four nodes. Without Trainer she would copy a long manifest from a colleague, edit the replica counts, and debug why rank 2 cannot find rank 0. With Trainer, the platform team has already published a torch-distributed ClusterTrainingRuntime. She submits a TrainJob that says “this runtime, four nodes, this script”, or calls TrainerClient().train(...) from a notebook. The controller creates the pods with ranks and addresses set, the job runs, and the status shows when it is done. The base weights come from MatrixHub, and the checkpoint lands in S3 for the serving step.
Install Kubeflow Trainer
These steps follow the official installation guide. I did not run them for this post.
Requirements: Kubernetes 1.31 or newer and kubectl 1.31 or newer. You can skip installation if the full Kubeflow platform is already deployed, because it includes Trainer.
With Helm
export VERSION=v2.4.0 # the version the docs "latest" page showed; pick a release you have checked
helm install kubeflow-trainer oci://ghcr.io/kubeflow/charts/kubeflow-trainer \
--namespace kubeflow-system --create-namespace \
--version ${VERSION#v} \
--set runtimes.defaultEnabled=true # also installs the built-in runtimes
The chart installs the TrainJob, TrainingRuntime and ClusterTrainingRuntime CRDs by default; add --set crds.enabled=false if you manage CRDs yourself. You can enable one runtime instead of all, for example --set runtimes.torchDistributed.enabled=true.
With kubectl and Kustomize
kubectl apply --server-side -k "https://github.com/kubeflow/trainer.git/manifests/overlays/manager?ref=${VERSION}"
kubectl apply --server-side -k "https://github.com/kubeflow/trainer.git/manifests/overlays/runtimes?ref=${VERSION}"
Check it
kubectl get pods -n kubeflow-system # expect jobset-controller-manager and kubeflow-trainer-controller-manager Running
kubectl api-resources --api-group=trainer.kubeflow.org
kubectl get clustertrainingruntime
For the Python SDK: pip install kubeflow.
Try it
A TrainJob has this shape in the project’s docs. The exact fields can differ by version, so check the CRD in your cluster with kubectl explain trainjob.spec.
apiVersion: trainer.kubeflow.org/v1alpha1
kind: TrainJob
metadata:
name: forecast-retrain
namespace: ml-team
spec:
runtimeRef:
apiGroup: trainer.kubeflow.org
kind: ClusterTrainingRuntime
name: torch-distributed
trainer:
numNodes: 4
# image, command and per-node GPU resources go here; confirm the field names for your version
kubectl apply -f trainjob.yaml
kubectl get trainjob -n ml-team
kubectl get pods -n ml-team -l jobset.sigs.k8s.io/jobset-name=forecast-retrain # label name is an assumption; list pods if it differs
From Python, the v2.2 release post shows this pattern (there with the JAX runtime):
from kubeflow.trainer import TrainerClient, CustomTrainer
def train():
... # your training function; the runtime sets the rank and address variables
client = TrainerClient()
job_id = client.train(runtime="torch-distributed", trainer=CustomTrainer(func=train))
client.wait_for_job_status(job_id)
print("\n".join(client.get_job_logs(name=job_id)))
The post’s own example used runtime="jax-distributed"; the runtime name here is the one from the docs’ YAML example. Run kubectl get clustertrainingruntime to see the names in your cluster.
Production reference design
- Platform team owns runtimes. Publish a small set of ClusterTrainingRuntimes (PyTorch, and others you need) with the right images, and let data scientists reference them by name.
- Dedicated GPU node pool. Taint it, and schedule training there only. Decide whether it uses spot nodes (cheap, but a training run can be interrupted) or on-demand nodes; checkpointing makes spot viable.
- Queue with Kueue. Put quotas per team, so one job cannot take the whole pool. The Kueue docs describe running TrainJobs with it.
- Checkpoint often to S3. Save to object storage, so a lost node does not lose the run.
- Pull models from inside. Read base weights from MatrixHub instead of the internet.
- Set a deadline. Use the
activeDeadlineSecondsfield that the v2.2 release added, so a stuck run does not hold GPUs forever. - Watch progress. Enable the TrainJob progress and metrics feature if you use a supported library; the release post says it needs the
TrainJobStatusfeature flag. - Pin versions. Pin the Trainer chart, runtime images and the SDK together, and read release notes, because v2.2 contained a breaking API change (RuntimePatches).
- Isolate teams. One namespace per team, with ResourceQuota and network policy.
- Monitor GPU use. Idle GPUs are the main cost; track utilisation per job.
Security
- Training code is arbitrary code. Run it in a team namespace with limited RBAC, and with no access to production credentials.
- Who can create runtimes. A ClusterTrainingRuntime sets images and privileges for every job that uses it; restrict who may edit it.
- Images. Use pinned, scanned images from your own registry.
- Data access. Give training pods read-only access to the training data and write access only to their own checkpoint prefix.
- Network. Allow pod-to-pod traffic inside a job; deny it to other namespaces.
- Secrets. Keep API keys and storage credentials in Secrets mounted per job, and do not bake them into images.
- Untrusted models. Treat downloaded weights and pickled files as untrusted; prefer safe formats.
Troubleshooting
This table is based on the Trainer documentation and the Kueue docs. I did not run Trainer for this post, so test each entry on your own cluster.
| Symptom | Likely cause | How to check | Fix |
|---|---|---|---|
no matches for kind TrainJob |
CRDs are missing | kubectl api-resources --api-group=trainer.kubeflow.org |
Install the chart with CRDs on, or apply the manager overlay |
| TrainJob references a runtime that does not exist | Runtimes were not installed | kubectl get clustertrainingruntime; kubectl get trainingruntime -n <ns> |
Install the runtimes overlay, or enable them in the chart |
| Controller or JobSet pod not running | Wrong namespace, Kubernetes older than 1.31, or image pull problem | kubectl get pods -n kubeflow-system; kubectl describe pod |
Check version requirements and registry access |
| Pods stay Pending | No GPU capacity, taints without tolerations, or Kueue has not admitted the job | kubectl describe pod; check the queue |
Add nodes, set tolerations, or fix the quota |
| Job waits and never starts with Kueue | Version or label mismatch | Kueue docs: Trainer v2.0.0 is the minimum | Upgrade Trainer and check the queue label on the TrainJob |
| Ranks cannot reach rank 0 | Network policy blocks pod-to-pod traffic | Pod logs and policies | Allow traffic inside the job’s namespace |
| Run is slower than expected | Network or data loading is the bottleneck | GPU utilisation and logs | Co-locate nodes, cache data, check the interconnect |
Old PyTorchJob manifests fail |
They belong to Training Operator v1 | Check the CRD group in the manifest | Follow the migration guide to TrainJob |
| Upgrade breaks a TrainJob | An API change between versions (v2.2 replaced PodTemplateOverrides) | Release notes | Read release notes and test on a non-production cluster first |
| Helm upgrade removes runtimes | Runtimes disabled in values | helm get values |
Re-enable them, as the docs describe |
Usage cases
- Distributed training. PyTorch, JAX and other frameworks across several nodes.
- LLM fine-tuning. The docs and the Kubeflow project describe fine-tuning workloads on the same API.
- HPC and MPI jobs. MPI and Flux runtimes for simulation-style workloads.
- Notebook-to-cluster. A data scientist scales a function from a notebook through the SDK.
- In the Sprint 6 project. The ERP’s demand-forecast model is retrained on a GPU pool, with weights from MatrixHub and checkpoints in S3. The Unsloth post that follows covers fine-tuning, and Kubeflow Pipelines later chains the steps.
Operational considerations
- v1 to v2 is a migration.
PyTorchJoband similar types are replaced byTrainJob; follow the migration guide. - API maturity. The docs use
v1alpha1for the TrainJob API, so expect changes; pin and test upgrades. - GPU cost. Queue, quota and deadlines matter more than any tuning flag.
- Spot nodes. Cheap but interruptible; only worth it with frequent checkpoints.
- Runtime sprawl. Keep the runtime list short and versioned.
- Part of a larger project. Trainer ships on its own, but is also included in the full Kubeflow platform; avoid installing it twice.
Adoption
Kubeflow graduated from the CNCF in 2026; the CNCF announcement reports more than 6,600 contributors from over 1,000 organisations. Kubeflow Trainer is documented as a supported backend by the NVIDIA NeMo Run Kubeflow executor and by Red Hat OpenShift AI’s distributed workloads docs, and the Kueue project documents running TrainJobs. These are integrations, not a list of production users, and I did not verify named production users for Trainer itself.
Alternatives
| Solution | Model | Best suited to |
|---|---|---|
| Training Operator v1 | Framework-specific CRDs such as PyTorchJob | Existing setups that have not migrated; it is the predecessor of Trainer |
| Volcano | Batch scheduler with gang scheduling | Teams that want a batch scheduler under their own job definitions |
| Ray (KubeRay) and Ray Train | Distributed Python runtime on Kubernetes | Teams that already use Ray for data and training |
| Argo Workflows with GPU pods | General workflow engine | Pipelines where training is one step among many |
| Plain Kubernetes Jobs with JobSet | Lower-level building blocks | Teams that want to write the runtime layer themselves |
| Managed training services | A cloud provider’s training product | Teams that prefer a managed service over running the cluster |
Strengths and limitations
| Strengths | Limitations |
|---|---|
| One API for many frameworks | The API is still v1alpha1 in the docs, so it can change |
| Platform teams own runtimes, scientists own code | Migration from v1 manifests is required |
| Works with Kueue for quota and queueing | Needs Kubernetes 1.31 or newer |
| Python SDK for notebook users | Does not manage data, checkpoints or GPU cost for you |
| Part of a CNCF Graduated project | Fast-moving; pin versions and read release notes |
| Runtimes for PyTorch, JAX, XGBoost, MPI and Flux | Networking and interconnect tuning remain your job |
Recommendation
Adopt for distributed training on Kubernetes. Install it with Helm in a non-production cluster, publish one ClusterTrainingRuntime for your main framework, and run a small multi-node job end to end, including a checkpoint to S3. Put Kueue in front of the GPU pool, set deadlines, and pin the chart and runtime images. If you have a few single-GPU jobs only, plain Jobs are enough. If your team is committed to Ray for everything, evaluate that route first instead of running two systems.
References: Kubeflow Trainer installation guide · Migrating to Kubeflow Trainer v2 · Trainer runtime guide · Introducing Kubeflow Trainer v2 · Kubeflow Trainer v2.2 release · Kueue: run a TrainJob · Kubeflow graduation announcement · Kubeflow graduation blog · Kubeflow joins CNCF (2023) · Kubeflow Trainer repository · CNCF Landscape: Kubeflow

