chaos-infrastructure-faults
Skill19 starsChanged 6 months agoMITView on GitHub
Design and execute infrastructure-level chaos experiments targeting nodes, disks, CPU, memory, network, and cloud resources. Use this skill whenever the user says "test node failure", "drain a node", "fill disk", "test CPU exhaustion", "simulate AZ failure", "stop EC2 instances", or needs infrastructure-level fault injection manifests for LitmusChaos or Harness Chaos Engineering. Also trigger as part of the chaos experiment design phase (s16 follows s12).
- Deletes or force-pushes
In this repository37 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- workflow-orchestratorSkill
- user-flow-writingSkill
- ba-requirements-analysisSkill
- taste-memory-managementSkill
- progress-trackerSkill
- harness-pipeline-designSkill
- harness-service-onboardingSkill
- harness-delegate-managementSkill
- harness-secrets-managementSkill
- harness-feature-flagsSkill
- harness-template-librarySkill
- harness-gitopsSkill
- security-scanningSkill
- cloakbrowser-testingSkill
- performance-load-testingSkill
- chaos-experiment-designSkill
- chaos-hypothesis-validationSkill
- chaos-blast-radius-controlSkill
- chaos-steady-state-definitionSkill
- chaos-application-faultsSkill
- chaos-game-day-planningSkill
- harness-cv-verificationSkill
- chaos-observability-integrationSkill
- alerting-recommendationsSkill
- harness-policy-governanceSkill
- harness-cloud-costSkill
- chaos-resilience-scoringSkill
- chaos-postmortem-learningSkill
- release-managementSkill
- disaster-recovery-business-continuitySkill
- compliance-auditSkill
- strategic-creatorSkill
- deep-researchSkill
- system-optimizationSkill
- documentation-writingSkill
- devils-advocateSkill
The file
Files
Chaos Infrastructure Faults (s16)
Purpose
Produce complete, safe, runnable infrastructure-level chaos experiments that test system resilience against node failures, resource exhaustion, disk pressure, and cloud provider outages.
Prerequisites
- Chaos experiment designs from s14 (Experiment Design)
- Delegate configured from s06 (Delegate Management)
- Kubernetes cluster access for infrastructure operations
- Steady state defined from s17 (Steady State)
- Blast radius approved from s16 (Blast Radius Control)
- Observability active and monitoring targets
Input Contract
| Input | Source | Required |
| Experiment design framework | s12 (workflow_context.artifacts) | Yes |
| Blast radius constraints | s14 output | Yes |
| Infrastructure topology (nodes, AZs, regions) | s01 or s05 context | Yes |
| Cloud provider (AWS/GCP/Azure) | s01 context | Yes |
| Risk tolerance (prod limits) | s02 taste (risk_tolerance) | Yes |
| Delegate/cluster access info | s06 output | Yes |
Output Contract
| Output | Destination | Format |
| Infra fault ChaosExperiments | .commandcode/artifacts/experiment-infra-<fault>.yaml | Litmus YAML |
| Infra fault ChaosEngines | .commandcode/artifacts/engine-infra-<fault>.yaml | Litmus YAML |
| Cloud-specific fault configs | .commandcode/artifacts/experiment-<cloud>-<fault>.yaml | YAML |
| Recovery runbook | s18 (game day), s25 (postmortem) | Markdown |
| Infra fault risk assessment | s21 (alerting context) | YAML |
Infrastructure Fault Catalog
| Fault | LitmusChaos Name | Risk Level | Min Replicas | Prod Safe? |
| Node CPU Hog | node-cpu-hog | Medium | 3+ nodes | With 30% max |
| Node Memory Hog | node-memory-hog | Medium | 3+ nodes | With 30% max |
| Node Drain | node-drain | High | 3+ nodes | With PDB + approval |
| Node Restart | node-restart | Critical | 3+ nodes | No (staging only) |
| Disk Fill | disk-fill | High | N/A | With ephemeral only |
| Disk Loss (EBS) | ebs-loss | Critical | N/A | No (staging only) |
| EC2 Stop (AWS) | ec2-stop | Critical | N/A | No (staging only) |
| AZ Failure (AWS) | — (composite) | Extreme | Multi-AZ | Game day only |
| GCP VM Stop | gcp-vm-stop | Critical | N/A | No (staging only) |
| Azure VM Stop | azure-vm-stop | Critical | N/A | No (staging only) |
Fault 1: Node CPU Hog
# Generated by: hybrid-harness-chaos-process-prm
apiVersion: litmuschaos.io/v1alpha1
kind: ChaosExperiment
metadata:
name: node-cpu-hog
namespace: litmus
labels:
managed-by: hcprm
fault-category: infrastructure
fault-type: resource-exhaustion
spec:
definition:
scope: Cluster
permissions:
- apiGroups: [""]
resources: ["nodes"]
verbs: ["get", "list", "patch"]
- apiGroups: ["litmuschaos.io"]
resources: ["chaosengines", "chaosexperiments", "chaosresults"]
verbs: ["create", "get", "list", "patch", "update", "watch"]
image: litmuschaos/go-runner:latest
args: ["-c", "./experiments/node-cpu-hog"]
command: ["/bin/bash"]
env:
- name: TOTAL_CHAOS_DURATION
value: "120"
- name: CPU_CORES
value: "2" # Number of cores to consume
- name: CPU_LOAD
value: "80" # Percentage load on those cores
- name: TARGET_NODES
value: "" # Empty = random selection
- name: NODE_AFFECTED_PERC
value: "33" # % of nodes to target
- name: NODE_LABEL
value: "" # Optional: target specific nodes
- name: RAMP_TIME
value: "30"apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata:
name: node-cpu-hog-engine
namespace: litmus
labels:
managed-by: hcprm
spec:
appinfo:
appns: litmus
applabel: "app=chaos-runner"
appkind: deployment
chaosServiceAccount: litmus-cluster-scope # Cluster-level SA required
monitoring: true
jobCleanUpPolicy: retain
annotationCheck: "false" # Infrastructure — pods not required
engineState: active
experiments:
- name: node-cpu-hog
spec:
probe:
- name: node-health-check
type: cmdProbe
mode: Continuous
cmdProbe/inputs:
command: |
kubectl get nodes --no-headers | awk '{print $2}' | grep -cv Ready
comparator:
type: int
criteria: "<="
value: "1" # At most 1 node can be NotReady
runProperties:
probeTimeout: 10s
interval: 15s
retry: 2
stopOnFailure: true
- name: cluster-cpu-check
type: promProbe
mode: Continuous
promProbe/inputs:
endpoint: "http://prometheus.monitoring.svc.cluster.local:9090"
query: |
100 - avg(rate(node_cpu_seconds_total{mode="idle"}[2m])) * 100
comparator:
type: float
criteria: "<="
value: "90"
runProperties:
probeTimeout: 10s
interval: 15s
retry: 2
stopOnFailure: true
components:
env:
- name: TOTAL_CHAOS_DURATION
value: "120"
- name: CPU_CORES
value: "2"
- name: CPU_LOAD
value: "80"
- name: NODE_AFFECTED_PERC
value: "33"Fault 2: Node Drain
apiVersion: litmuschaos.io/v1alpha1
kind: ChaosExperiment
metadata:
name: node-drain
namespace: litmus
labels:
managed-by: hcprm
fault-category: infrastructure
fault-type: node-failure
spec:
definition:
scope: Cluster
env:
- name: TOTAL_CHAOS_DURATION
value: "300" # 5 minutes of drain
- name: TARGET_NODE
value: "" # Target specific node or random
- name: DRAIN_TIMEOUT
value: "240" # Max wait for pods to evict
- name: NODE_LABEL
value: "" # Filter by label
- name: FORCE
value: "false" # Force drain even with PDB violationsPre-drain safety checks:
#!/bin/bash
# pre-drain-check.sh
TARGET_NODE="${1:?Usage: $0 <node-name>}"
echo "=== Pre-Drain Safety Check for $TARGET_NODE ==="
# 1. Verify cluster has >= 3 healthy nodes
HEALTHY_NODES=$(kubectl get nodes --no-headers | grep -c Ready)
if [ "$HEALTHY_NODES" -lt 3 ]; then
echo "❌ ABORT: Only $HEALTHY_NODES healthy nodes (need ≥ 3)"
exit 1
fi
# 2. Verify no single-replica stateful pods on target node
SINGLE_REPLICAS=$(kubectl get pods --all-namespaces --field-selector spec.nodeName=$TARGET_NODE \
-o json | jq -r '.items[] | select(.metadata.ownerReferences[].kind=="StatefulSet") | "\(.metadata.namespace)/\(.metadata.name)"')
if [ -n "$SINGLE_REPLICAS" ]; then
echo "⚠️ Stateful pods on target node:"
echo "$SINGLE_REPLICAS"
echo "Verify these have >1 replicas before draining."
fi
# 3. Verify PodDisruptionBudgets won't block drain
kubectl get pdb --all-namespaces | awk '$4 > 0 {print "⚠️ " $1 "/" $2 " allows " $4 " disruptions"}'
echo "✅ Pre-drain checks passed"Fault 3: Disk Fill
apiVersion: litmuschaos.io/v1alpha1
kind: ChaosExperiment
metadata:
name: disk-fill
namespace: litmus
labels:
managed-by: hcprm
fault-category: infrastructure
fault-type: storage-exhaustion
spec:
definition:
scope: Namespaced
env:
- name: TOTAL_CHAOS_DURATION
value: "180"
- name: FILL_PERCENTAGE
value: "80" # Fill to 80% of available space
- name: EPHEMERAL_STORAGE_MEBIBYTES
value: "1024" # Use 1GB ephemeral storage
- name: TARGET_PODS
value: ""
- name: PODS_AFFECTED_PERC
value: "100"
- name: CONTAINER_PATH
value: "/var/lib/data" # Path inside container to fill
- name: DATA_BLOCK_SIZE
value: "256" # Block size in KBFault 4: AWS EC2 Stop (Cloud-Level)
apiVersion: litmuschaos.io/v1alpha1
kind: ChaosExperiment
metadata:
name: ec2-stop-by-tag
namespace: litmus
labels:
managed-by: hcprm
fault-category: cloud
fault-type: instance-failure
spec:
definition:
scope: Cluster
env:
- name: TOTAL_CHAOS_DURATION
value: "180"
- name: EC2_INSTANCE_TAG
value: "chaos-target:true"
- name: INSTANCE_AFFECTED_PERC
value: "25"
- name: REGION
value: "us-east-1"Cloud Provider IAM Requirements
AWS
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ec2:StopInstances",
"ec2:StartInstances",
"ec2:DescribeInstances",
"ec2:DescribeInstanceStatus"
],
"Resource": "*",
"Condition": {
"StringEquals": {
"aws:RequestedRegion": "us-east-1"
}
}
}
]
}GCP
# Service account roles required:
# - Compute Instance Admin (v1) — for VM stop/start
# - Compute Viewer — for describe/listAzure
{
"role": "Virtual Machine Contributor",
"scope": "/subscriptions/<SUB_ID>/resourceGroups/<RG>"
}Recovery Procedures
Node CPU Hog Recovery
# CPU hog is self-recovering — process terminates at end of chaos duration
# Verify node CPU returns to baseline:
kubectl top nodes | grep <NODE_NAME>
# Expected: CPU% returns to pre-chaos levels within 60sNode Drain Recovery
# Uncordon the node:
kubectl uncordon <NODE_NAME>
# Verify pods reschedule:
kubectl get pods --all-namespaces --field-selector spec.nodeName=<NODE_NAME> -w
# Verify node is Ready:
kubectl get node <NODE_NAME>Disk Fill Recovery
# Chaos runner cleans up the filled data automatically
# Verify disk usage returns to normal:
kubectl exec -it <POD_NAME> -- df -h <CONTAINER_PATH>
# If manual cleanup needed:
kubectl exec -it <POD_NAME> -- rm -rf /var/lib/data/diskfill/*Risk Matrix
| Fault | Dev Risk | Staging Risk | Prod Risk | Recommended Gates |
| Node CPU Hog (30%) | Low | Low | Low | PDB + 3+ nodes |
| Node CPU Hog (80%) | Medium | Medium | High | SRE approval + PDB |
| Node Memory Hog | Medium | Medium | High | SRE approval + PDB |
| Node Drain | High | Medium | Critical | SRE + CTO approval |
| Disk Fill | Medium | Medium | High | Ephemeral only in prod |
| EC2/EBS Stop | Critical | High | Extreme | Game day only, full backup |
AI Agent Integration
Autonomy Level
| Aspect | Level | Description |
| Current | L1 | AI generates infrastructure fault manifests |
| Target | L2 | AI targets infra components and generates fault YAML |
Harness AI Agent
Agent: Harness AI Reliability Agent Capabilities:
- Infrastructure fault manifest generation
- Node/disk/CPU/cloud fault targeting
- Fault parameter optimization
Human Gates
- Production infrastructure fault approval
- Cloud provider fault approval (EC2 stop, etc.)
MCP
- LitmusChaos MCP
- AWS FIS + Amazon Bedrock (natural language experiment generation)
Success Criteria
- All fault manifests validate with
kubectl apply --dry-run=client - Pre-flight safety checks script created and tested
- Node drain tested in dev with PDB verification
- Recovery runbook documented per fault type
- Cloud provider IAM roles configured correctly
- At least one Continuous probe per experiment with
stopOnFailure: true - Infrastructure faults only run after application faults pass
- Production infrastructure faults require explicit game day approval
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

