Chaos Mesh
Chaos Mesh is an open-source chaos engineering platform for Kubernetes.. It offers various types of fault simulation and has an enormous capability to orchestrate fault scenarios.
With Chaos Mesh, you can:
- Simulate failures in Pods (kill pods , JVM Fault)
- NetworkChaos -> Latency, packet loss, network partition, attact
- IOChaos -> Disk read/write errors
- StressChaos -> CPU or memory pressure
- DNSChaos -> DNS resolution failures
- Measure how your system responds
- Schedule and visualize experiments through a user-friendly dashboard
Arhitecture
Chaos Dashboard: The visualization component of Chaos Mesh.
Chaos Controller Manager: The core logical component of Chaos Mesh. management of Chaos experiments. This component contains several CRD Controllers, such as Workflow Controller, Scheduler Controller, and Controllers of various fault types.
Get ÖMER FARUK İÇEN’s stories in your inbox
Join Medium for free to get updates from this writer.
Chaos Daemon: The main executive component. Chaos Daemon runs in the DaemonSet mode
Quick Start
helm install chaos-mesh chaos-mesh/chaos-mesh -n=chaos-mesh --set chaosDaemon.runtime=containerd --set chaosDaemon.socketPath=/run/containerd/containerd.sock --version 2.8.0kubectl apply -f - <<EOF
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: clusterrole-chaos-mesh-manager-nugyl
rules:
- apiGroups: [""]
resources: ["pods", "namespaces", "nodes"]
verbs: ["get", "watch", "list"]
- apiGroups: ["chaos-mesh.org"]
resources: ["*"]
verbs: ["get", "list", "watch", "create", "delete", "patch", "update"]
EOFkubectl apply -f - <<EOF
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: clusterrolebinding-chaos-mesh-manager-nugyl
subjects:
- kind: ServiceAccount
name: account-chaos-mesh-manager-nugyl
namespace: chaos-mesh
roleRef:
kind: ClusterRole
name: clusterrole-chaos-mesh-manager-nugyl
apiGroup: rbac.authorization.k8s.io
EOFkubectl get pods -n chaos-mesh -l app.kubernetes.io/instance=chaos-mesh
kubectl port-forward -n chaos-mesh chaos-dashboard-pod 2333:2333DASHBOARD
kubectl get serviceaccount --all-namespaces | grep chaos-mesh
kubectl create token account-chaos-mesh-manager-ebrbc -n chaos-meshkind: HTTPChaos
apiVersion: chaos-mesh.org/v1alpha1
metadata:
namespace: chaos-mesh
name: api-gateway-slow-response
spec:
selector:
namespaces:
- development
labelSelectors:
app: api-gateway
mode: all
target: Request # The target of the experiment: modify HTTP requests.
delay: 10s # Inject a synthetic delay of 10 seconds into each HTTP request.
port: 8080 # The port the target application is listening on.
path: '*' # Apply to all paths (e.g. /login, /api/v1/user, etc.).
method: POST # Apply only to POST requests.
duration: 10m # Total duration of the experiment: 10 minutes (delay active for 10 minutes).Conclusion
The goal isn’t to break your system — it’s to learn how it behaves when it does break.
“Resilience isn’t about avoiding failure — it’s about surviving it.”






