This document describes how to deploy Chaos Mesh for performing chaos experiments on your application on Kubernetes.

Prerequisites

Before deploying Chaos Mesh, make sure the following items have been installed:

  • Kubernetes >= v1.12
  • RBAC enabled (optional)
  • Helm version >= v2.8.2

Step 1: Get Chaos Mesh

  1. git clone https://github.com/pingcap/chaos-mesh.git
  2. cd chaos-mesh/

Step 2: Create custom resource type

To use Chaos Mesh, you must first create the related custom resource type.

  1. kubectl apply -f manifests/crd.yaml

Step 3: Install Chaos Mesh

Depending on your environment, there are following methods of installing Chaos Mesh:

  • Install in docker environment
  1. # create namespace chaos-testing
  2. kubectl create ns chaos-testing
  3. # helm 2.X
  4. helm install helm/chaos-mesh --name=chaos-mesh --namespace=chaos-testing
  5. # helm 3.X
  6. helm install chaos-mesh helm/chaos-mesh --namespace=chaos-testing
  7. # check Chaos Mesh pods installed
  8. kubectl get pods --namespace chaos-testing -l app.kubernetes.io/instance=chaos-mesh
  • Install in containerd environment (Kind)
  1. # create namespace chaos-testing
  2. kubectl create ns chaos-testing
  3. # helm 2.X
  4. helm install helm/chaos-mesh --name=chaos-mesh --namespace=chaos-testing --set chaosDaemon.runtime=containerd --set chaosDaemon.socketPath=/run/containerd/containerd.sock
  5. # helm 3.X
  6. helm install chaos-mesh helm/chaos-mesh --namespace=chaos-testing --set chaosDaemon.runtime=containerd --set chaosDaemon.socketPath=/run/containerd/containerd.sock
  7. # check Chaos Mesh pods installed
  8. kubectl get pods --namespace chaos-testing -l app.kubernetes.io/instance=chaos-mesh

Note:

Due to current development status of Chaos Dashboard, it is not installed by default. If you want to try it out, add —set dashboard.create=true in the helm commands above.

After executing the above commands, you should be able to see the output indicating that all Chaos Mesh pods are up and running. Otherwise, please check the current environment according to the prompt message or send us an issue for help.

Next steps

Refer to Run Chaos Mesh.