skills/devops-sre/chaos-engineering/SKILL.md
Introduces controlled failures to test and enhance system resilience in distributed environments.
npx skillsauth add alphaonedev/openclaw-graph chaos-engineeringInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill enables OpenClaw to simulate failures in distributed systems, such as network partitions or pod kills, to identify weaknesses and improve resilience. It uses tools like Chaos Toolkit or similar integrations to inject faults programmatically.
Use this skill during system testing phases, before production releases, or in response to outages to validate resilience. Apply it in microservices architectures, cloud environments (e.g., Kubernetes), or when dealing with high-availability setups to ensure systems handle failures gracefully.
To run a chaos experiment, first define a configuration file, then execute via CLI. For API usage, authenticate and send requests to trigger events. Always run in a staging environment first. Pattern: Prepare config → Inject fault → Monitor effects → Analyze results. For repeated tests, use loops in scripts to vary parameters like duration or intensity.
Use the OpenClaw CLI for chaos operations, requiring $CHAOS_API_KEY for authentication. Example CLI command:
ocla chaos inject --type network-latency --duration 30s --target pod=myapp-123 --key $CHAOS_API_KEY
API endpoint: POST to /api/v1/chaos/experiments with JSON body:
{ "experiment": "network-partition", "targets": ["service:db"], "duration": 60 }
Config format (YAML snippet):
apiVersion: chaos.openclaw/v1
kind: Experiment
spec:
type: cpu-stress
percentage: 80
To stop an experiment: ocla chaos stop --id exp-456 --key $CHAOS_API_KEY.
Integrate with Kubernetes by setting up a Chaos Engine operator; add annotations to deployments for auto-discovery. For monitoring, link with Prometheus via webhooks: e.g., export metrics to /metrics endpoint. Use environment variables for secrets, like export CHAOS_API_KEY=your-key. In code, import as a module:
import openclaw.chaos as oc
oc.inject_fault(type='pod-kill', target='app-pod')
Ensure compatibility with CI/CD tools by wrapping commands in scripts, e.g., in Jenkins: sh 'ocla chaos inject ...'.
Check for errors like invalid targets or authentication failures; use try-catch in scripts. Example snippet:
try:
ocla chaos inject --type pod-kill --target invalid-pod --key $CHAOS_API_KEY
except subprocess.CalledProcessError as e:
print(f"Error: {e} - Check pod existence and API key")
Common issues: Rate limits (wait and retry), permission denials (verify RBAC), or experiment timeouts (set via --timeout 120s). Log all outputs and use --dry-run flag to preview actions without executing.
ocla chaos inject --type pod-kill --target deployment/myapp --duration 10s --key $CHAOS_API_KEY. Then, verify recovery by checking pod status with kubectl get pods and analyze logs for downtime.ocla chaos run --config path/to/experiment.yaml --key $CHAOS_API_KEY. The YAML might look like: spec: type: network-latency delay: 500ms. Monitor with integrated tools to measure response times before and after.tools
Root web development: project structure, tooling selection, deployment decisions
development
WebAssembly: Rust/Go/C to WASM, wasm-bindgen, Emscripten, WASM Component Model
development
Vue 3: Composition API script setup, Pinia, Vue Router 4, SFCs, Vite, Nuxt 3
tools
Tailwind CSS 4: utility classes, config, JIT, arbitrary values, darkMode, plugins, shadcn/ui