123DevOps··7 min read

What is Chaos Mesh? Kubernetes-native chaos engineering

Learn what Chaos Mesh is, how it injects faults with CRDs such as PodChaos and NetworkChaos, how to orchestrate experiments with Workflow and Schedule, and how to use it safely by limiting namespaces and permissions.

Kubernetes

You already know you need to test how your system behaves when a pod dies or the network gets slow. The hard part is doing it repeatably, with a controlled scope, and without an improvised script someone forgets running. Chaos Mesh solves that part: it turns every fault into a Kubernetes resource, with a duration, a target, and a history.

This article focuses on the tool. The principles (hypothesis, steady state, blast radius, and abort condition) are covered in Chaos Engineering and Resilience; it’s worth reading first.

What Chaos Mesh is

Chaos Mesh is a chaos engineering platform for Kubernetes, created by PingCAP (the company behind TiDB) to test its own distributed database and released as open source under the Apache 2.0 license. Experiments are declared as CRDs in the chaos-mesh.org group, and a web dashboard lets you create, track, and pause experiments without writing YAML.

As of November 2026, Chaos Mesh is an Incubating CNCF project: it joined as Sandbox in 2020 and moved to Incubating in 2022 (check the project page for its current status). At the time of research, the release marked as latest on GitHub was v2.8.8, and the 2.7 line was in its final maintenance phase.

What problem it solves

Without a dedicated tool, injecting faults in Kubernetes usually means a manual kubectl delete pod, tc inside a privileged container, or stress running in a forgotten pod. None of that has a defined duration, a record, or a reliable way to roll back.

Chaos Mesh delivers:

  • Declarative faults: the experiment is an object with a selector, a mode, and a duration. When it ends, the effect is reverted.
  • A wide range of faults: from pods and network to disk, clock, kernel, JVM, and cloud APIs.
  • Orchestration: experiments in sequence, in parallel, and on a schedule.
  • Access control: Kubernetes’ own RBAC and a dashboard that requires a token.

How it works

The architecture has three main components:

Component Role
Chaos Controller Manager The core component: runs the CRD controllers and schedules experiments
Chaos Daemon A DaemonSet that enters the target pods’ namespaces to tamper with network, file system, and kernel; runs privileged by default
Chaos Dashboard Web UI and HTTP API to create and observe experiments, with permission management

Fault types

Each fault type is its own kind:

CRD What it simulates
PodChaos pod-kill, pod-failure (pod unavailable for a while), and container-kill
NetworkChaos Delay, loss, duplication, corruption, partition, and bandwidth limits
StressChaos CPU and memory pressure inside the container
IOChaos Latency and errors in file operations
TimeChaos Shifts the clock seen by the process
DNSChaos / HTTPChaos DNS resolution errors; delays, aborts, and changes to HTTP requests
KernelChaos / JVMChaos Kernel faults and faults in Java applications
AWSChaos / GCPChaos Actions on cloud resources, such as stopping instances

The mode field sets how many of the selector’s targets are affected: one, all, fixed, fixed-percent, or random-max-percent.

Workflow and Schedule

A Schedule creates experiments on a cron, like a CronJob, with concurrencyPolicy and historyLimit. A Workflow chains steps using Serial, Parallel, Suspend, and the chaos types themselves as templates, so you can, for example, kill a pod and then inject latency, widening the blast radius gradually. In Workflow templates, the duration goes in the deadline field.

Hands-on example

The recommended installation is via Helm. The commands below follow the official documentation for containerd clusters (the socket changes with the runtime):

helm repo add chaos-mesh https://charts.chaos-mesh.org
kubectl create ns chaos-mesh
helm install chaos-mesh chaos-mesh/chaos-mesh -n chaos-mesh \
  --set chaosDaemon.runtime=containerd \
  --set chaosDaemon.socketPath=/run/containerd/containerd.sock \
  --set controllerManager.enableFilterNamespace=true \
  --version 2.8.8

The controllerManager.enableFilterNamespace=true option turns on the namespace filter: only annotated namespaces can receive faults. Allow only staging:

kubectl annotate ns staging chaos-mesh.org/inject=enabled

Now, two experiments. The first kills one pod of the checkout service; the second adds 200 ms of latency for 5 minutes to half of the pods:

apiVersion: chaos-mesh.org/v1alpha1
kind: PodChaos
metadata:
  name: kill-one-checkout-pod
  namespace: staging
spec:
  action: pod-kill
  mode: one
  selector:
    namespaces:
      - staging
    labelSelectors:
      app: checkout
---
apiVersion: chaos-mesh.org/v1alpha1
kind: NetworkChaos
metadata:
  name: checkout-latency
  namespace: staging
spec:
  action: delay
  mode: fixed-percent
  value: "50"
  selector:
    namespaces:
      - staging
    labelSelectors:
      app: checkout
  delay:
    latency: "200ms"
    jitter: "20ms"
    correlation: "25"
  duration: "5m"

To run the latency every night, wrap the experiment in a Schedule. Note that the type goes in type and the spec goes under a key named in camelCase:

apiVersion: chaos-mesh.org/v1alpha1
kind: Schedule
metadata:
  name: nightly-latency
  namespace: staging
spec:
  schedule: "0 2 * * *"
  historyLimit: 3
  concurrencyPolicy: Forbid
  type: NetworkChaos
  networkChaos:
    action: delay
    mode: one
    selector:
      namespaces:
        - staging
      labelSelectors:
        app: checkout
    delay:
      latency: "200ms"
    duration: "5m"

Track and stop them with kubectl:

kubectl apply -f experiments.yaml
kubectl describe networkchaos checkout-latency -n staging
kubectl annotate schedule nightly-latency -n staging experiment.chaos-mesh.org/pause=true
kubectl delete networkchaos checkout-latency -n staging   # ends and reverts the fault

Commands follow the official documentation; the manifests passed a syntax check but were not applied against the Chaos Mesh CRDs for this article.

Dashboard and RBAC

With Helm, the Dashboard ships with authentication turned on (dashboard.securityMode=true). The dashboard’s own token generator creates a ServiceAccount with a Role and RoleBinding at namespace or cluster scope, in the Manager role (creates and deletes experiments) or the Viewer role (read-only). Prefer namespace scope and use the RBAC with Roles and RoleBindings pattern to give each team access only to its own environment. The documentation says not to turn off securityMode in production.

When to use it (and when not to)

Use Chaos Mesh when:

  • your workloads run on Kubernetes and you want experiments versioned in Git, like any other manifest;
  • you need faults beyond “kill a pod”, such as latency, disk, clock, and DNS;
  • you want recurring game days with Schedule and Workflow instead of one-off tests.

Avoid it, or wait, when:

  • you don’t have steady-state metrics or alerts yet. Without observability, the experiment teaches you nothing;
  • the cluster is shared and you can’t run a privileged Chaos Daemon or enable the namespace filter;
  • your main target is the cloud infrastructure (zones, managed databases). Services such as AWS Fault Injection Service cover that level better.

Golden rule: start in staging, with mode: one and a short duration, and only take it to production with a defined abort condition and the team informed.

Alternatives

Tool Model Note
Chaos Mesh CRDs + Dashboard Wide range of faults, native Workflow and Schedule
LitmusChaos CRDs + ChaosCenter Also a CNCF project, with a hub of ready-made experiments
AWS Fault Injection Service Managed service Focused on AWS resources, with stop conditions tied to alarms
Toxiproxy TCP proxy Simple for local and integration tests between services

Summary

  • Read the chaos principles and define a hypothesis and abort condition before the first experiment
  • Install with controllerManager.enableFilterNamespace=true and annotate only test namespaces
  • Start in staging with mode: one and a short duration
  • Keep the Dashboard with securityMode on and namespace-scoped tokens
  • Version PodChaos, NetworkChaos, and Schedule in Git, like your other manifests
  • Use Workflow to widen the blast radius gradually
  • Know how to pause (experiment.chaos-mesh.org/pause=true) and delete an experiment under pressure

Chaos without a hypothesis is just noise: Chaos Mesh gives you control, but asking the right question is still your job.

Get updates on new posts and stay in the loop!