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.
NetworkChaos allows you to simulate various network failures including delays, packet loss, corruption, duplication, partitions, and bandwidth limitations.
API Version and Kind
Metadata
Standard Kubernetes object metadata.Name of the NetworkChaos resource.
Namespace of the NetworkChaos resource.
Spec Fields
NetworkChaosSpec
Specific network chaos action.Enum values:
netem- Combination of delay, loss, duplicate, corruptdelay- Add network delayloss- Drop packetsduplicate- Duplicate packetscorrupt- Corrupt packet datapartition- Create network partitionbandwidth- Limit bandwidth
delaySelector for targeting pods. Inherits all fields from
PodSelector (inline). See Common Types.Mode to run chaos action:
one, all, fixed, fixed-percent, random-max-percentRequired when mode is
fixed, fixed-percent, or random-max-percent.Duration of the chaos action. Format:
"300ms", "1.5h", "2h45m"Valid time units: ns, us, ms, s, m, hNetwork device to be affected (e.g.,
eth0). If not specified, the first non-loopback device is used.Traffic direction to apply the action.Enum values:
to- Traffic from source to targetfrom- Traffic from target to sourceboth- Traffic in both directions
netem and partition actions.Target network peer. When specified, chaos only affects traffic between source and target.Applies to
netem and partition actions.Network device to be affected in target scope.
Network targets outside Kubernetes cluster.
Remote cluster where chaos will be deployed.
TcParameter (inline fields)
Traffic control parameters embedded in NetworkChaosSpec.Delay specification (for
delay and netem actions).Packet loss specification (for
loss and netem actions).Packet duplication specification (for
duplicate and netem actions).Packet corruption specification (for
corrupt and netem actions).Bandwidth limitation specification (for
bandwidth action).Rate control specification.
Network Action Specifications
DelaySpec
Defines network delay parameters.Base latency to add. Format:
"10ms", "100ms", "1s"Pattern: ^[0-9]+(\.[0-9]+)?(ns|us|ms|s|m|h)$Correlation between successive delay values (0-100). Controls how much the previous delay affects the current one.
Random variation in delay. Format:
"10ms"Pattern: ^[0-9]+(\.[0-9]+)?(ns|us|ms|s|m|h)$Packet reordering configuration.
ReorderSpec
Percentage of packets to reorder (0-100).
Correlation for reordering.
Distance between reordered packets.
LossSpec
Defines packet loss parameters.Percentage of packets to drop (0-100).
Correlation between successive loss events.
DuplicateSpec
Defines packet duplication parameters.Percentage of packets to duplicate (0-100).
Correlation between successive duplication events.
CorruptSpec
Defines packet corruption parameters.Percentage of packets to corrupt (0-100).
Correlation between successive corruption events.
BandwidthSpec
Defines bandwidth limitation parameters using Token Bucket Filter.Speed limit. Units: bit, kbit, mbit, gbit, tbit, bps, kbps, mbps, gbps, tbpsNote:
bps means bytes per second.Number of bytes that can be queued waiting for tokens.Minimum:
1Maximum bytes that tokens can be available for instantaneously.Minimum:
1Maximum depletion rate of the bucket. Only necessary for perfect millisecond timescale shaping.Minimum:
0Size of the peakrate bucket. Should be set to MTU for perfect accuracy.Minimum:
0RateSpec
Speed limit with units (bit, kbit, mbit, gbit, tbit, bps, kbps, mbps, gbps, tbps).
Status Fields
NetworkChaosStatus
Current conditions. See ChaosStatus.
Last known experiment state.
PodNetworkChaos generation for each affected pod.
Examples
Network Delay
Packet Loss
Network Partition
Bandwidth Limit
Combined Netem Actions
Next Steps
IOChaos API
File system and I/O fault injection
Common Types
Shared types and selectors