Chaos Mesh in Cloud-Native Engineering
Category: chaos
Status: Incubating
Stars: 9,000
Last Updated: 2026-04-22
Primary Language: Go
Documentation: https://chaos-mesh.org/
Purpose and Use Cases
Chaos Mesh is a Chaos Engineering platform designed specifically for Kubernetes environments, enabling developers to simulate various failure scenarios to test system resilience.
What Problem Does It Solve?
The difficulty of testing distributed system resilience in production-like environments. It provides a declarative way to inject faults and observe system behavior to identify weaknesses.
When to Use This Project
Use Chaos Mesh when you want to test Kubernetes application resilience, simulate network failures, disk failures, pod failures, or need a comprehensive chaos engineering platform for Kubernetes.
Key Use Cases
- Pod Failure Injection: Simulate pod crashes and failures
- Network Chaos: Inject network delays, losses, and partitions
- Disk Chaos: Simulate disk failures and I/O errors
- Time Chaos: Inject time shifts for testing
- Kernel Chaos: Inject kernel failures
- HTTP Chaos: Inject HTTP request errors
- Experiment Scheduling: Schedule chaos experiments
- Workflow Orchestration: Complex chaos workflows
Architecture Design Patterns
Core Components
- Chaos Dashboard: Web UI for experiment management
- Controller Manager: Main controller for chaos experiments
- Scheduler: Schedule chaos experiments
- Chaos Daemon: Node-level chaos injection agent
- API Server: REST API for chaos operations
- Recorder: Record experiment results
Component Interactions
- User → Dashboard: Create and manage experiments
- Dashboard → API Server: REST API calls
- API Server → Controller: Experiment creation
- Controller → Scheduler: Schedule experiments
- Scheduler → Experiments: Execute experiments
- Experiments → Chaos Daemon: Inject chaos on nodes
- Chaos Daemon → Container Runtime: Inject faults
- Recorder → Database: Store experiment results
Data Flow Patterns
- Experiment Creation: Dashboard → API → Controller → Experiment → Scheduler → Execution
- Chaos Injection: Scheduler → Pod/Node → Chaos Daemon → Container Runtime → Fault Injection
- Result Recording: Experiment → Recorder → Database → Dashboard display
- Experiment Scheduling: Schedule request → Time-based scheduling → Execution → Cleanup
Design Principles
- Kubernetes Native: Uses CRDs and Kubernetes API
- Declarative: Chaos experiments as YAML manifests
- Extensible: Custom chaos experiments and actions
- Safe: Experiment rollback and safety controls
- Observability: Experiment results and metrics
- Flexible: Support for multiple chaos types
Integration Approaches
Integration with Other CNCF Projects
- Kubernetes: Core platform for chaos injection
- Prometheus: Chaos metrics collection
- Grafana: Chaos experiment visualization
- OpenTelemetry: Chaos tracing
- Argo Workflows: Chaos workflow integration
- Tekton: CI/CD chaos testing
- Jaeger: Distributed tracing for chaos
- Helm: Chaos Mesh deployment
API Patterns
- Kubernetes API: CRD operations for experiments
- REST API: Dashboard API
- Webhook API: Experiment notifications
- gRPC API: Internal service communication
Configuration Patterns
- Experiment YAML: Declarative chaos experiments
- Schedule YAML: Experiment scheduling configuration
- Workflow YAML: Chaos workflow definitions
- Controller Configuration: Controller settings
Extension Mechanisms
- Custom Chaos Types: Implement custom chaos experiments
- Webhooks: Custom notification hooks
- Metrics Collectors: Custom metrics collection
Common Pitfalls and How to Avoid Them
Configuration Issues
- Experiment YAML: Incorrect chaos experiment definitions
- Role-Based Access: Missing RBAC permissions
- Chaos Daemon: Daemon not running on nodes
- Scheduler Configuration: Incorrect scheduling configuration
- Network Policies: Blocking chaos daemon communication
Performance Issues
- Experiment Overhead: High resource usage during chaos
- Controller Load: High reconciliation overhead
- Network Latency: Chaos impact on network
- Disk I/O: Chaos impact on disk performance
Operational Challenges
- Experiment Rollback: Manual rollback when needed
- Experiment Safety: Unintended chaos effects
- Multi-Cluster: Chaos across multiple clusters
- Experiment Replay: Re-run experiments
- Result Analysis: Analyze chaos results
Security Pitfalls
- RBAC: Overly permissive chaos permissions
- Network Isolation: Chaos affecting production networks
- Experiment Scope: Too broad experiment scope
- Access Control: Unauthorized chaos execution
Coding Practices
Idiomatic Configuration
- Experiment CRDs: Declarative chaos experiments
- Schedule CRDs: Declarative scheduling
- Workflow CRDs: Chaos workflow definitions
- Controller Config: Controller configuration
API Usage Patterns
- kubectl apply: Create and update experiments
- Dashboard API: Programmatic experiment management
- Controller API: Experiment control API
- Recorder API: Results access API
Observability Best Practices
- Metrics: Experiment duration, success rate, failure rate
- Logging: Experiment execution logs
- Tracing: Chaos execution tracing
- Dashboard: Visual experiment monitoring
- Alerting: Experiment failure alerts
Development Workflow
- Local Testing: minikube/kind for development
- Debugging: Experiment logs inspection
- Testing: Chaos experiment testing
- CI/CD: Automated chaos testing
- Tools: kubectl, chaos-dashboard, chaos-controller
Fundamentals
Essential Concepts
- Experiment: Chaos experiment definition
- Schedule: Scheduled experiment execution
- Workflow: Complex chaos workflow
- Chaos Daemon: Node-level chaos agent
- Scheduler: Experiment scheduling service
- Recorder: Results recording service
Terminology Glossary
- Experiment: Chaos experiment definition
- Schedule: Scheduled execution
- Workflow: Complex chaos flow
- Chaos Daemon: Node agent
- Scheduler: Scheduling service
- Recorder: Results storage
Data Models and Types
- Experiment: Chaos experiment configuration
- Schedule: Schedule configuration
- Workflow: Workflow definition
- Recorder: Results data
- Status: Experiment status
Lifecycle Management
- Experiment Lifecycle: Create → Schedule → Execute → Complete → Cleanup
- Schedule Lifecycle: Schedule → Trigger → Execute → Complete
- Workflow Lifecycle: Create → Run → Complete → Record
State Management
- Experiment State: Current experiment status
- Schedule State: Scheduled execution state
- Workflow State: Workflow execution state
- Recorder State: Results storage state
Scaling and Deployment Patterns
Horizontal Scaling
- Controller Scaling: Multiple controller replicas
- Scheduler Scaling: Multiple scheduler instances
- Daemon Scaling: Chaos daemon scaling
- Dashboard Scaling: Dashboard server scaling
High Availability
- Controller HA: Multiple controller replicas
- Scheduler HA: Scheduler cluster
- Daemon HA: Daemon on all nodes
- Dashboard HA: Dashboard server HA
- Storage HA: etcd HA for state
Production Deployments
- Controller Deployment: Production controller setup
- Chaos Daemon: Node-level deployment
- Network Policies: Allow chaos communication
- RBAC: Proper access control
- Monitoring: Experiment monitoring
- Security: Security scanning
Upgrade Strategies
- CRD Migration: Handle CRD schema changes
- Controller Rolling Update: Zero-downtime updates
- Daemon Rollout: Daemon update strategy
- Dashboard Update: Dashboard upgrade
Resource Management
- CPU/Memory Limits: Appropriate resource requests
- Storage: Experiment state storage
- Network: Daemon communication
- Disk I/O: Chaos impact management
Additional Resources
Troubleshooting
Common Issues
Deployment Failures
- Check pod logs for errors
- Verify configuration values
- Ensure network connectivity
Performance Issues
- Monitor resource usage
- Adjust resource limits
- Check for bottlenecks
Configuration Errors
- Validate YAML syntax
- Check required fields
- Verify environment-specific settings
Integration Problems
- Verify API compatibility
- Check dependency versions
- Review integration documentation
Getting Help
- Check official documentation
- Search GitHub issues
- Join community channels
- Review logs and metrics
Content generated automatically. Verify against official documentation before production use.
Examples
Basic Configuration
# Basic configuration example
apiVersion: v1
kind: ConfigMap
metadata:
name: {{project_name}}-config
namespace: default
data:
# Configuration goes here
config.yaml: |
# Base configuration
# Add your settings here
Kubernetes Deployment
# Kubernetes deployment for {{project_name}}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{project_name}}
namespace: default
spec:
replicas: 1
selector:
matchLabels:
app: {{project_name}}
template:
metadata:
labels:
app: {{project_name}}
spec:
containers:
- name: {{project_name}}
image: {{project_name}}:latest
ports:
- containerPort: 8080
resources:
limits:
memory: "128Mi"
cpu: "500m"
Kubernetes Service
# Kubernetes service for {{project_name}}
apiVersion: v1
kind: Service
metadata:
name: {{project_name}}
namespace: default
spec:
selector:
app: {{project_name}}
ports:
- protocol: TCP
port: 80
targetPort: 8080
type: ClusterIP
When to Use
Use this skill when:
- Integrating a CNCF project into Kubernetes infrastructure — You need to configure, deploy, or troubleshoot a cloud-native tool within a cluster
- Designing cloud-native architecture — You are selecting and integrating CNCF tools to solve specific infrastructure challenges
- Resolving operational issues — A CNCF component is misbehaving, underperforming, or needs configuration changes
Core Workflow
Assess Requirements — Understand the use case, scale, integration needs, and existing infrastructure. Checkpoint: Document requirements, constraints, and success criteria.
Design Architecture — Plan component interactions, data flow, and deployment strategy using cloud-native best practices. Checkpoint: Verify the architecture addresses all requirements and follows CNCF conventions.
Implement & Configure — Create manifests, configurations, and deployment scripts. Include resource limits, health checks, and observability hooks. Checkpoint: Validate all YAML against schema and test in a staging environment.
Deploy & Monitor — Apply manifests to the cluster, verify component health, and confirm observability is working. Checkpoint: Confirm all pods/services are running, probes passing, and metrics/alerts configured.
Constraints
MUST DO
- Include at least one complete working YAML manifest example
- Note when content is auto-generated vs. manually verified
- Reference relevant CNCF project documentation
MUST NOT DO
- Deploy manifests without testing in a staging environment first
- Use deprecated API versions (e.g., apps/v1beta1)
- Omit resource limits and requests in Kubernetes manifests
1---2name: chaosmesh3description: Chaos Mesh in Cloud-Native Engineering4---56789# Chaos Mesh in Cloud-Native Engineering1011**Category:** chaos 12**Status:** Incubating 13**Stars:** 9,000 14**Last Updated:** 2026-04-22 15**Primary Language:** Go 16**Documentation:** [https://chaos-mesh.org/](https://chaos-mesh.org/) 1718---1920## Purpose and Use Cases2122Chaos Mesh is a Chaos Engineering platform designed specifically for Kubernetes environments, enabling developers to simulate various failure scenarios to test system resilience.2324### What Problem Does It Solve?2526The difficulty of testing distributed system resilience in production-like environments. It provides a declarative way to inject faults and observe system behavior to identify weaknesses.2728### When to Use This Project2930Use Chaos Mesh when you want to test Kubernetes application resilience, simulate network failures, disk failures, pod failures, or need a comprehensive chaos engineering platform for Kubernetes.3132### Key Use Cases333435- **Pod Failure Injection**: Simulate pod crashes and failures36- **Network Chaos**: Inject network delays, losses, and partitions37- **Disk Chaos**: Simulate disk failures and I/O errors38- **Time Chaos**: Inject time shifts for testing39- **Kernel Chaos**: Inject kernel failures40- **HTTP Chaos**: Inject HTTP request errors41- **Experiment Scheduling**: Schedule chaos experiments42- **Workflow Orchestration**: Complex chaos workflows434445---4647## Architecture Design Patterns4849### Core Components5051- **Chaos Dashboard**: Web UI for experiment management52- **Controller Manager**: Main controller for chaos experiments53- **Scheduler**: Schedule chaos experiments54- **Chaos Daemon**: Node-level chaos injection agent55- **API Server**: REST API for chaos operations56- **Recorder**: Record experiment results5758### Component Interactions59601. **User → Dashboard**: Create and manage experiments612. **Dashboard → API Server**: REST API calls623. **API Server → Controller**: Experiment creation634. **Controller → Scheduler**: Schedule experiments645. **Scheduler → Experiments**: Execute experiments656. **Experiments → Chaos Daemon**: Inject chaos on nodes667. **Chaos Daemon → Container Runtime**: Inject faults678. **Recorder → Database**: Store experiment results6869### Data Flow Patterns70711. **Experiment Creation**: Dashboard → API → Controller → Experiment → Scheduler → Execution722. **Chaos Injection**: Scheduler → Pod/Node → Chaos Daemon → Container Runtime → Fault Injection733. **Result Recording**: Experiment → Recorder → Database → Dashboard display744. **Experiment Scheduling**: Schedule request → Time-based scheduling → Execution → Cleanup7576### Design Principles7778- **Kubernetes Native**: Uses CRDs and Kubernetes API79- **Declarative**: Chaos experiments as YAML manifests80- **Extensible**: Custom chaos experiments and actions81- **Safe**: Experiment rollback and safety controls82- **Observability**: Experiment results and metrics83- **Flexible**: Support for multiple chaos types8485---8687## Integration Approaches8889### Integration with Other CNCF Projects9091- **Kubernetes**: Core platform for chaos injection92- **Prometheus**: Chaos metrics collection93- **Grafana**: Chaos experiment visualization94- **OpenTelemetry**: Chaos tracing95- **Argo Workflows**: Chaos workflow integration96- **Tekton**: CI/CD chaos testing97- **Jaeger**: Distributed tracing for chaos98- **Helm**: Chaos Mesh deployment99100### API Patterns101102- **Kubernetes API**: CRD operations for experiments103- **REST API**: Dashboard API104- **Webhook API**: Experiment notifications105- **gRPC API**: Internal service communication106107### Configuration Patterns108109- **Experiment YAML**: Declarative chaos experiments110- **Schedule YAML**: Experiment scheduling configuration111- **Workflow YAML**: Chaos workflow definitions112- **Controller Configuration**: Controller settings113114### Extension Mechanisms115116- **Custom Chaos Types**: Implement custom chaos experiments117- **Webhooks**: Custom notification hooks118- **Metrics Collectors**: Custom metrics collection119120---121122## Common Pitfalls and How to Avoid Them123124### Configuration Issues125126- **Experiment YAML**: Incorrect chaos experiment definitions127- **Role-Based Access**: Missing RBAC permissions128- **Chaos Daemon**: Daemon not running on nodes129- **Scheduler Configuration**: Incorrect scheduling configuration130- **Network Policies**: Blocking chaos daemon communication131132### Performance Issues133134- **Experiment Overhead**: High resource usage during chaos135- **Controller Load**: High reconciliation overhead136- **Network Latency**: Chaos impact on network137- **Disk I/O**: Chaos impact on disk performance138139### Operational Challenges140141- **Experiment Rollback**: Manual rollback when needed142- **Experiment Safety**: Unintended chaos effects143- **Multi-Cluster**: Chaos across multiple clusters144- **Experiment Replay**: Re-run experiments145- **Result Analysis**: Analyze chaos results146147### Security Pitfalls148149- **RBAC**: Overly permissive chaos permissions150- **Network Isolation**: Chaos affecting production networks151- **Experiment Scope**: Too broad experiment scope152- **Access Control**: Unauthorized chaos execution153154---155156## Coding Practices157158### Idiomatic Configuration159160- **Experiment CRDs**: Declarative chaos experiments161- **Schedule CRDs**: Declarative scheduling162- **Workflow CRDs**: Chaos workflow definitions163- **Controller Config**: Controller configuration164165### API Usage Patterns166167- **kubectl apply**: Create and update experiments168- **Dashboard API**: Programmatic experiment management169- **Controller API**: Experiment control API170- **Recorder API**: Results access API171172### Observability Best Practices173174- **Metrics**: Experiment duration, success rate, failure rate175- **Logging**: Experiment execution logs176- **Tracing**: Chaos execution tracing177- **Dashboard**: Visual experiment monitoring178- **Alerting**: Experiment failure alerts179180### Development Workflow181182- **Local Testing**: minikube/kind for development183- **Debugging**: Experiment logs inspection184- **Testing**: Chaos experiment testing185- **CI/CD**: Automated chaos testing186- **Tools**: kubectl, chaos-dashboard, chaos-controller187188---189190## Fundamentals191192### Essential Concepts193194- **Experiment**: Chaos experiment definition195- **Schedule**: Scheduled experiment execution196- **Workflow**: Complex chaos workflow197- **Chaos Daemon**: Node-level chaos agent198- **Scheduler**: Experiment scheduling service199- **Recorder**: Results recording service200201### Terminology Glossary202203- **Experiment**: Chaos experiment definition204- **Schedule**: Scheduled execution205- **Workflow**: Complex chaos flow206- **Chaos Daemon**: Node agent207- **Scheduler**: Scheduling service208- **Recorder**: Results storage209210### Data Models and Types211212- **Experiment**: Chaos experiment configuration213- **Schedule**: Schedule configuration214- **Workflow**: Workflow definition215- **Recorder**: Results data216- **Status**: Experiment status217218### Lifecycle Management219220- **Experiment Lifecycle**: Create → Schedule → Execute → Complete → Cleanup221- **Schedule Lifecycle**: Schedule → Trigger → Execute → Complete222- **Workflow Lifecycle**: Create → Run → Complete → Record223224### State Management225226- **Experiment State**: Current experiment status227- **Schedule State**: Scheduled execution state228- **Workflow State**: Workflow execution state229- **Recorder State**: Results storage state230231---232233## Scaling and Deployment Patterns234235### Horizontal Scaling236237- **Controller Scaling**: Multiple controller replicas238- **Scheduler Scaling**: Multiple scheduler instances239- **Daemon Scaling**: Chaos daemon scaling240- **Dashboard Scaling**: Dashboard server scaling241242### High Availability243244- **Controller HA**: Multiple controller replicas245- **Scheduler HA**: Scheduler cluster246- **Daemon HA**: Daemon on all nodes247- **Dashboard HA**: Dashboard server HA248- **Storage HA**: etcd HA for state249250### Production Deployments251252- **Controller Deployment**: Production controller setup253- **Chaos Daemon**: Node-level deployment254- **Network Policies**: Allow chaos communication255- **RBAC**: Proper access control256- **Monitoring**: Experiment monitoring257- **Security**: Security scanning258259### Upgrade Strategies260261- **CRD Migration**: Handle CRD schema changes262- **Controller Rolling Update**: Zero-downtime updates263- **Daemon Rollout**: Daemon update strategy264- **Dashboard Update**: Dashboard upgrade265266### Resource Management267268- **CPU/Memory Limits**: Appropriate resource requests269- **Storage**: Experiment state storage270- **Network**: Daemon communication271- **Disk I/O**: Chaos impact management272273---274275## Additional Resources276277- **Official Documentation:** [https://chaos-mesh.org/docs/](https://chaos-mesh.org/docs/)278- **GitHub Repository:** [github.com/chaos-mesh/chaos-mesh](https://github.com/chaos-mesh/chaos-mesh)279- **CNCF Project Page:** [cncf.io/projects/chaosmesh/](https://www.cncf.io/projects/chaosmesh/)280- **Community:** Check the GitHub repository for community channels281- **Versioning:** Refer to project's release notes for version-specific features282283---284285## Troubleshooting286287### Common Issues2882891. **Deployment Failures**290 - Check pod logs for errors291 - Verify configuration values292 - Ensure network connectivity2932942. **Performance Issues**295 - Monitor resource usage296 - Adjust resource limits297 - Check for bottlenecks2982993. **Configuration Errors**300 - Validate YAML syntax301 - Check required fields302 - Verify environment-specific settings3033044. **Integration Problems**305 - Verify API compatibility306 - Check dependency versions307 - Review integration documentation308309### Getting Help310311- Check official documentation312- Search GitHub issues313- Join community channels314- Review logs and metrics315*Content generated automatically. Verify against official documentation before production use.*316317## Examples318319### Basic Configuration320321322```yaml323# Basic configuration example324apiVersion: v1325kind: ConfigMap326metadata:327 name: {{project_name}}-config328 namespace: default329data:330 # Configuration goes here331 config.yaml: |332 # Base configuration333 # Add your settings here334```335336### Kubernetes Deployment337338339```yaml340# Kubernetes deployment for {{project_name}}341apiVersion: apps/v1342kind: Deployment343metadata:344 name: {{project_name}}345 namespace: default346spec:347 replicas: 1348 selector:349 matchLabels:350 app: {{project_name}}351 template:352 metadata:353 labels:354 app: {{project_name}}355 spec:356 containers:357 - name: {{project_name}}358 image: {{project_name}}:latest359 ports:360 - containerPort: 8080361 resources:362 limits:363 memory: "128Mi"364 cpu: "500m"365```366367### Kubernetes Service368369370```yaml371# Kubernetes service for {{project_name}}372apiVersion: v1373kind: Service374metadata:375 name: {{project_name}}376 namespace: default377spec:378 selector:379 app: {{project_name}}380 ports:381 - protocol: TCP382 port: 80383 targetPort: 8080384 type: ClusterIP385```386387---388389## When to Use390391Use this skill when:392393- **Integrating a CNCF project into Kubernetes infrastructure** — You need to configure, deploy, or troubleshoot a cloud-native tool within a cluster394- **Designing cloud-native architecture** — You are selecting and integrating CNCF tools to solve specific infrastructure challenges395- **Resolving operational issues** — A CNCF component is misbehaving, underperforming, or needs configuration changes396---397398## Core Workflow3994001. **Assess Requirements** — Understand the use case, scale, integration needs, and existing infrastructure. **Checkpoint:** Document requirements, constraints, and success criteria.4014022. **Design Architecture** — Plan component interactions, data flow, and deployment strategy using cloud-native best practices. **Checkpoint:** Verify the architecture addresses all requirements and follows CNCF conventions.4034043. **Implement & Configure** — Create manifests, configurations, and deployment scripts. Include resource limits, health checks, and observability hooks. **Checkpoint:** Validate all YAML against schema and test in a staging environment.4054064. **Deploy & Monitor** — Apply manifests to the cluster, verify component health, and confirm observability is working. **Checkpoint:** Confirm all pods/services are running, probes passing, and metrics/alerts configured.407408---409410## Constraints411412### MUST DO413- Include at least one complete working YAML manifest example414- Note when content is auto-generated vs. manually verified415- Reference relevant CNCF project documentation416417### MUST NOT DO418- Deploy manifests without testing in a staging environment first419- Use deprecated API versions (e.g., apps/v1beta1)420- Omit resource limits and requests in Kubernetes manifests