← All insightsCheat Sheet

Kubeflow cheat sheet: the complete command reference

CodeWizard Engineering · 12 September 2025 · 3 min read · Beginner

This is a complete, hands-on Kubeflow cheat sheet: install, configure, operate, automate and secure it - with copy-paste commands grouped by task. Bookmark it for day-to-day work, incidents and interviews alike.

Kubeflow runs the ML lifecycle on Kubernetes: Pipelines for orchestrating steps, training operators for distributed jobs, and KServe for scalable model serving - reusing your existing cluster and GitOps.

Why you reach for it

  • Runs ML workloads on the Kubernetes you already operate
  • Reusable, versioned pipelines for training/eval
  • Autoscaling model serving with KServe

Installation

bash
# Install Pipelines standalone on an existing cluster
export PIPELINE_VERSION=2.2.0
kubectl apply -k "github.com/kubeflow/pipelines/manifests/kustomize/cluster-scoped-resources?ref=$PIPELINE_VERSION"

Configuration reference

A minimal pipeline with the KFP SDK.

python
from kfp import dsl

@dsl.component
def train(lr: float) -> float:
    return 0.94

@dsl.pipeline(name='train-pipeline')
def pipe(lr: float = 0.01):
    train(lr=lr)

Core commands you use daily

bash
kubectl -n kubeflow port-forward svc/ml-pipeline-ui 8080:80
# compile and submit
python -c "from kfp import compiler,dsl; compiler.Compiler().compile(pipe,'pipe.yaml')"

Pipelines & access

bash
kubectl -n kubeflow port-forward svc/ml-pipeline-ui 8080:80
python -c "from kfp import compiler; from pipeline import pipe; compiler.Compiler().compile(pipe,'pipe.yaml')"
kubectl get pods -n kubeflow

Use it in CI/CD

Compile pipelines in CI to catch errors early.

yaml
- run: pip install kfp && python pipeline.py  # compiles to pipe.yaml

Best-practice checklist

  • Start with Pipelines + KServe rather than the whole platform
  • Use GPU node pools with quotas and taints
  • Enable step caching and version pipeline artifacts

Common pitfalls to avoid

  • Underestimating the operational weight of full Kubeflow
  • No GPU scheduling/quotas, causing noisy-neighbor issues
  • Pipelines with no caching, re-running expensive steps

Security quick wins

  • Isolate teams with namespaces and RBAC
  • Secure the dashboard behind SSO

Works well with

  • MLflow - Open-source MLOps for experiment tracking, model registry and reproducible ML deployment.
  • Kubernetes - Declarative orchestration for containers at scale - self-healing, rolling updates and service discovery.
  • Argo Workflows - Kubernetes-native workflow engine for CI, batch and ML pipelines defined as DAGs.
A cheat sheet is muscle memory on paper - keep it close until the commands live in your fingers.

Want senior help putting Kubeflow to work - or a team bootcamp on it? CodeWizard runs Israel's largest DevOps community and embeds named senior engineers with a transparent hours log. Book a free consult or explore the Academy.

Like where this is going?

Get hands-on help from the engineers who write these posts.

Book a free consult