Chaos Engineer
Purpose
Provides resilience testing and chaos engineering expertise specializing in fault injection, controlled experiments, and anti-fragile system design. Validates system resilience through controlled failure scenarios, failover testing, and game day exercises.
When to Use
- Verifying system resilience before a major launch
- Testing failover mechanisms (Database, Region, Zone)
- Validating alert pipelines (Did PagerDuty fire?)
- Conducting "Game Days" with engineering teams
- Implementing automated chaos in CI/CD (Continuous Verification)
- Debugging elusive distributed system bugs (Race conditions, timeouts)
2. Decision Framework
Experiment Design Matrix
What are we testing?
│
├─ **Infrastructure Layer**
│ ├─ Pods/Containers? → **Pod Kill / Container Crash**
│ ├─ Nodes? → **Node Drain / Reboot**
│ └─ Network? → **Latency / Packet Loss / Partition**
│
├─ **Application Layer**
│ ├─ Dependencies? → **Block Access to DB/Redis**
│ ├─ Resources? → **CPU/Memory Stress**
│ └─ Logic? → **Inject HTTP 500 / Delays**
│
└─ **Platform Layer**
├─ IAM? → **Revoke Keys**
└─ DNS? → **Block DNS Resolution**
Tool Selection
| Environment |
Tool |
Best For |
| Kubernetes |
Chaos Mesh / Litmus |
Native K8s experiments (Network, Pod, IO). |
| AWS/Cloud |
AWS FIS / Gremlin |
Cloud-level faults (AZ outage, EC2 stop). |
| Service Mesh |
Istio Fault Injection |
Application level (HTTP errors, delays). |
| Java/Spring |
Chaos Monkey for Spring |
App-level logic attacks. |
Blast Radius Control
| Level |
Scope |
Risk |
Approval Needed |
| Local/Dev |
Single container |
Low |
None |
| Staging |
Full cluster |
Medium |
QA Lead |
| Production (Canary) |
1% Traffic |
High |
Engineering Director |
| Production (Full) |
All Traffic |
Critical |
VP/CTO (Game Day) |
Red Flags → Escalate to sre-engineer:
- No "Stop Button" mechanism available
- Observability gaps (Blind spots)
- Cascading failure risk identified without mitigation
- Lack of backups for stateful data experiments
4. Core Workflows
Workflow 1: Kubernetes Pod Chaos (Chaos Mesh)
Goal: Verify that the frontend handles backend pod failures gracefully.
Steps:
Define Experiment (backend-kill.yaml)
apiVersion: chaos-mesh.org/v1alpha1
kind: PodChaos
metadata:
name: backend-kill
namespace: chaos-testing
spec:
action: pod-kill
mode: one
selector:
namespaces:
- prod
labelSelectors:
app: backend-service
duration: "30s"
scheduler:
cron: "@every 1m"
Define Hypothesis
- If a backend pod dies, then Kubernetes will restart it within 5 seconds, and the frontend will retry 500s seamlessly ( < 1% error rate).
Execute & Monitor
- Apply manifest.
- Watch Grafana dashboard: "HTTP 500 Rate" vs "Pod Restart Count".
Verification
- Did the pod restart? Yes.
- Did users see errors? No (Retries worked).
- Result: PASS.
Workflow 3: Zone Outage Simulation (Game Day)
Goal: Verify database failover to secondary region.
Steps:
Preparation
- Notify on-call team (Game Day).
- Ensure primary DB writes are active.
Execution (AWS FIS / Manual)
- Block network traffic to Zone A subnets.
- OR Stop RDS Primary instance (Simulate crash).
Measurement
- Measure RTO (Recovery Time Objective): How long until Secondary becomes Primary? (Target: < 60s).
- Measure RPO (Recovery Point Objective): Any data lost? (Target: 0).
5. Anti-Patterns & Gotchas
❌ Anti-Pattern 1: Testing in Production First
What it looks like:
- Running a "delete database" script in prod without testing in staging.
Why it fails:
- Catastrophic data loss.
- Resume Generating Event (RGE).
Correct approach:
- Dev → Staging → Canary → Prod.
- Verify hypothesis in lower environments first.
❌ Anti-Pattern 2: No Observability
What it looks like:
- Running chaos without dashboards open.
- "I think it worked, the app is slow."
Why it fails:
- You don't know why it failed.
- You can't prove resilience.
Correct approach:
- Observability First: If you can't measure it, don't break it.
❌ Anti-Pattern 3: Random Chaos (Chaos Monkey Style)
What it looks like:
- Killing random things constantly without purpose.
Why it fails:
- Causes alert fatigue.
- Doesn't test specific failure modes (e.g., network partition vs crash).
Correct approach:
- Thoughtful Experiments: Design targeted scenarios (e.g., "What if Redis is slow?"). Random chaos is for maintenance, targeted chaos is for verification.
7. Quality Checklist
Planning:
Safety:
Execution:
Review:
Examples
Example 1: Kubernetes Pod Failure Recovery
Scenario: A microservices platform needs to verify that their cart service handles pod failures gracefully without impacting user checkout flow.
Experiment Design:
- Hypothesis: If a cart-service pod is killed, Kubernetes will reschedule within 5 seconds, and users will see less than 0.1% error rate
- Chaos Injection: Use Chaos Mesh to kill random pods in the production namespace
- Monitoring: Track error rates, pod restart times, and user-facing failures
Execution Results:
- Pod restart time: 3.2 seconds average (within SLA)
- Error rate during experiment: 0.02% (below 0.1% threshold)
- Circuit breakers prevented cascading failures
- Users experienced seamless failover
Lessons Learned:
- Retry logic was working but needed exponential backoff
- Added fallback response for stale cart data
- Created runbook for pod failure scenarios
Example 2: Database Failover Validation
Scenario: A financial services company needs to verify their multi-region database failover meets RTO of 30 seconds and RPO of zero data loss.
Game Day Setup:
- Preparation: Notified all stakeholders, backed up current state
- Primary Zone Blockage: Used AWS FIS to simulate zone failure
- Failover Trigger: Automated failover initiated when health checks failed
- Measurement: Tracked RTO, RPO, and application recovery
Measured Results:
| Metric |
Target |
Actual |
Status |
| RTO |
< 30s |
18s |
✅ PASS |
| RPO |
0 data |
0 data |
✅ PASS |
| Application recovery |
< 60s |
42s |
✅ PASS |
| Data consistency |
100% |
100% |
✅ PASS |
Improvements Identified:
- DNS TTL was too high (5 minutes), reduced to 30 seconds
- Application connection pooling needed pre-warming
- Added health check for database replication lag
Example 3: Third-Party API Dependency Testing
Scenario: A SaaS platform depends on a payment processor API and needs to verify graceful degradation when the API is slow or unavailable.
Fault Injection Strategy:
- Delay Injection: Using Istio to add 5-10 second delays to payment API calls
- Timeout Validation: Verify circuit breakers open within configured timeouts
- Fallback Testing: Ensure users see appropriate error messages
Test Scenarios:
- 50% of requests delayed 10s: Circuit breaker opens, fallback shown
- 100% delay: System degrades gracefully with queue-based processing
- Recovery: System reconnects properly after fault cleared
Results:
- Circuit breaker threshold: 5 consecutive failures (needed adjustment)
- Fallback UI: 94% of users completed purchase via alternative method
- Alert tuning: Reduced false positives by tuning latency thresholds
Best Practices
Experiment Design
- Start with Hypothesis: Define what you expect to happen before running experiments
- Limit Blast Radius: Always start with small scope and expand gradually
- Measure Steady State: Establish baseline metrics before introducing chaos
- Document Everything: Record experiment parameters, expectations, and outcomes
- Iterate and Evolve: Use findings to design more comprehensive experiments
Safety and Controls
- Always Have a Stop Button: Can you abort the experiment immediately?
- Define Rollback Plan: How do you restore normal operations?
- Communication: Notify stakeholders before and during experiments
- Timing: Avoid experiments during critical business periods
- Escalation Path: Know when to stop and call for help
Tool Selection
- Match Tool to Environment: Kubernetes → Chaos Mesh/Litmus, AWS → FIS
- Service Mesh Integration: Use Istio/Linkerd for application-level faults
- Cloud-Native Tools: Leverage managed chaos services where available
- Custom Tools: Build application-specific chaos when needed
- Multi-Cloud: Consider tools that work across cloud providers
Observability Integration
- Pre-Experiment Validation: Ensure dashboards and alerts are working
- Metrics Collection: Capture before/during/after metrics
- Log Analysis: Review logs for unexpected behavior
- Distributed Tracing: Use traces to understand failure propagation
- Alert Validation: Verify alerts fire as expected during experiments
Cultural Aspects
- Blame-Free Post-Mortems: Focus on system improvement, not finger-pointing
- Regular Game Days: Schedule chaos exercises as routine team activities
- Cross-Team Participation: Include on-call, developers, and operations
- Share Learnings: Document and share experiment results broadly
- Reward Resilience: Recognize teams that build resilient systems
1---
2name: chaos-engineer-2
3description: Expert in resilience testing, fault injection, and building anti-fragile systems using controlled experiments.
4metadata:
5 source: https://skillmd.com/skills/aibot88/chaos-engineer-2
6---
7
8# Chaos Engineer
9
10## Purpose
11
12Provides resilience testing and chaos engineering expertise specializing in fault injection, controlled experiments, and anti-fragile system design. Validates system resilience through controlled failure scenarios, failover testing, and game day exercises.
13
14## When to Use
15
16- Verifying system resilience before a major launch
17- Testing failover mechanisms (Database, Region, Zone)
18- Validating alert pipelines (Did PagerDuty fire?)
19- Conducting "Game Days" with engineering teams
20- Implementing automated chaos in CI/CD (Continuous Verification)
21- Debugging elusive distributed system bugs (Race conditions, timeouts)
22
23---
24---
25
26## 2. Decision Framework
27
28### Experiment Design Matrix
29
30```
31What are we testing?
32│
33├─ **Infrastructure Layer**
34│ ├─ Pods/Containers? → **Pod Kill / Container Crash**
35│ ├─ Nodes? → **Node Drain / Reboot**
36│ └─ Network? → **Latency / Packet Loss / Partition**
37│
38├─ **Application Layer**
39│ ├─ Dependencies? → **Block Access to DB/Redis**
40│ ├─ Resources? → **CPU/Memory Stress**
41│ └─ Logic? → **Inject HTTP 500 / Delays**
42│
43└─ **Platform Layer**
44 ├─ IAM? → **Revoke Keys**
45 └─ DNS? → **Block DNS Resolution**
46```
47
48### Tool Selection
49
50| Environment | Tool | Best For |
51|-------------|------|----------|
52| **Kubernetes** | **Chaos Mesh / Litmus** | Native K8s experiments (Network, Pod, IO). |
53| **AWS/Cloud** | **AWS FIS / Gremlin** | Cloud-level faults (AZ outage, EC2 stop). |
54| **Service Mesh** | **Istio Fault Injection** | Application level (HTTP errors, delays). |
55| **Java/Spring** | **Chaos Monkey for Spring** | App-level logic attacks. |
56
57### Blast Radius Control
58
59| Level | Scope | Risk | Approval Needed |
60|-------|-------|------|-----------------|
61| **Local/Dev** | Single container | Low | None |
62| **Staging** | Full cluster | Medium | QA Lead |
63| **Production (Canary)** | 1% Traffic | High | Engineering Director |
64| **Production (Full)** | All Traffic | Critical | VP/CTO (Game Day) |
65
66**Red Flags → Escalate to `sre-engineer`:**
67- No "Stop Button" mechanism available
68- Observability gaps (Blind spots)
69- Cascading failure risk identified without mitigation
70- Lack of backups for stateful data experiments
71
72---
73---
74
75## 4. Core Workflows
76
77### Workflow 1: Kubernetes Pod Chaos (Chaos Mesh)
78
79**Goal:** Verify that the frontend handles backend pod failures gracefully.
80
81**Steps:**
82
831. **Define Experiment (`backend-kill.yaml`)**
84 ```yaml
85 apiVersion: chaos-mesh.org/v1alpha1
86 kind: PodChaos
87 metadata:
88 name: backend-kill
89 namespace: chaos-testing
90 spec:
91 action: pod-kill
92 mode: one
93 selector:
94 namespaces:
95 - prod
96 labelSelectors:
97 app: backend-service
98 duration: "30s"
99 scheduler:
100 cron: "@every 1m"
101 ```
102
1032. **Define Hypothesis**
104 - *If* a backend pod dies, *then* Kubernetes will restart it within 5 seconds, *and* the frontend will retry 500s seamlessly ( < 1% error rate).
105
1063. **Execute & Monitor**
107 - Apply manifest.
108 - Watch Grafana dashboard: "HTTP 500 Rate" vs "Pod Restart Count".
109
1104. **Verification**
111 - Did the pod restart? Yes.
112 - Did users see errors? No (Retries worked).
113 - Result: **PASS**.
114
115---
116---
117
118### Workflow 3: Zone Outage Simulation (Game Day)
119
120**Goal:** Verify database failover to secondary region.
121
122**Steps:**
123
1241. **Preparation**
125 - Notify on-call team (Game Day).
126 - Ensure primary DB writes are active.
127
1282. **Execution (AWS FIS / Manual)**
129 - Block network traffic to Zone A subnets.
130 - OR Stop RDS Primary instance (Simulate crash).
131
1323. **Measurement**
133 - Measure **RTO (Recovery Time Objective):** How long until Secondary becomes Primary? (Target: < 60s).
134 - Measure **RPO (Recovery Point Objective):** Any data lost? (Target: 0).
135
136---
137---
138
139## 5. Anti-Patterns & Gotchas
140
141### ❌ Anti-Pattern 1: Testing in Production First
142
143**What it looks like:**
144- Running a "delete database" script in prod without testing in staging.
145
146**Why it fails:**
147- Catastrophic data loss.
148- Resume Generating Event (RGE).
149
150**Correct approach:**
151- Dev → Staging → Canary → Prod.
152- Verify hypothesis in lower environments first.
153
154### ❌ Anti-Pattern 2: No Observability
155
156**What it looks like:**
157- Running chaos without dashboards open.
158- "I think it worked, the app is slow."
159
160**Why it fails:**
161- You don't know *why* it failed.
162- You can't prove resilience.
163
164**Correct approach:**
165- **Observability First:** If you can't measure it, don't break it.
166
167### ❌ Anti-Pattern 3: Random Chaos (Chaos Monkey Style)
168
169**What it looks like:**
170- Killing random things constantly without purpose.
171
172**Why it fails:**
173- Causes alert fatigue.
174- Doesn't test specific failure modes (e.g., network partition vs crash).
175
176**Correct approach:**
177- **Thoughtful Experiments:** Design targeted scenarios (e.g., "What if Redis is slow?"). Random chaos is for *maintenance*, targeted chaos is for *verification*.
178
179---
180---
181
182## 7. Quality Checklist
183
184**Planning:**
185- [ ] **Hypothesis:** Clearly defined ("If X happens, Y should occur").
186- [ ] **Blast Radius:** Limited (e.g., 1 zone, 1% users).
187- [ ] **Approval:** Stakeholders notified (or scheduled Game Day).
188
189**Safety:**
190- [ ] **Stop Button:** Automated abort script ready.
191- [ ] **Rollback:** Plan to restore state if needed.
192- [ ] **Backup:** Data backed up before stateful experiments.
193
194**Execution:**
195- [ ] **Monitoring:** Dashboards visible during experiment.
196- [ ] **Logging:** Experiment start/end times logged for correlation.
197
198**Review:**
199- [ ] **Fix:** Action items assigned (Jira).
200- [ ] **Report:** Findings shared with engineering team.
201
202## Examples
203
204### Example 1: Kubernetes Pod Failure Recovery
205
206**Scenario:** A microservices platform needs to verify that their cart service handles pod failures gracefully without impacting user checkout flow.
207
208**Experiment Design:**
2091. **Hypothesis**: If a cart-service pod is killed, Kubernetes will reschedule within 5 seconds, and users will see less than 0.1% error rate
2102. **Chaos Injection**: Use Chaos Mesh to kill random pods in the production namespace
2113. **Monitoring**: Track error rates, pod restart times, and user-facing failures
212
213**Execution Results:**
214- Pod restart time: 3.2 seconds average (within SLA)
215- Error rate during experiment: 0.02% (below 0.1% threshold)
216- Circuit breakers prevented cascading failures
217- Users experienced seamless failover
218
219**Lessons Learned:**
220- Retry logic was working but needed exponential backoff
221- Added fallback response for stale cart data
222- Created runbook for pod failure scenarios
223
224### Example 2: Database Failover Validation
225
226**Scenario:** A financial services company needs to verify their multi-region database failover meets RTO of 30 seconds and RPO of zero data loss.
227
228**Game Day Setup:**
2291. **Preparation**: Notified all stakeholders, backed up current state
2302. **Primary Zone Blockage**: Used AWS FIS to simulate zone failure
2313. **Failover Trigger**: Automated failover initiated when health checks failed
2324. **Measurement**: Tracked RTO, RPO, and application recovery
233
234**Measured Results:**
235| Metric | Target | Actual | Status |
236|--------|--------|--------|--------|
237| RTO | < 30s | 18s | ✅ PASS |
238| RPO | 0 data | 0 data | ✅ PASS |
239| Application recovery | < 60s | 42s | ✅ PASS |
240| Data consistency | 100% | 100% | ✅ PASS |
241
242**Improvements Identified:**
243- DNS TTL was too high (5 minutes), reduced to 30 seconds
244- Application connection pooling needed pre-warming
245- Added health check for database replication lag
246
247### Example 3: Third-Party API Dependency Testing
248
249**Scenario:** A SaaS platform depends on a payment processor API and needs to verify graceful degradation when the API is slow or unavailable.
250
251**Fault Injection Strategy:**
2521. **Delay Injection**: Using Istio to add 5-10 second delays to payment API calls
2532. **Timeout Validation**: Verify circuit breakers open within configured timeouts
2543. **Fallback Testing**: Ensure users see appropriate error messages
255
256**Test Scenarios:**
257- 50% of requests delayed 10s: Circuit breaker opens, fallback shown
258- 100% delay: System degrades gracefully with queue-based processing
259- Recovery: System reconnects properly after fault cleared
260
261**Results:**
262- Circuit breaker threshold: 5 consecutive failures (needed adjustment)
263- Fallback UI: 94% of users completed purchase via alternative method
264- Alert tuning: Reduced false positives by tuning latency thresholds
265
266## Best Practices
267
268### Experiment Design
269
270- **Start with Hypothesis**: Define what you expect to happen before running experiments
271- **Limit Blast Radius**: Always start with small scope and expand gradually
272- **Measure Steady State**: Establish baseline metrics before introducing chaos
273- **Document Everything**: Record experiment parameters, expectations, and outcomes
274- **Iterate and Evolve**: Use findings to design more comprehensive experiments
275
276### Safety and Controls
277
278- **Always Have a Stop Button**: Can you abort the experiment immediately?
279- **Define Rollback Plan**: How do you restore normal operations?
280- **Communication**: Notify stakeholders before and during experiments
281- **Timing**: Avoid experiments during critical business periods
282- **Escalation Path**: Know when to stop and call for help
283
284### Tool Selection
285
286- **Match Tool to Environment**: Kubernetes → Chaos Mesh/Litmus, AWS → FIS
287- **Service Mesh Integration**: Use Istio/Linkerd for application-level faults
288- **Cloud-Native Tools**: Leverage managed chaos services where available
289- **Custom Tools**: Build application-specific chaos when needed
290- **Multi-Cloud**: Consider tools that work across cloud providers
291
292### Observability Integration
293
294- **Pre-Experiment Validation**: Ensure dashboards and alerts are working
295- **Metrics Collection**: Capture before/during/after metrics
296- **Log Analysis**: Review logs for unexpected behavior
297- **Distributed Tracing**: Use traces to understand failure propagation
298- **Alert Validation**: Verify alerts fire as expected during experiments
299
300### Cultural Aspects
301
302- **Blame-Free Post-Mortems**: Focus on system improvement, not finger-pointing
303- **Regular Game Days**: Schedule chaos exercises as routine team activities
304- **Cross-Team Participation**: Include on-call, developers, and operations
305- **Share Learnings**: Document and share experiment results broadly
306- **Reward Resilience**: Recognize teams that build resilient systems