Tutorials
Step-by-step tutorials for building and deploying ML pipelines with the KFP Operator
This guide will help you deploy your first ML pipeline using the KFP Operator.
Need the operator installed? Check with your platform team or see the Platform Engineers documentation for installation instructions.
The KFP Operator extends Kubernetes with custom resources for ML pipelines:
Instead of uploading pipelines through UIs, you define them as configuration files:
apiVersion: pipelines.kubeflow.org/v1beta1
kind: Pipeline
metadata:
name: my-training-pipeline
spec:
provider: provider-namespace/provider-name
image: "my-registry/ml-pipeline:v1.0.0"
framework:
name: tfx
parameters:
pipeline: my_pipeline.create_components
First, check that the KFP Operator is running in your cluster:
# Check if the operator is installed
kubectl get pods -n kfp-operator-system
# Verify Custom Resource Definitions are available
kubectl get crd | grep pipelines.kubeflow.org
You should see the operator pods running and several CRDs listed.
Providers connect the operator to ML orchestration platforms:
# List available providers
kubectl get providers
# Example output:
# NAME STATUS TYPE AGE
# kubeflow-provider Ready kfp 5m
If no providers are available, contact your platform team to set one up.
Create a file called my-first-pipeline.yaml:
apiVersion: pipelines.kubeflow.org/v1beta1
kind: Pipeline
metadata:
name: penguin-training
namespace: default
spec:
provider: provider-namespace/provider-name
image: "gcr.io/kfp-operator/penguin-pipeline:latest"
framework:
name: tfx
parameters:
pipeline: penguin_pipeline.create_components
env:
- name: DATA_ROOT
value: "gs://kfp-operator-examples/penguin-data"
- name: MODEL_ROOT
value: "gs://my-bucket/models" # Replace with your bucket
Deploy the pipeline:
kubectl apply -f my-first-pipeline.yaml
Check the pipeline status:
kubectl get pipelines
# NAME STATUS PROVIDER AGE
# penguin-training Ready kubeflow-provider 30s
Create automated pipeline execution with run-configuration.yaml:
apiVersion: pipelines.kubeflow.org/v1beta1
kind: RunConfiguration
metadata:
name: daily-training
namespace: default
spec:
run:
provider: provider-namespace/provider-name
pipeline: penguin-training
parameters:
- name: num_epochs
value: "10"
- name: learning_rate
value: "0.001"
triggers:
schedules:
- cronExpression: "0 2 * * *" # Daily at 2 AM
startTime: "2024-01-01T00:00:00Z"
endTime: "2024-12-31T23:59:59Z"
onChange:
- pipeline
Apply the configuration:
kubectl apply -f run-configuration.yaml
# Verify it's scheduled
kubectl get runconfigurations
You’ve successfully:
When you created the Pipeline resource, the KFP Operator:
When you created the Run Configuration resource, the operator:
If you encounter issues:
kubectl logs -l workflows.argoproj.io/workflow=<workflow-name>kubectl logs -n kfp-operator-system deployment/kfp-operator-controller-managerNext: Training Pipeline Tutorial.
Step-by-step tutorials for building and deploying ML pipelines with the KFP Operator