This document walks you through the environment setup process for Chaos Mesh development.

Prerequisites

Prepare the toolchain

Make sure you have the above prerequisites met. Now follow the steps below to prepare the toolchain for compiling Chaos Mesh:

  • Clone the chaos-mesh repo to your local machine.
  1. git clone https://github.com/pingcap/chaos-mesh.git
  2. cd chaos-mesh
  1. make install-kubebuilder
  2. make install-kustomize
  • Start the docker service. Most Linux distributions use systemctl to start services. If you do not have systemctl, use the service command.

  • Make sure ${GOPATH}/bin is in your PATH by executing:echo 'export PATH=$(go env GOPATH)/bin:${PATH}' >> ~/.bash_profile and source ~/. bash_profile.

Note:

If your yarn is newly installed, you may need to restart the terminal to make it available.

Now you can test the toolchain by running:

  1. make

If there is no error in the output, the compiling toolchain is successfully configured.

Prepare the deployment environment

With the toolchain ready, you still need a local Kubernetes cluster as the deployment environment. Because kind is already installed, you can now set up the K8s cluster directly:

  1. hack/kind-cluster-build.sh

Next steps

Congratulations! You are now all set up for Chaos Mesh development. Try the following tasks: