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.

BlockChaos allows you to inject block I/O delays into volumes attached to containers.

API Version and Kind

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

Metadata

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

Spec Fields

spec
BlockChaosSpec
required
Defines the behavior of the block chaos experiment.

BlockChaosSpec

action
BlockChaosAction
required
Specific block chaos action to perform.Enum values:
  • delay - Add delay to block I/O operations
selector
ContainerNodeVolumePathSelector
required
Selector for targeting a volume on a node.Inherits all fields from ContainerSelector (inline), plus:
volumeName
string
required
Name of the volume to inject delay.Part of ContainerNodeVolumePathSelector.
volumeName: "data-volume"
delay
*BlockDelaySpec
Delay distribution configuration. Required when action is delay.
duration
*string
Duration of the chaos action.A duration string with format like "300ms", "1.5h", or "2h45m".Valid time units: ns, us (µs), ms, s, m, h
remoteCluster
string
Name of the remote cluster where the chaos will be deployed. If not specified, chaos is applied to the local cluster.

Status Fields

status
BlockChaosStatus
Current status of the chaos experiment.

BlockChaosStatus

conditions
[]ChaosCondition
Current global conditions. See ChaosStatus in Common Types.
experiment
ExperimentStatus
Last known experiment state including desired phase and container records.
ids
map[string]int
Always specifies the number of injected chaos actions.

Example

apiVersion: chaos-mesh.org/v1alpha1
kind: BlockChaos
metadata:
  name: block-delay
  namespace: chaos-mesh
spec:
  action: delay
  mode: one
  selector:
    namespaces:
      - default
    labelSelectors:
      app: database
  volumeName: "data"
  delay:
    latency: "100ms"
    correlation: "50"
    jitter: "10ms"
  duration: "5m"