Chaos Engineer

作者 jeffallan1be15d8064f8MIT11K 个星标收录于 2026年10月8日更新于 2026年10月8日仓库5天前更新

Designs chaos experiments, creates failure injection frameworks, and facilitates game day exercises for distributed systems — producing runbooks, experiment manifests, rollback procedures, and post-mortem templates. Use when designing chaos experiments, implementing failure injection frameworks, or conducting game day exercises. Invoke for chaos experiments, resilience testing, blast radius control, game days, antifragile systems, fault injection, Chaos Monkey, Litmus Chaos.

仅含说明DevOps & Cloud
AI 生成的概览

为分布式系统设计混沌实验、故障注入框架和演练日,并产出运行手册与回滚流程。

功能
提供涵盖系统分析、实验设计、受控执行、总结改进和自动化的五步工作流。产出实验设计文档、故障注入清单与脚本、监控与告警配置、回滚流程以及学习总结。参考文件涵盖实验设计、基础设施混沌、Kubernetes 混沌、工具与演练日。
适用场景
适用于规划或执行混沌实验、构建 Chaos Monkey 或 Litmus 等故障注入框架,以及组织演练日活动。也适合定义爆炸半径控制、安全机制和 CI/CD 中的持续混沌测试。
运行要求
该技能不附带脚本,仅为说明与参考文档。执行所述实验需要访问目标系统,并具备 kubectl、Litmus Chaos、toxiproxy 或 Chaos Monkey 等工具。

Chaos Engineer

When to Use This Skill

  • Designing and executing chaos experiments
  • Implementing failure injection frameworks (Chaos Monkey, Litmus, etc.)
  • Planning and conducting game day exercises
  • Building blast radius controls and safety mechanisms
  • Setting up continuous chaos testing in CI/CD
  • Improving system resilience based on experiment findings

Core Workflow

  1. System Analysis - Map architecture, dependencies, critical paths, and failure modes
  2. Experiment Design - Define hypothesis, steady state, blast radius, and safety controls
  3. Execute Chaos - Run controlled experiments with monitoring and quick rollback
  4. Learn & Improve - Document findings, implement fixes, enhance monitoring
  5. Automate - Integrate chaos testing into CI/CD for continuous resilience

Reference Guide

Load detailed guidance based on context:

TopicReferenceLoad When
Experimentsreferences/experiment-design.mdDesigning hypothesis, blast radius, rollback
Infrastructurereferences/infrastructure-chaos.mdServer, network, zone, region failures
Kubernetesreferences/kubernetes-chaos.mdPod, node, Litmus, chaos mesh experiments
Tools & Automationreferences/chaos-tools.mdChaos Monkey, Gremlin, Pumba, CI/CD integration
Game Daysreferences/game-days.mdPlanning, executing, learning from game days

Safety Checklist

Non-obvious constraints that must be enforced on every experiment:

  • Steady state first — define and verify baseline metrics before injecting any failure
  • Blast radius cap — start with the smallest possible impact scope; expand only after validation
  • Automated rollback ≤ 30 seconds — abort path must be scripted and tested before the experiment begins
  • Single variable — change only one failure condition at a time until behaviour is well understood
  • No production without safety nets — customer-facing environments require circuit breakers, feature flags, or canary isolation
  • Close the loop — every experiment must produce a written learning summary and at least one tracked improvement

Output Templates

When implementing chaos engineering, provide:

  1. Experiment design document (hypothesis, metrics, blast radius)
  2. Implementation code (failure injection scripts/manifests)
  3. Monitoring setup and alert configuration
  4. Rollback procedures and safety controls
  5. Learning summary and improvement recommendations

Concrete Example: Pod Failure Experiment (Litmus Chaos)

The following shows a complete experiment — from hypothesis to rollback — using Litmus Chaos on Kubernetes.

Step 1 — Define steady state and apply the experiment

bash
# Verify baseline: p99 latency < 200ms, error rate < 0.1%kubectl get deploy my-service -n productionkubectl top pods -n production -l app=my-service

Step 2 — Create and apply a Litmus ChaosEngine manifest

yaml
# chaos-pod-delete.yamlapiVersion: litmuschaos.io/v1alpha1kind: ChaosEnginemetadata:  name: my-service-pod-delete  namespace: productionspec:  appinfo:    appns: production    applabel: "app=my-service"    appkind: deployment  # Limit blast radius: only 1 replica at a time  engineState: active  chaosServiceAccount: litmus-admin  experiments:    - name: pod-delete      spec:        components:          env:            - name: TOTAL_CHAOS_DURATION              value: "60"          # seconds            - name: CHAOS_INTERVAL              value: "20"          # delete one pod every 20s            - name: FORCE              value: "false"            - name: PODS_AFFECTED_PERC              value: "33"          # max 33% of replicas affected
bash
# Apply the experimentkubectl apply -f chaos-pod-delete.yaml
# Watch experiment statuskubectl describe chaosengine my-service-pod-delete -n productionkubectl get chaosresult my-service-pod-delete-pod-delete -n production -w

Step 3 — Monitor during the experiment

bash
# Tail application logs for errorskubectl logs -l app=my-service -n production --since=2m -f
# Check ChaosResult verdict when completekubectl get chaosresult my-service-pod-delete-pod-delete \  -n production -o jsonpath='{.status.experimentStatus.verdict}'

Step 4 — Rollback / abort if steady state is violated

bash
# Immediately stop the experimentkubectl patch chaosengine my-service-pod-delete \  -n production --type merge -p '{"spec":{"engineState":"stop"}}'
# Confirm all pods are healthykubectl rollout status deployment/my-service -n production

Concrete Example: Network Latency with toxiproxy

bash
# Install toxiproxy CLIbrew install toxiproxy   # macOS; use the binary release on Linux
# Start toxiproxy server (runs alongside your service)toxiproxy-server &
# Create a proxy for your downstream dependencytoxiproxy-cli create -l 0.0.0.0:22222 -u downstream-db:5432 db-proxy
# Inject 300ms latency with 10% jitter — blast radius: this proxy onlytoxiproxy-cli toxic add db-proxy -t latency -a latency=300 -a jitter=30
# Run your load test / observe metrics here ...
# Remove the toxic to restore normal behaviourtoxiproxy-cli toxic remove db-proxy -n latency_downstream

Concrete Example: Chaos Monkey (Spinnaker / standalone)

bash
# chaos-monkey-config.yml — restrict to a single ASGdeployment:  enabled: true  regionIndependence: falsechaos:  enabled: true  meanTimeBetweenKillsInWorkDays: 2  minTimeBetweenKillsInWorkDays: 1  grouping: APP           # kill one instance per app, not per cluster  exceptions:    - account: production      region: us-east-1      detail: "*-canary"  # never kill canary instances
# Apply and trigger a manual kill for testingchaos-monkey --app my-service --account staging --dry-run false

Maintained by @jeffallan, Principal Consultant at Synergetic Solutions

Documentation

来源与署名

来源:jeffallan/claude-skills位于skills/chaos-engineer提交1be15d8

许可证: MIT

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架