Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/chaos-mesh/chaos-mesh/llms.txt

Use this file to discover all available pages before exploring further.

Workflow allows you to orchestrate multiple chaos experiments and tasks in a directed acyclic graph (DAG) with serial or parallel execution.

API Version and Kind

apiVersion: chaos-mesh.org/v1alpha1
kind: Workflow

Metadata

Standard Kubernetes object metadata.
metadata.name
string
required
Name of the Workflow resource.
metadata.namespace
string
Namespace of the Workflow resource. Defaults to default.

Spec Fields

spec
WorkflowSpec
required
Defines the behavior of the workflow.

WorkflowSpec

entry
string
required
Name of the entry template to start the workflow.
entry: "entry-template"
templates
[]Template
required
List of templates that define the workflow steps.

Template

name
string
required
Name of the template. Must be unique within the workflow.
templateType
TemplateType
required
Type of the template.Common values include:
  • Chaos types: PodChaos, NetworkChaos, StressChaos, IOChaos, TimeChaos, KernelChaos, HTTPChaos, DNSChaos, JVMChaos, AWSChaos, GCPChaos, AzureChaos, etc.
  • Orchestration: Serial, Parallel
  • Other: Task, Schedule, StatusCheck
deadline
*string
Deadline for the template execution.
deadline: "5m"
children
[]string
List of child template names. Only used when type is Serial or Parallel.
children:
  - "step-1"
  - "step-2"
task
*Task
Task definition. Only used when type is Task.
conditionalBranches
[]ConditionalBranch
Conditional branches for custom tasks. Only used when type is Task.
schedule
*ChaosOnlyScheduleSpec
Schedule configuration. Only used when type is Schedule.
statusCheck
*StatusCheckSpec
Status check configuration. Only used when type is StatusCheck.See StatusCheck API for details.
abortWithStatusCheck
bool
default:"false"
Whether to abort the workflow when the failure threshold of StatusCheck is exceeded. Only used when type is StatusCheck.
EmbedChaos
*EmbedChaos
Embedded chaos specification. Only used when type is a chaos type.Contains the spec for the specific chaos type (inline).

Status Fields

status
WorkflowStatus
Most recently observed status of the workflow.

WorkflowStatus

entryNode
*string
Name of the entry node.
startTime
*metav1.Time
Time when the workflow started.
endTime
*metav1.Time
Time when the workflow ended.
conditions
[]WorkflowCondition
Latest available observations of the workflow’s current state.

Example

apiVersion: chaos-mesh.org/v1alpha1
kind: Workflow
metadata:
  name: chaos-workflow
  namespace: chaos-mesh
spec:
  entry: entry
  templates:
    - name: entry
      templateType: Serial
      deadline: 30m
      children:
        - pod-chaos
        - network-chaos
    
    - name: pod-chaos
      templateType: PodChaos
      deadline: 5m
      podChaos:
        action: pod-kill
        mode: one
        selector:
          namespaces:
            - default
          labelSelectors:
            app: nginx
    
    - name: network-chaos
      templateType: NetworkChaos
      deadline: 10m
      networkChaos:
        action: delay
        mode: all
        selector:
          namespaces:
            - default
          labelSelectors:
            app: web
        delay:
          latency: "100ms"
        duration: "5m"