Chaos Mesh supports 14 different chaos types for comprehensive fault injection across Kubernetes infrastructure and applications.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.
Overview
Each chaos type is implemented as a Kubernetes Custom Resource Definition (CRD) with its own controller and injection mechanisms. CRD Definitions:api/v1alpha1/Controller Implementations:
controllers/chaosimpl/Daemon Implementations:
pkg/chaosdaemon/
Pod-Level Chaos
PodChaos
Inject faults into pod lifecycle operations.PodChaos
CRD:
Actions: pod-kill, pod-failure, container-kill
podchaos_types.goActions: pod-kill, pod-failure, container-kill
- pod-kill
- pod-failure
- container-kill
Kills entire pods by deleting them from Kubernetes.Use Cases:
- Test pod restart and recovery
- Validate StatefulSet resilience
- Test readiness probes
gracePeriod: Seconds before forced deletion (default: 0)
api/v1alpha1/podchaos_types.go:43-54
Network Chaos
NetworkChaos
Inject network-level faults including latency, packet loss, and partitions.NetworkChaos
CRD:
Actions: netem, delay, loss, duplicate, corrupt, partition, bandwidth
networkchaos_types.goActions: netem, delay, loss, duplicate, corrupt, partition, bandwidth
delay - Network Latency
delay - Network Latency
Add latency to network packets.Parameters:Implementation:
latency: Delay duration (e.g., “100ms”)jitter: Variation in delay (e.g., “10ms”)correlation: Correlation percentage (0-100)
pkg/chaosdaemon/tc_server.go, pkg/chaosdaemon/netem/loss - Packet Loss
loss - Packet Loss
Drop network packets randomly.Parameters:
loss: Percentage of packets to drop (0-100)correlation: Correlation percentage
duplicate - Packet Duplication
duplicate - Packet Duplication
Duplicate network packets.Parameters:
duplicate: Percentage of packets to duplicatecorrelation: Correlation percentage
corrupt - Packet Corruption
corrupt - Packet Corruption
Corrupt packet data.Parameters:
corrupt: Percentage of packets to corruptcorrelation: Correlation percentage
partition - Network Partition
partition - Network Partition
Block network traffic between pods.Parameters:
direction: to, from, or bothtarget: Target pod selector
bandwidth - Bandwidth Limitation
bandwidth - Bandwidth Limitation
Limit network bandwidth.Parameters:
rate: Bandwidth limit (e.g., “1mbps”)limit: Queue size in bytesbuffer: Token bucket buffer size
netem - Combined Network Effects
netem - Combined Network Effects
Combine multiple network chaos effects.Parameters: Merge of delay, loss, duplicate, corrupt specsExample:
api/v1alpha1/networkchaos_types.go:48-73
I/O Chaos
IOChaos
Inject file system I/O faults.IOChaos
CRD:
Actions: latency, fault, attrOverride, mistake
iochaos_types.goActions: latency, fault, attrOverride, mistake
latency
Add delay to I/O operations.Parameters:
delay: Duration (e.g., “100ms”)path: File path patternmethods: I/O methods to affectpercent: Percentage of operations (0-100)
fault
Return errors on I/O operations.Parameters:
errno: Error code (e.g., 5 for EIO)path: File path patternmethods: I/O methods to affect
attrOverride
Override file attributes.Parameters:
attr: Attribute overridespath: File path pattern
mistake
Inject incorrect data into I/O.Parameters:
mistake: Mistake specificationpath: File path pattern
pkg/chaosdaemon/iochaos_server.go)
Source: api/v1alpha1/iochaos_types.go:50-51
Stress Chaos
StressChaos
Generate CPU or memory stress on pods.StressChaos
CRD:
Stressors: CPU, Memory
stresschaos_types.goStressors: CPU, Memory
- CPU Stress
- Memory Stress
Stress CPU cores.Parameters:Source:
workers: Number of CPU workersload: Load percentage per worker (0-100)options: Additional stress-ng options
api/v1alpha1/stresschaos_types.go:183-196pkg/chaosdaemon/stress_server_linux.go)
Time Chaos
TimeChaos
Simulate clock skew by offsetting system time.TimeChaos
CRD:
Mechanism: vDSO clock interception
timechaos_types.goMechanism: vDSO clock interception
timeOffset: Offset duration (e.g., “-1h”, “30m”, “5s”)clockIds: Clock IDs to affect (CLOCK_REALTIME, CLOCK_MONOTONIC, etc.)
- Test time-sensitive logic
- Validate timeout handling
- Test distributed system clock drift
- Certificate expiration testing
pkg/chaosdaemon/time_server_linux.go)
Source: api/v1alpha1/timechaos_types.go:48-56
HTTP Chaos
HTTPChaos
Manipulate HTTP requests and responses.HTTPChaos
CRD:
Target: Request or Response
httpchaos_types.goTarget: Request or Response
- Abort: Return error responses
- Delay: Add latency
- Replace: Modify request/response body
- Patch: Modify headers
port: Target portpath: URI path patternmethod: HTTP method (GET, POST, etc.)code: Response status coderequestHeaders: Request header matchersresponseHeaders: Response header matchers
pkg/chaosdaemon/httpchaos_server.go)
Source: api/v1alpha1/httpchaos_types.go:40-86
DNS Chaos
DNSChaos
Inject DNS resolution errors.DNSChaos
CRD:
Actions: error, random
dnschaos_type.goActions: error, random
- error
- random
Return DNS resolution errors.Example:
- Exact match:
"google.com" - Wildcard suffix:
"github.*"(matches github.com, github.io) - Placeholder:
"chaos-mes?.org"(matches chaos-mesh.org)
pkg/chaosdaemon/dns_server.go)
Source: api/v1alpha1/dnschaos_type.go:26-34
JVM Chaos
JVMChaos
Inject faults into JVM applications using Byteman.JVMChaos
CRD:
Actions: latency, return, exception, stress, gc, ruleData, mysql
jvmchaos_types.goActions: latency, return, exception, stress, gc, ruleData, mysql
latency - Method Latency
latency - Method Latency
Add delay to Java method invocations.Parameters:
class: Java class namemethod: Method namelatency: Delay in milliseconds
return - Override Return Value
return - Override Return Value
Override method return values.Parameters:
class: Java class namemethod: Method namereturnValue: Value to return
exception - Throw Exception
exception - Throw Exception
Throw exceptions from methods.Parameters:
class: Java class namemethod: Method nameexception: Exception to throw
stress - JVM Stress
stress - JVM Stress
Generate CPU or memory stress within JVM.Parameters:
cpuCount: Number of CPU cores to stressmemoryType: “stack” or “heap”
gc - Trigger GC
gc - Trigger GC
Trigger garbage collection.
ruleData - Custom Byteman Rule
ruleData - Custom Byteman Rule
Execute custom Byteman rule.Parameters:
ruleData: Raw Byteman rule
mysql - MySQL JDBC Faults
mysql - MySQL JDBC Faults
Inject faults into MySQL JDBC operations.Parameters:
mysqlConnectorVersion: “5” or “8”database: Database name patterntable: Table name patternsqlType: SQL type (select, insert, update, delete, replace)exception: Exception to throwlatency: Delay in milliseconds
pkg/chaosdaemon/jvm_server.go)
Source: api/v1alpha1/jvmchaos_types.go:44-69
Kernel Chaos
KernelChaos
Inject faults into kernel functions using BPF.KernelChaos
CRD:
Mechanism: BPF-based fault injection
kernelchaos_types.goMechanism: BPF-based fault injection
0: slab allocation failures (kmalloc)1: page allocation failures2: bio (block I/O) failures
failtype: What to fail (0, 1, or 2)headers: Required kernel headerscallchain: Specific call chain to targetprobability: Percentage (0-100)times: Maximum failure count
- Test memory allocation failures
- Validate error handling in file system operations
- Test resilience to kernel-level faults
api/v1alpha1/kernelchaos_types.go:58-98
Block Chaos
BlockChaos
Inject delays into block device I/O operations.BlockChaos
CRD:
Actions: delay
blockchaos_types.goActions: delay
volumeName: Name of the volumedelay.latency: I/O delay durationdelay.jitter: Jitter amountdelay.correlation: Correlation percentage
- Test application behavior under slow disks
- Validate timeout handling
- Test I/O-bound applications
pkg/chaosdaemon/blockchaos_server_linux.go
Source: api/v1alpha1/blockchaos_types.go:35-73
Cloud Provider Chaos
AWSChaos
Inject faults into AWS infrastructure.AWSChaos
CRD:
Actions: ec2-stop, ec2-restart, detach-volume
awschaos_types.goActions: ec2-stop, ec2-restart, detach-volume
- ec2-stop
- ec2-restart
- detach-volume
Stop EC2 instances.Parameters:
awsRegion: AWS regionec2Instance: Instance IDsecretName: AWS credentials secret
api/v1alpha1/awschaos_types.go:43-76
GCPChaos
Inject faults into GCP infrastructure.GCPChaos
CRD:
Actions: node-stop, node-reset, disk-loss
gcpchaos_types.goActions: node-stop, node-reset, disk-loss
node-stop: Stop Compute Engine instancesnode-reset: Reset Compute Engine instancesdisk-loss: Detach persistent disks
project: GCP project IDzone: GCP zoneinstance: Instance namedeviceNames: Disk device names (for disk-loss)
api/v1alpha1/gcpchaos_types.go:44-77
AzureChaos
Inject faults into Azure infrastructure.AzureChaos
CRD:
Actions: vm-stop, vm-restart, disk-detach
azurechaos_types.goActions: vm-stop, vm-restart, disk-detach
vm-stop: Stop Azure VMsvm-restart: Restart Azure VMsdisk-detach: Detach managed disks
subscriptionID: Azure subscription IDresourceGroupName: Resource group namevmName: VM namediskName: Disk name (for disk-detach)lun: Logical unit number (for disk-detach)
api/v1alpha1/azurechaos_types.go:43-68
Physical Machine Chaos
PhysicalMachineChaos
Inject faults into physical machines or VMs outside Kubernetes.PhysicalMachineChaos
CRD:
Actions: 40+ actions across network, disk, process, JVM, and more
physical_machine_chaos_types.goActions: 40+ actions across network, disk, process, JVM, and more
Stress Actions
Stress Actions
stress-cpu: CPU stressstress-mem: Memory stress
Disk Actions
Disk Actions
disk-read-payload: Disk read stressdisk-write-payload: Disk write stressdisk-fill: Fill disk space
Network Actions
Network Actions
network-corrupt: Packet corruptionnetwork-duplicate: Packet duplicationnetwork-loss: Packet lossnetwork-delay: Network latencynetwork-partition: Network partitionnetwork-dns: DNS chaosnetwork-bandwidth: Bandwidth limitationnetwork-flood: Network floodingnetwork-down: Disable network interface
Process Actions
Process Actions
process: Kill or signal processes
JVM Actions
JVM Actions
jvm-exception: Throw exceptionsjvm-gc: Trigger GCjvm-latency: Method latencyjvm-return: Override return valuesjvm-stress: JVM stressjvm-rule-data: Custom Byteman rulesjvm-mysql: MySQL JDBC faults
Clock Actions
Clock Actions
clock: Clock offset
Redis Actions
Redis Actions
redis-expiration: Set key expirationredis-penetration: Cache penetrationredis-cacheLimit: Limit cache sizeredis-restart: Restart Redis Sentinelredis-stop: Stop Redis Sentinel
Kafka Actions
Kafka Actions
kafka-fill: Fill Kafka topickafka-flood: Flood Kafkakafka-io: Kafka I/O faults
HTTP Actions
HTTP Actions
http-abort: Abort HTTP requestshttp-delay: HTTP latencyhttp-config: HTTP config manipulationhttp-request: Send HTTP requests
File Actions
File Actions
file-create: Create filesfile-modify: Modify file permissionsfile-delete: Delete filesfile-rename: Rename filesfile-append: Append to filesfile-replace: Replace file content
VM Actions
VM Actions
vm: VM-level operations
Custom Actions
Custom Actions
user_defined: Execute custom commands
api/v1alpha1/physical_machine_chaos_types.go:22-69
Common Fields
All chaos types share common fields:Selector
Defines which pods/resources to target. See Selectors for details.Mode
How many targets to affect:one: Random single targetall: All matching targetsfixed: Fixed number (setvalue)fixed-percent: Fixed percentage (setvalue)random-max-percent: Random up to max percentage (setvalue)
Duration
How long the chaos lasts:Remote Cluster
Target pods in remote clusters:Status Tracking
All chaos experiments track status with: Conditions (api/v1alpha1/common_types.go:45-52):
Selected: Targets have been selectedAllInjected: All targets are injectedAllRecovered: All targets are recoveredPaused: Experiment is paused
api/v1alpha1/common_types.go:78-88):
- Track injection/recovery events
- Count successful operations
- Record timestamps and error messages
Related Resources
Architecture
How chaos types are implemented
Selectors
Target selection mechanisms
Components
Component responsibilities