Testland
Browse all skills & agents

chaos-experiment-author

Build-an-X workflow for a chaos experiment per the Principles of Chaos Engineering - defines steady-state hypothesis, picks the variables (real-world events: network latency, node failure, region outage), sets the blast radius (which percentage / namespace / user cohort), automates execution, and emits the verdict (steady-state held / didn't hold). Includes the five-check pre-flight validation of the steady-state hypothesis (measurable, baselined, SLI-backed tolerance, defined measurement window, metric moves under the fault) with hard-reject rules, and routes the tool choice: Chaos Mesh has its own standalone skill, while LitmusChaos and Gremlin setup live in this skill's references. Use to scope and pre-flight-validate a chaos experiment before running it via Chaos Mesh / Litmus / Gremlin / Toxiproxy.

Install with skills.sh (any agent)

npx skills add testland/qa --skill chaos-experiment-author
View source

chaos-experiment-author

Overview

Per chaos-principles (opens in new window), chaos engineering is "the discipline of experimenting on a system in order to build confidence in the system's capability to withstand turbulent conditions in production." This skill walks the team through authoring an experiment that honors the five principles - steady-state hypothesis, real-world events, running in production, continuous automation, and minimized blast radius - each applied in the step below that uses it.

When to use

  • A new resilience requirement is documented (retry, fallback, circuit-breaker); the experiment verifies it.
  • An incident postmortem identified "we should have tested for X failure"; this builds the experiment.
  • Pre-production sign-off requires a chaos test pass.
  • Recurring monthly / quarterly: scheduled experiments.

Step 1 - Define the steady-state hypothesis

Per chaos-principles (opens in new window) principle 1: focus on measurable output. The hypothesis must be a number, not a feeling:

# experiments/checkout-network-latency.yaml
hypothesis:
  steady_state:
    metric: checkout_completion_rate
    threshold: ">= 95%"
    measured_over: "5 minutes"
    source: "datadog dashboard 'checkout-success'"

Bad hypotheses:

  • "The system stays up." (unmeasurable)
  • "Performance doesn't degrade." (unmeasurable; what's "degrade"?)
  • "Users have a good experience." (subjective)

Good hypotheses:

  • "Checkout completion rate stays >=95%."
  • "p95 API latency stays <=300ms."
  • "Sentry error rate stays <0.5%."

Step 2 - Pick a real-world event to inject

Per chaos-principles (opens in new window) principle 2: vary real-world events. Don't inject "anything"; inject what could plausibly happen - events the team has already seen in real incidents or realistically expects. The catalog of event classes (network, compute, storage, time, region/zone, dependency, configuration) with concrete examples is in references/experiment-authoring.md.

Step 3 - Set the blast radius

Per chaos-principles (opens in new window) principle 5: minimize blast radius.

blast_radius:
  scope: "1% of pods in the staging namespace"
  duration: "5 minutes"
  abort_conditions:
    - "Sentry error rate exceeds 2%"
    - "PagerDuty incident raised"
    - "Manual abort signal"

Start small; expand as confidence grows.

Step 4 - Pick the chaos tool

Default: chaos-mesh for Kubernetes stacks - CNCF-graduated, broadest fault catalog (network / pod / IO / time / stress), declarative CRDs that compose with the experiment YAML in Step 1. Use LitmusChaos (references/litmus.md) when the team wants a ChaosCenter web UI and ChaosHub catalog; Gremlin (references/gremlin.md, deep operations in references/gremlin-advanced-operations.md) for commercial multi-platform support outside Kubernetes; toxiproxy-chaos when the failure surface is purely TCP-level.

The tool's syntax (CRD, attack config, etc.) goes alongside the experiment YAML.

Step 5 - Automate

Per chaos-principles (opens in new window) principle 4: automate continuously.

# .github/workflows/chaos-monthly.yml
on:
  schedule:
    - cron: '0 4 1 * *'   # 1st of every month, 4am UTC

jobs:
  chaos:
    runs-on: ubuntu-latest
    steps:
      - run: |
          kubectl apply -f experiments/checkout-network-latency.yaml
          # Wait for completion
          kubectl wait --for=condition=Complete chaosengine/checkout-network-latency --timeout=10m
          # Check verdict
          kubectl get chaosengine/checkout-network-latency -o jsonpath='{.status.experimentStatus.verdict}'

Schedule per the team's appetite - monthly for new experiments, weekly for established ones, on-demand for incident reproduction.

Step 6 - Run in production?

Per chaos-principles (opens in new window) principle 3: experiments in production are the gold standard. But:

StageUse
Pre-prod (staging)Initial experiment runs; confidence-building.
Canary (5% traffic)Once steady-state holds in staging.
Production (full)Mature experiments; team has playbook for abort.

Most teams should start in staging. Move to production after the team has confidence and abort procedures.

Step 7 - Verdict + report

Emit a per-experiment verdict: the steady-state hypothesis, a pre / during / post metric table, observations, action items, and the next iteration. The full report template is in references/experiment-authoring.md.

Steady-state hypothesis validation (pre-flight)

An authored experiment is not ready to run until its hypothesis survives five pre-flight checks. A hypothesis that cannot be measured, has no baseline, or would not move under the injected fault produces a verdict that means nothing. Per chaos-principles (opens in new window) Principle 1: "Focus on the measurable output of a system, rather than internal attributes of the system. Measurements of that output over a short period of time constitute a proxy for the system's steady state." Run these checks while the cost of fixing the hypothesis is still low.

The Chaos Toolkit steady-state-hypothesis block (required title + probes, each with a provider and a tolerance gate; a failed pre-method check bails the experiment) and its eight tolerance forms are in references/chaostoolkit-tolerance.md, per chaostoolkit.org/reference/api/experiment/ (opens in new window) and chaostoolkit.org/reference/concepts/ (opens in new window).

#CheckPasses whenFails when
1Measurable and observableThe team can run the probe in isolation right now and get a numeric or boolean return (Prometheus query, Datadog API, health endpoint, exit code)The provider is a dashboard URL read by eye, a metric no service emits yet, or needs credentials absent from the run environment
2A recent baseline existsA dashboard, runbook, or monitoring record shows the metric's typical value over the past 7-30 days of normal trafficThe threshold is a round-number guess, the baseline predates the last deployment or is older than 30 days, or was taken during an incident
3Tolerance is SLI-backedThe threshold maps to a published SLO, error-budget line, or documented user-impact threshold (e.g. the on-call alert value)The tolerance accepts total degradation (>= 0%), sits inside the metric's noise band, or no SLO/SLI document backs it
4Measurement window definedThe probe aggregates over an explicit window of at least 1 minute (avg_over_time(...[5m]), a rollup with a stated range)A single-sample point-in-time value (one HTTP 200) stands in for sustained health, or measured_over is 0 / missing
5Metric moves under the faultThe fault's propagation path from injection point to the metric's data source is traceable, with at least one step directly affecting the metricFault and probe share no call-graph path, a global aggregate averages a regional fault away, or a fallback masks the fault entirely

Check 5 is the most important: a probe decoupled from the fault produces a vacuous "held" result. Ask: if this experiment "held", would that mean the system is resilient, or just that the metric is unrelated?

Hard-reject conditions

These block execution outright; do not run the experiment until resolved.

Hard rejectMaps toWhy it is fatal
Probe returns a constant (an LB liveness check or single HTTP 200 that passes even with all backends down)Checks 1, 4, 5The probe cannot register degradation; a "held" verdict is vacuous
Boolean tolerance: true whose only false path is total unavailabilityCheck 3Tests catastrophe, not resilience
No baseline measurement cited in the experiment or runbookCheck 2The tolerance was chosen without measurement
Metric is an internal attribute (thread-pool queue depth, JVM heap) that is not also a published SLIChecks 1, 3Per chaos-principles (opens in new window) Principle 1, internal state is not a valid steady-state output
Fault and probe share no call-graph path, or a global aggregate masks a regional faultCheck 5A "held" result means the metric is unrelated, not that the system is resilient

Pre-flight verdict format

Emit one row per probe, then a summary:

Probe: <probe name>
  Check 1 (measurable):  PASS / FAIL - <reason>
  Check 2 (baseline):    PASS / FAIL - <reason>
  Check 3 (SLI-backed):  PASS / FAIL - <reason>
  Check 4 (window):      PASS / FAIL - <reason>
  Check 5 (moves):       PASS / FAIL - <reason>

Verdict: SOUND / UNSOUND
  Hard-reject triggered: yes / no
  Recommended action: <proceed | revise probe | replace metric | add baseline>

The validation reads the hypothesis specification, not the live system: instrumentation gaps (Check 1) and stale baselines (Check 2) are confirmed by running the probe manually, and Check 5 is a reasoning exercise over the dependency graph, not an automated trace.

Anti-patterns

The seven authoring anti-patterns, each with why it fails and the fixing step, are in references/experiment-authoring.md: hypothesis-as-feeling, inject-anything, production-first, no abort conditions, manual-only runs, one-off-then-forget, and skipping the verdict report.

Limitations

  • Real-world hypothesis quality varies. Teams may discover their "steady-state metric" wasn't actually measurable; iterate.
  • Production experiments need org buy-in. Compliance, SLO budget, on-call awareness all matter.
  • Experimentation cost. Each experiment uses SLO budget; schedule with budget in mind.
  • Per-tool integration. Different tools have different syntax; this skill is tool-agnostic at the methodology layer.

References

  • cp (opens in new window) - Principles of Chaos Engineering: 5 advanced principles (steady-state, real-world events, production, automation, blast radius).
  • ctk (opens in new window), ctk-concepts (opens in new window) - Chaos Toolkit steady-state-hypothesis block spec, tolerance types, pre-/post-method evaluation and bail-out semantics.
  • references/litmus.md, references/gremlin.md - LitmusChaos and Gremlin runner deep dives (references/gremlin-advanced-operations.md for Gremlin Scenarios / Reliability Score / CI).
  • chaos-mesh, toxiproxy-chaos - standalone per-tool runners.
  • failure-injection-test-author - sibling: combines chaos with test suites.
  • chaos-drill-protocol - the run protocol once the experiment is designed and validated.
  • prod-canary-validator (in the qa-shift-right plugin) - provides the steady-state metrics that verdict the experiment and can anchor hypothesis baselines (Check 2).

Chaos Toolkit steady-state-hypothesis block and tolerance forms

View source (opens in new window)

Chaos Toolkit steady-state-hypothesis block and tolerance forms

Reference for the steady-state hypothesis validation section of chaos-experiment-author. The five pre-flight checks there validate a hypothesis expressed in this schema; this file is the schema and tolerance detail they assume.

The steady-state-hypothesis object

Per chaostoolkit.org/reference/api/experiment/ (opens in new window), the steady-state-hypothesis object requires:

  • title (string): human-readable rationale for the hypothesis.
  • probes (array): one or more probe objects, each with:
    • type: "probe"
    • name: identifier string
    • provider: execution specification (HTTP, process, or Python)
    • tolerance: the gate value; if the probe's return value does not satisfy the tolerance, the experiment bails before running the method.

Tolerance forms supported

Per chaostoolkit.org/reference/api/experiment/ (opens in new window):

Tolerance formSyntax exampleEvaluation
Scalar equality"tolerance": 200probe return == 200
Boolean equality"tolerance": trueprobe return == true
String equality"tolerance": "OK"probe return == "OK"
Inclusive range"tolerance": [95, 100]95 <= value <= 100
Membership"tolerance": [200, 201, 204]value in list
Regex"tolerance": {"type": "regex", "pattern": "^healthy$"}regex match
JSONPath"tolerance": {"type": "jsonpath", "path": "$.status", "expect": "up"}JSONPath extract + compare
Range object"tolerance": {"type": "range", "range": [95.0, 100.0]}numeric bounds

Execution flow

Per chaostoolkit.org/reference/concepts/ (opens in new window): probes run once before the method (baseline check) and once after (deviation check). A probe that fails before the method means the system is already outside its acceptable state; the experiment must not run. A probe that fails after the method means the chaos activity caused the system to leave its steady state.

Chaos experiment authoring reference

View source (opens in new window)

Chaos experiment authoring reference

Supporting detail for chaos-experiment-author. Step 2 uses the event catalog, Step 7 uses the verdict report template, and the anti-patterns table lists the mistakes each step guards against.

Real-world event catalog (Step 2)

Per principlesofchaos.org (opens in new window) principle 2, vary real-world events: inject what could plausibly happen, not "anything". Pick events the team has already seen in real incidents or realistically expects.

Event classExamples
NetworkLatency 500ms, packet loss 5%, DNS failure, connection reset
ComputePod kill, CPU throttle, OOM kill, node drain
StorageDisk full, slow disk, read failure
TimeClock skew, leap second
Region / zoneSingle AZ outage, multi-AZ outage
DependencyThird-party API 500s, rate limit, timeout
ConfigurationBad config push, secret rotation failure

Verdict report template (Step 7)

## Chaos experiment verdict - `checkout-network-latency`

**Date:** YYYY-MM-DD   **Duration:** 5 minutes
**Steady-state hypothesis:** checkout_completion_rate >= 95%
**Verdict:** HELD

| Metric                   | Pre-experiment | During experiment | Post |
|--------------------------|----------------|-------------------|------|
| checkout_completion_rate |     97.2%      |       96.8%       | 97.5% |
| p95 latency              |     245ms      |       380ms       | 240ms |

### Observations
- Latency increased as expected (300ms injected).
- Retry logic worked: ~200 retries observed; no user-visible failures.

### Action items
- (none - system behaved as expected)

### Next iteration
- Increase blast radius from 1% to 5% in next month's run.
- Add a longer-duration variant (15 min) to test fatigue.

Anti-patterns

Anti-patternWhy it failsFix
Hypothesis as feeling ("system feels stable")Unmeasurable; can't tell if held.Numeric metric (Step 1).
Inject anything; see what breaksWastes effort; misses real failure modes.Pick real-world events (Step 2).
Production-first experiment without stagingRisks user-visible incident on first run.Staging -> canary -> production (Step 6).
No abort conditionsExperiment runs past safety threshold; real incident.Define abort + manual abort signal (Step 3).
Manual experiment runs onlyPer principlesofchaos.org (opens in new window): "labor-intensive and ultimately unsustainable."Automate (Step 5).
One-off experiment then forgetConfidence decays; same incident recurs.Schedule + repeat (Step 5 cron).
Skipping the verdict reportLessons not captured; next iteration arbitrary.Step 7 report.

Gremlin advanced operations - attacks, Scenarios, Reliability Score, CI, compliance

View source (opens in new window)

Gremlin advanced operations - attacks, Scenarios, Reliability Score, CI, compliance

Deep reference for gremlin.md (opens in new window). Consult when picking a specific attack, chaining attacks into a Scenario, wiring Gremlin into CI, reading the Reliability Score, or satisfying an audit / compliance requirement.

Per gremlin-home (opens in new window):

Full attack table

Per gremlin-home (opens in new window) and the broader Gremlin docs, the four attack classes expand into these individual attacks:

ClassAttackEffect
ResourceCPUSpike CPU usage
ResourceMemorySpike memory
ResourceDisk I/OSpike disk I/O
ResourceDisk spaceFill disk
NetworkLatencyInject latency
NetworkPacket lossDrop packets
NetworkDNSDNS resolution failure
NetworkBlackholeDrop all packets to/from a target
StateShutdownReboot the host
StateProcess killerKill a specific process
StateTime travelSkew the system clock
RequestRequest injectionModify HTTP requests in flight

Running an attack via the web UI

Web UI workflow:

  1. Select target (host / container / service / Lambda).
  2. Pick attack type.
  3. Configure (e.g., latency 500ms; duration 5min).
  4. Optionally schedule.
  5. Click "Unleash."

The UI provides safety: blast-radius scoping, abort button, notifications.

Authoring a Scenario

A Scenario chains multiple attacks:

# Pseudo-Scenario config (Gremlin's UI exports JSON; this approximates)
scenario:
  name: "Checkout resilience test"
  attacks:
    - type: latency
      target: { service: checkout }
      length: 5min
      latency: 500ms
    - type: packet-loss
      target: { service: payment }
      length: 5min
      loss-percent: 10
      delay-after-previous: 1min
  abort_conditions:
    - "Sentry error rate > 2%"
    - "Manual abort"

Scenarios match per the chaos-experiment-author "vary real-world events" principle - combinations approximate real incidents.

Reliability Score

Per gremlin-home (opens in new window), Gremlin's differentiator is the "Reliability Score" - "individual services" get scores "based on dependency mapping, risk detection, and failure testing."

Score components (per Gremlin docs):

  • Resilience tests passed: % of attacks the service survived
  • Dependency map: service-to-service relationships
  • Detected risks: configuration drift, hidden dependencies

A service moving from "untested" to "score 80" via passing attacks creates an objective improvement signal.

API + CI automation

Trigger an attack directly from the API:

curl -X POST "https://api.gremlin.com/v1/attacks/new" \
  -H "Authorization: Key $GREMLIN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "command": {
      "type": "latency",
      "args": ["-l", "300", "-m", "500", "-c", "5", "-h", "^api\\.example\\.com$"]
    },
    "target": {
      "type": "Random",
      "containers": { "labels": { "app": "checkout" } }
    }
  }'

The API enables CI integration - trigger a saved Scenario, wait for it to run, then evaluate a monitoring-driven verdict:

- name: Trigger Gremlin scenario
  run: |
    curl -X POST "https://api.gremlin.com/v1/scenarios/${{ vars.SCENARIO_ID }}/runs" \
      -H "Authorization: Key ${{ secrets.GREMLIN_API_KEY }}"
- name: Wait + verdict
  run: sleep 600 && ./scripts/datadog-verdict.sh

Compliance + audit

Gremlin's enterprise tier (per gremlin-home (opens in new window)'s positioning) provides:

  • Audit logs (who triggered what, when).
  • RBAC at organization / team / role level.
  • SOC 2 / FedRAMP / etc. compliance posture.

Important for regulated industries where audit is non-negotiable.

References

  • gh (opens in new window) - Gremlin overview: enterprise reliability platform, reliability scoring, multi-platform fault injection.
  • chaos-experiment-author - methodology Gremlin Scenarios implement.

Gremlin runner

Deep dive for chaos-experiment-author Step 4. Configures Gremlin (commercial) for cross-platform chaos engineering - agent install on Linux / Windows / Kubernetes, the four attack classes, Scenarios, and the Reliability Score. Use when the platform spans multiple environments (bare metal + cloud

  • serverless) and the team needs a commercial-supported solution.

Overview

Gremlin is a commercial reliability platform for fault injection across bare metal, on-prem, multi-cloud, and serverless. It assigns each service a forward-looking Reliability Score from repeated resilience tests, so teams fix likely failure points before an incident (per gremlin-home (opens in new window)).

When to use

  • The platform spans multiple environments (not just Kubernetes - Gremlin's differentiator vs LitmusChaos / Chaos Mesh).
  • Enterprise support is required (compliance, audit, SLA).
  • The team wants reliability scoring (vs just per-experiment pass/fail).
  • The team is in regulated industry (finance, healthcare) needing the compliance posture.

If the team is K8s-only and OSS-preferred, see litmus.md (opens in new window) or chaos-mesh.

How to use

  1. Install the Gremlin agent on the target host or cluster (see Install) and register it with the Gremlin Control Plane.
  2. Pick an attack type from the four classes (resource, network, state, request) - the exhaustive per-attack table is in gremlin-advanced-operations.md (opens in new window).
  3. Verify before injecting: assert the target is in steady state (error rate and p95 latency healthy on the dashboard) and the blast radius is scoped to a single container in staging; if either check fails, do not inject - fix the scope or wait for steady state to return.
  4. Run one scoped experiment end to end against staging - inject a single fault and attach an abort condition that halts the attack the moment the steady-state metric breaches its threshold (see Worked example).
  5. Verify the abort path fires: confirm the attack actually stops when the abort condition trips; if it does not halt on breach, fix the abort wiring (monitor query, threshold, or notification hook) before widening the blast radius.
  6. Promote passing experiments into a Scenario (chained attacks + abort conditions), wire it into CI via the API, and track each service's Reliability Score - all covered in gremlin-advanced-operations.md (opens in new window).

Install

Linux:

sudo apt install -y gremlin
sudo gremlin auth login --org-id <org-id> --user-id <user-id> --api-token <token>

Kubernetes:

helm repo add gremlin https://helm.gremlin.com
helm install gremlin gremlin/gremlin \
  --namespace gremlin --create-namespace \
  --set gremlin.secret.create=true \
  --set gremlin.secret.teamID=<team-id> \
  --set gremlin.secret.clusterID=<cluster-id> \
  --set gremlin.secret.teamSecret=<secret>

The agent connects to the Gremlin Control Plane (cloud); attacks trigger via web UI or API.

Attack types

Gremlin groups fault injections into four classes (per gremlin-home (opens in new window) and the Gremlin docs):

ClassRepresentative attacksEffect
ResourceCPU, Memory, Disk I/O, Disk spaceStarve or saturate a host resource
NetworkLatency, Packet loss, DNS, BlackholeDegrade or sever connectivity
StateShutdown, Process killer, Time travelDisrupt host / process state
RequestRequest injectionModify HTTP requests in flight

The full per-attack table (all twelve attacks with their exact effect) lives in gremlin-advanced-operations.md (opens in new window).

Worked example

A single end-to-end experiment: inject 500ms latency into the checkout service, scoped to one container for five minutes.

  1. Steady state. Confirm from monitoring that checkout error rate is under 1% and p95 latency is healthy.
  2. Hypothesis. A 500ms upstream latency injection keeps the error rate under 2% (retries + timeouts absorb it).
  3. Inject the fault via the API, scoped tight (one container, capped at 5 minutes):
curl -X POST "https://api.gremlin.com/v1/attacks/new" \
  -H "Authorization: Key $GREMLIN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "command": {
      "type": "latency",
      "args": ["-l", "300", "-m", "500", "-c", "1", "-h", "^checkout\\..*$"]
    },
    "target": {
      "type": "Random",
      "percent": 10,
      "containers": { "labels": { "app": "checkout" } }
    }
  }'
  1. Observe + abort. Watch the error rate for the five-minute window; the UI halt button (or a monitored abort condition) stops the attack the moment error rate crosses 2%.
  2. Verdict. Error rate held at 1.2% - checkout tolerates 500ms upstream latency. Record the pass against the service's Reliability Score, then widen the blast radius on the next run.

Scenarios (chaining this latency attack with a downstream packet-loss attack), the Reliability Score model, the full CI workflow, and the compliance / audit posture are in gremlin-advanced-operations.md (opens in new window).

Anti-patterns

Anti-patternWhy it failsFix
Manual UI-only attacksDoesn't scale; per chaos principle 4 must automate.API-driven Scenarios (gremlin-advanced-operations.md).
Skipping abort conditionsAttack runs past safety threshold.Define abort signals on every Scenario (gremlin-advanced-operations.md).
Treating Reliability Score as the only signalScore is service-level; per-attack verdicts matter too.Both Score (trend) + per-attack verdicts (detail).
One-shot installation; team forgetsLicense paid; not used.Schedule attacks; build into release process.
Production attacks without playbookReal incident if attack escalates.Per chaos-experiment-author: blast radius + abort.

Limitations

  • Commercial cost. Subscription model; per-team / per-host pricing. Not suitable for OSS budgets.
  • Cloud control plane. Air-gapped environments need on-prem deployment.
  • Vendor lock-in. Scenarios + Reliability Score data lives in Gremlin; migration cost real.
  • Less Kubernetes-deep than Chaos Mesh / Litmus. Gremlin abstracts platform; loses some K8s-specific power.

References

  • gh (opens in new window) - Gremlin overview: enterprise reliability platform, forward-looking reliability scores, multi-platform (bare metal / on-prem / multi-cloud / serverless), fault injection + reliability scoring + dependency discovery.
  • gremlin-advanced-operations.md (opens in new window) - exhaustive attack table, UI attack workflow, Scenario authoring, Reliability Score model, the API + CI automation workflow, and the compliance / audit posture.
  • litmus.md (opens in new window), chaos-mesh - open-source K8s-only alternatives.
  • The host chaos-experiment-author SKILL.md - methodology Gremlin Scenarios implement.

LitmusChaos runner

Deep dive for chaos-experiment-author Step 4. Configures LitmusChaos for Kubernetes-native chaos engineering. Prefer over chaos-mesh when the team wants a ChaosCenter web UI for workflow scheduling and ChaosHub catalog browsing; use chaos-mesh for fine-grained network-fault policies via its own CRD family.

Overview

Per litmus-home (opens in new window):

"LitmusChaos is a CNCF-hosted, open-source Chaos Engineering platform that helps teams identify infrastructure weaknesses through safe, controlled chaos tests."

"Kubernetes developers & SREs use Litmus to manage chaos in a declarative manner." (litmus-home (opens in new window))

The architecture: Litmus runs as a Kubernetes operator; experiments are CRDs; results export to Prometheus.

When to use

  • The platform is Kubernetes (Litmus is K8s-native).
  • The team wants CNCF / open-source chaos tooling (vs commercial Gremlin).
  • A chaos experiment's outcome should integrate with existing K8s observability (Prometheus, Grafana).

Step 1 - Install

Per litmus-home (opens in new window):

helm repo add litmuschaos https://litmuschaos.github.io/litmus-helm/
helm install litmuschaos litmuschaos/litmus -n litmus --create-namespace

The Litmus operator + ChaosCenter (web UI) deploy.

Step 2 - Pick a ChaosExperiment from the Hub

Per litmus-home (opens in new window), the ChaosHub is "a repository hosting most of the chaos experiments that are needed for a quick start in Chaos Engineering." Common experiments:

ChaosExperimentEffect
pod-deleteKill random pods
pod-network-latencyInject network latency on the pod
pod-network-lossDrop a percentage of packets
pod-cpu-hogSpike CPU on the pod
pod-memory-hogSpike memory on the pod
node-cpu-hogSpike CPU on the node
node-drainDrain a node
disk-fillFill the pod's writable disk
kubelet-service-killKill kubelet on a node

Install per-experiment:

kubectl apply -f https://hub.litmuschaos.io/api/chaos/2.14.0?file=charts/generic/pod-delete/experiment.yaml

Step 3 - Author a ChaosEngine

The ChaosEngine CR runs an experiment against a target:

apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata:
  name: checkout-pod-delete
  namespace: app
spec:
  appinfo:
    appns: app
    applabel: 'app=checkout'
    appkind: deployment
  chaosServiceAccount: pod-delete-sa
  experiments:
    - name: pod-delete
      spec:
        components:
          env:
            - name: TOTAL_CHAOS_DURATION
              value: '60'      # seconds
            - name: CHAOS_INTERVAL
              value: '20'       # seconds
            - name: PODS_AFFECTED_PERCENTAGE
              value: '50'
        probe:
          - name: 'check-checkout-availability'
            type: httpProbe
            httpProbe/inputs:
              url: 'http://checkout.app.svc:8080/health'
              insecureSkipVerify: false
              method:
                get:
                  criteria: '=='
                  responseCode: '200'
            mode: 'Continuous'
            runProperties:
              probeTimeout: 5
              interval: 2
              retry: 3
              probePollingInterval: 1

Per litmus-home (opens in new window), probes "create complete chaos scenarios close to the real application experience upon failure." The probe is the steady-state check per the chaos principles.

Step 4 - Run

kubectl apply -f checkout-pod-delete.yaml

Litmus runs the experiment for TOTAL_CHAOS_DURATION seconds, checking the probe continuously. The verdict (Pass / Fail) lands in chaosengine.status.experimentStatus.verdict.

Step 5 - Read the verdict

kubectl get chaosengine checkout-pod-delete -o jsonpath='{.status.experimentStatus.verdict}'
# Output: Pass | Fail

Step 6 - Probe types

Probe typeUse
httpProbeHTTP endpoint health + status code
cmdProbeRun a shell command; check exit code
k8sProbeCheck Kubernetes resource state
promProbeQuery Prometheus metric; assert threshold

Probes can run in different modes: SOT (start of test), EOT (end of test), Edge (both), Continuous (every N seconds during the experiment).

Step 7 - Observability

Per litmus-home (opens in new window): "chaos observability by exporting Prometheus metrics that highlight and quantify the impact of chaos on the applications or infrastructure in real time."

Key metrics:

  • litmuschaos_passed_experiments
  • litmuschaos_failed_experiments
  • litmuschaos_awaited_experiments

Wire to Grafana for dashboards.

Step 8 - CI integration

- name: Run chaos experiment
  run: |
    kubectl apply -f experiments/checkout-pod-delete.yaml
    kubectl wait --for=condition=Complete chaosengine/checkout-pod-delete --timeout=10m
    VERDICT=$(kubectl get chaosengine checkout-pod-delete -o jsonpath='{.status.experimentStatus.verdict}')
    echo "Verdict: $VERDICT"
    [ "$VERDICT" = "Pass" ]

Anti-patterns

Anti-patternWhy it failsFix
Running ChaosEngine without probeNo steady-state check; verdict meaningless.Always include httpProbe / promProbe (Step 3).
PODS_AFFECTED_PERCENTAGE: 100Kills all pods; service down.Start at 25-50%; increase per blast-radius principle.
Running in default namespaceCould affect cluster components.Dedicated app namespace target.
One-shot experiment; never re-runPer chaos principle 4: automate continuously.Schedule via CronJob (Step 8 in cron form).
Skipping chaosServiceAccountRBAC blocks experiment execution.Define ServiceAccount with appropriate permissions.

Limitations

  • Kubernetes only. No native non-K8s support (vs Gremlin's multi-platform).
  • ChaosHub experiments need vetting. Community experiments vary in quality.
  • Cluster overhead. Litmus operator + per-experiment pods consume resources.
  • Per-tool incompatibility. Litmus ChaosEngines aren't Chaos-Mesh CRDs; experiments don't port.

References

  • lh (opens in new window) - LitmusChaos overview, CNCF-hosted, ChaosExperiments
    • ChaosEngine + ChaosHub + probes, Prometheus metrics export.
  • chaos-mesh - sibling K8s-native alternative.
  • gremlin.md (opens in new window) - commercial multi-platform alternative.
  • The host chaos-experiment-author SKILL.md - methodology this tool implements.

Related skills

chaos-drill-protocol

Run protocol and run workflow for a chaos experiment that has already been designed: the four pre-flight gates (non-production target, measured healthy baseline, live observability, a rollback that has actually been exercised), how to pick a conservative blast-radius bound, the sampling cadence and abort criteria fixed in writing before injection, the per-runner inject and abort commands (Chaos Mesh / Litmus / Gremlin / Toxiproxy), the refuse-to-start rules (no blast-radius bound, production context, degraded baseline, offline observability, unexercised rollback), and the recovery-validation step with its tolerance and timeout. Owns execution safety only, not experiment design: the steady-state hypothesis, the fault to inject, and the experiment file come from chaos-experiment-author. Use when an experiment definition exists and a fault is about to be injected into a running system, and the go/no-go gates, abort thresholds, and recovery check still need to be agreed and written down before the fault starts.

chaos-mesh

Configures Chaos Mesh for Kubernetes-native chaos engineering - picks fault types (PodChaos, NetworkChaos, StressChaos, IOChaos, TimeChaos, DNSChaos, KernelChaos, HTTPChaos), targets via label selectors, controls blast radius via namespace whitelists + selector filters, schedules via CronJobs, observes via dashboard. Distinct from Litmus by architecture (Chaos Mesh has its own dashboard + workflow orchestration; Litmus uses ChaosCenter UI). Use when the target system runs on Kubernetes and fault experiments should be declared as CRDs in the cluster alongside the workloads they target.

dr-drill-runner

The full DR-drill discipline for one service: author the runbook (per-tier RTO + RPO), pre-drill checklist (data sync state, alert silencing, customer comms), drill workflow (announce, fail-over, verify, fail-back) with timestamps, the supervised run protocol (refuse without declared RTO/RPO or against production, RTO/RPO monitoring cadence, abort-on-breach), and an auditor-ready post-drill report. Backup-integrity verification (SHA-256 + signature, restore spot checks, cross-region replication, retention, key recovery) and restore-time / RTO measurement (TTF segments, PITR latency, parallel-restore tuning, trend tracking) are worked in references. Per Google Cloud DR planning guide; covers cold / warm / hot standby tier-specific patterns. Use when a scheduled or post-incident failover drill for one service is being planned, executed, or written up, or when a new tier-1 service ships without a drill defined.

error-budget-tests

Build error-budget gate tests - SLO + error-budget calculation per Google SRE workbook ("difference between target uptime and actual uptime"); burn-rate alerting; monthly-budget exhaustion test; freeze-trigger when budget consumed. Per sre.google embracing-risk reference. Includes the incident-metrics reference for MTTR / MTBF / MTTD / MTTA - per-incident record schema, calculation formulae, exclusion rules, dashboards-as-code, and target-vs-actual alerting. Use when an SLO and error budget are written down but nothing verifies that burn-rate alerts fire or that the release freeze engages when the budget runs out, or when MTTR / MTBF dashboards report numbers nobody can reproduce.

failure-injection-test-author

Orchestrates WireMock fault stubs (HTTP-level fault: 500s, malformed JSON, slow responses) with Toxiproxy (TCP-level: latency, packet loss, reset) into a single resilience test scenario - the test starts both, applies fault per scenario, runs the SUT against the impaired endpoints, verifies the SUT's resilience patterns. Use when one test must reproduce a combined network + HTTP failure - a cross-layer failure mode from an incident postmortem that neither pure HTTP fault stubs nor pure TCP chaos can cover alone, because most real failures span both layers.

toxiproxy-chaos

Configures Toxiproxy for TCP-level fault injection - runs as a sidecar / proxy between client and upstream, applies toxics (latency, bandwidth, slow_close, timeout, slicer, limit_data, reset_peer) via control API. Focused on the proxy itself rather than an API-level chaos runner, including non-test usage (chaos in dev environments, integration tests, pre-prod simulation). Use when the team needs TCP-precise fault injection in development / integration environments without K8s or commercial tooling.