ChaosWorkflow
ChaosWorkflow chains multiple experiments into a directed acyclic graph (DAG). Templates execute in dependency order, with independent templates running in parallel.
Group: chaos.chaosplane.io/v1alpha1
Kind: ChaosWorkflow
Scope: Namespaced
Example
apiVersion: chaos.chaosplane.io/v1alpha1
kind: ChaosWorkflow
metadata:
name: resilience-suite
namespace: production
spec:
templates:
- name: kill-pods
type: experiment
experimentRef:
name: pod-kill-experiment
namespace: production
- name: wait
type: delay
delay:
duration: 30s
dependencies: [kill-pods]
- name: network-test
type: experiment
experimentRef:
name: network-delay-experiment
namespace: production
dependencies: [wait]
parameters:
- name: target-namespace
default: production
errorHandling:
strategy: abort
execution:
maxParallelism: 3
Spec fields
spec.templates
List of WorkflowTemplate. Each template is a node in the DAG.
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Unique template name within the workflow |
type | TemplateType | Yes | experiment, delay, condition, parallel, or suspend |
experimentRef | ExperimentRef | No | Reference to a ChaosExperiment (for experiment type) |
delay | DelaySpec | No | Delay configuration (for delay type) |
condition | ConditionSpec | No | Condition configuration (for condition type) |
parallel | ParallelSpec | No | Parallel configuration (for parallel type) |
suspend | SuspendSpec | No | Suspend configuration (for suspend type) |
dependencies | []string | No | Names of templates that must complete before this one starts |
Template types
experiment
Runs a ChaosExperiment resource.
- name: my-experiment
type: experiment
experimentRef:
name: pod-kill-test
namespace: production # optional, defaults to workflow namespace
delay
Waits for a fixed duration before proceeding.
- name: recovery-wait
type: delay
delay:
duration: 2m
dependencies: [my-experiment]
condition
Evaluates an expression and branches to different templates.
- name: check-result
type: condition
condition:
expression: "templates.my-experiment.phase == 'Completed'"
ifTrue: success-path
ifFalse: failure-path
dependencies: [my-experiment]
| Field | Type | Description |
|---|---|---|
expression | string | Boolean expression to evaluate |
ifTrue | string | Template name to execute if true |
ifFalse | string | Template name to execute if false |
parallel
Runs a group of templates concurrently.
- name: parallel-chaos
type: parallel
parallel:
templates: [cpu-stress, memory-stress, network-delay]
| Field | Type | Description |
|---|---|---|
templates | []string | Names of templates to run in parallel |
suspend
Pauses the workflow until manually resumed (or timeout elapses).
- name: approval-gate
type: suspend
suspend:
timeout: 1h # optional: auto-resume after this duration
dependencies: [pre-check]
| Field | Type | Description |
|---|---|---|
timeout | Duration | Optional auto-resume timeout |
spec.parameters
Workflow-level parameters with optional defaults.
| Field | Type | Description |
|---|---|---|
name | string | Parameter name |
default | string | Default value |
value | string | Override value |
spec.errorHandling
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
strategy | ErrorHandlingStrategy | No | abort | abort, continue, retry, or rollback |
| Strategy | Behavior |
|---|---|
abort | Stop immediately on any template failure |
continue | Keep running remaining templates |
retry | Retry the failed template |
rollback | Abort and roll back completed experiments |
spec.execution
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
maxParallelism | int32 | No | unlimited | Max concurrent template executions |
Status fields
| Field | Type | Description |
|---|---|---|
phase | WorkflowPhase | Current workflow phase |
startTime | Time | When the workflow started |
endTime | Time | When the workflow ended |
templateStatuses | []TemplateStatus | Per-template status |
progress | string | Human-readable progress (e.g. 3/5) |
conditions | []Condition | Standard Kubernetes conditions |
observedGeneration | int64 | Last reconciled generation |
TemplateStatus
| Field | Type | Description |
|---|---|---|
name | string | Template name |
phase | WorkflowPhase | Template execution phase |
startTime | Time | When this template started |
endTime | Time | When this template ended |
message | string | Status message |
Phases
| Phase | Description |
|---|---|
Pending | Created, not yet started |
Running | At least one template is executing |
Paused | Suspended at a suspend template |
Completed | All templates finished successfully |
Failed | One or more templates failed |
Aborted | Manually aborted |
Printer columns
NAME PHASE PROGRESS AGE
resilience-suite Running 2/5 3m