Actions
BlockChaos currently supports:- delay: Add latency to I/O requests on block devices
Spec Fields
The block chaos action to perform.Options:
delayName of the persistent volume to target.
Delay configuration for I/O operations.
Duration of the chaos action (e.g.,
30s, 5m, 1h).Selection mode for target pods.Options:
one, all, fixed, fixed-percent, random-max-percentList of container names to affect. If not set, the first container will be injected.
Remote cluster name where the chaos will be deployed.
Examples
Add I/O Delay to Persistent Volume
hostpath-example volume for pods with the label app: hostpath-example.
Add I/O Delay with Jitter
Prerequisites
- Persistent Volume: The target volume must be mounted in the pod
- Volume Name: You must know the name of the persistent volume (not the PVC name)
- Privileged Access: Chaos Daemon needs privileged access to manipulate block devices
Implementation Details
BlockChaos works by:- Identifying the block device associated with the specified volume
- Using eBPF or kernel modules to intercept I/O operations
- Adding configured delays to I/O requests
- Constant delay: Set
latencyonly - Variable delay: Add
jitterfor randomness - Correlated delay: Use
correlationto make consecutive delays similar (simulating sustained disk slowness)
api/v1alpha1/blockchaos_types.go:35-73
Limitations
- Currently only supports the
delayaction - Requires knowledge of the persistent volume name (check with
kubectl get pv) - Cannot target specific files or directories within a volume