Implementation:SeldonIO Seldon core Seldon Experiment CRD
| Field | Value |
|---|---|
| Type | Pattern Doc |
| Overview | Concrete pattern for declaring Seldon Core 2 Experiment resources as Kubernetes YAML manifests. |
| Domains | MLOps, Experimentation |
| Related Principle | SeldonIO_Seldon_core_Experiment_Configuration |
| Source | samples/experiments/ab-default-model.yaml:L1-11, samples/experiments/sklearn-mirror.yaml:L1-13
|
| Knowledge Sources | Repo, Doc |
| Last Updated | 2026-02-13 00:00 GMT |
Description
This implementation provides the concrete YAML patterns for declaring Seldon Core 2 Experiment resources. An Experiment CRD defines the traffic routing rules for A/B tests, canary deployments, and traffic mirroring. The Experiment resource is applied to the Kubernetes cluster and interpreted by the Seldon scheduler, which updates its routing table accordingly.
Code Reference
A/B Test with Default Model
apiVersion: mlops.seldon.io/v1alpha1
kind: Experiment
metadata:
name: experiment-sample
spec:
default: iris
candidates:
- name: iris
weight: 50
- name: iris2
weight: 50
This experiment splits traffic 50/50 between the iris and iris2 models. The default: iris field means that requests sent to the iris endpoint will be routed according to the experiment weights. The iris endpoint effectively becomes the experiment entry point.
Traffic Mirroring
apiVersion: mlops.seldon.io/v1alpha1
kind: Experiment
metadata:
name: sklearn-mirror
spec:
default: iris
candidates:
- name: iris
weight: 100
mirror:
name: iris2
percent: 100
This experiment serves all traffic from iris (weight 100) while mirroring 100% of requests to iris2. The mirror's responses are not returned to the caller.
I/O Contract
| Direction | Description |
|---|---|
| Inputs | Deployed model or pipeline names and desired traffic split. All referenced models/pipelines must be loaded and available before the experiment is started. |
| Outputs | An Experiment CRD YAML manifest ready to be applied via seldon experiment start or kubectl apply.
|
Key Parameters
| Parameter | Description | Required |
|---|---|---|
spec.default |
The default model/pipeline name whose endpoint will be shared by the experiment. Requests to this name will be routed by the experiment. | Yes |
spec.candidates[].name |
Name of a candidate model/pipeline. Must match a loaded resource. | Yes |
spec.candidates[].weight |
Relative traffic weight for this candidate. Traffic share = weight / sum(all weights). | Yes |
spec.mirror.name |
Name of the model/pipeline to receive mirrored (shadow) traffic. | No (mirror mode only) |
spec.mirror.percent |
Percentage (0-100) of requests to mirror to the shadow target. | No (mirror mode only) |
spec.resourceType |
Set to "pipeline" for pipeline-level experiments. Defaults to model. |
No |
Usage Examples
Weighted A/B Test (80/20 Split)
apiVersion: mlops.seldon.io/v1alpha1
kind: Experiment
metadata:
name: canary-rollout
spec:
default: my-model-v1
candidates:
- name: my-model-v1
weight: 80
- name: my-model-v2
weight: 20
Three-Way A/B Test
apiVersion: mlops.seldon.io/v1alpha1
kind: Experiment
metadata:
name: three-way-test
spec:
default: model-a
candidates:
- name: model-a
weight: 34
- name: model-b
weight: 33
- name: model-c
weight: 33
Partial Traffic Mirroring
apiVersion: mlops.seldon.io/v1alpha1
kind: Experiment
metadata:
name: partial-mirror
spec:
default: production-model
candidates:
- name: production-model
weight: 100
mirror:
name: experimental-model
percent: 50
Pipeline Experiment
apiVersion: mlops.seldon.io/v1alpha1
kind: Experiment
metadata:
name: pipeline-ab-test
spec:
default: pipeline-v1
resourceType: pipeline
candidates:
- name: pipeline-v1
weight: 50
- name: pipeline-v2
weight: 50
External Dependencies
- Kubernetes API (
mlops.seldon.io/v1alpha1) — The Experiment CRD must be registered in the cluster - Seldon scheduler — Interprets the Experiment CRD and updates routing tables
- Deployed candidates — All models/pipelines referenced in
candidatesandmirrormust be loaded
Related Pages
- SeldonIO_Seldon_core_Experiment_Configuration — principle for this implementation — Declarative specification of traffic routing rules for A/B tests and traffic mirroring experiments.
- SeldonIO_Seldon_core_Seldon_Model_Load_For_Experiment — prerequisite — Loading candidate models before defining the experiment.
- SeldonIO_Seldon_core_Seldon_Experiment_Start — next step — Starting the experiment after defining the CRD.
- Environment:SeldonIO_Seldon_core_Kubernetes_Cluster_Environment
- Environment:SeldonIO_Seldon_core_Go_Build_Toolchain_Environment