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
# 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.
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
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
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 kubeflowUse it in CI/CD
Compile pipelines in CI to catch errors early.
- run: pip install kfp && python pipeline.py # compiles to pipe.yamlBest-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.