Chaos Mesh defines several common types that are shared across different chaos experiment CRDs. Understanding these types is essential for configuring chaos experiments.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.
Selector Types
PodSelector
Selects which pods to target for chaos injection.Pod selection criteria
Mode to run chaos action.Enum values:
one- Select one random podall- Select all matching podsfixed- Select a fixed number of podsfixed-percent- Select a fixed percentage of podsrandom-max-percent- Select up to a random percentage of pods
Required when mode is
fixed, fixed-percent, or random-max-percent.- For
fixed: Integer number of pods (e.g., “3”) - For
fixed-percent: Percentage from 0-100 (e.g., “50”) - For
random-max-percent: Max percentage from 0-100 (e.g., “75”)
PodSelectorSpec
Defines the criteria for selecting pods.Namespaces to select pods from. If empty, defaults to the chaos experiment’s namespace.
Label-based selector. Select pods matching all specified labels.
Annotation-based selector. Select pods matching all specified annotations.
Field-based selector using Kubernetes field selectors.
Set-based label selector expressions for advanced selection logic.
Node names. Select only pods running on these nodes.
Explicitly select pods by namespace and name.
Select pods on nodes matching these label selectors.
Select pods in specific phases.Valid values:
Pending, Running, Succeeded, Failed, UnknownContainerSelector
ExtendsPodSelector to select specific containers within pods.
All fields from PodSelector are available (inline).
List of container names to affect. If not set, the first container will be selected.
Status Types
ChaosStatus
Represents the current status of a chaos experiment.Current global conditions of the chaos experiment.
Last known experiment state.
ChaosCondition
Type of condition.Values:
Selected- Targets have been selectedAllInjected- All targets have been injectedAllRecovered- All targets have been recoveredPaused- Experiment is paused
Status of the condition:
True, False, or UnknownHuman-readable reason for the condition.
ExperimentStatus
Target phase for the experiment.Values:
Run- Make all targets injectedStop- Make all targets not injected
Tracking records for running status (stored in
containerRecords field).Record
Tracks the injection status of a single target.Unique identifier for this record.
Key identifying which selector this record belongs to.
Current phase of the target.Values:
Not Injected- Target is not injected yetInjected- Target is currently injected
Counter of successful injections.
Counter of successful recoveries.
Essential details about injections and recoveries.
RecordEvent
Event outcome.Values:
Succeeded- Operation succeededFailed- Operation failed
Operation being performed.Values:
Apply- Injecting chaosRecover- Recovering from chaos
Detail message, such as failure reason.
When the event was created.
Duration Format
Many chaos experiments accept aduration field specifying how long the chaos should last.
Format: A possibly signed sequence of decimal numbers, each with optional fraction and a unit suffix.
Valid units: ns, us (or µs), ms, s, m, h
Examples:
"300ms"- 300 milliseconds"1.5h"- 1.5 hours"2h45m"- 2 hours 45 minutes"-1.5h"- Negative 1.5 hours (for TimeChaos offset)
Remote Cluster
Many chaos types support targeting remote clusters.Name of the remote cluster where chaos will be deployed. If not specified, chaos is applied to the local cluster.
Selector Mode Examples
Select One Random Pod
Select All Matching Pods
Select Fixed Number of Pods
Select Percentage of Pods
Next Steps
PodChaos API
Pod-level chaos injection
NetworkChaos API
Network fault injection