Configure the Development Environment

This document describes how to configure a development environment for Chaos Mesh.

Configuration requirements

Before configuring, you need to install the development tools for Chaos Mesh.

Prepare the toolchain

After installing the above tools, follow the steps below to configure the toolchain for compiling Chaos Mesh.

  1. Clone the Chaos Mesh repository to your local server.

    1. git clone https://github.com/chaos-mesh/chaos-mesh.git
    2. cd chaos-mesh
  2. Make sure that Docker is installed and running in your environment.

  3. Make sure Docker Registry is running. Set the environment variable DOCKER_REGISTRY as the address of Docker Registry:

    1. echo 'export DOCKER_REGISTRY=localhost:5000' >> ~/.bash_profile
    2. source ~/.bash_profile
  4. Make sure ${GOPATH}/bin is in your PATH.

    1. echo 'export PATH=$(go env GOPATH)/bin:${PATH}' >> ~/.bash_profile
    1. source ~/.bash_profile
  5. Check the configuration environment related to Node.js.

    1. node -v
    2. yarn -v
  6. Compile Chaos Mesh:

    1. make

If no error occurs, you have successfully cnofigured the toolchain.

Prepare the environment for deployment

After configuring the toolchain, you need to launch a local Kubernetes cluster to deploy Chaos Mesh. Because kind is installed in the configuration requirements section, you can directly use the following command to launch a Kubernetes cluster:

  1. hack/kind-cluster-build.sh

When you no longer need this cluster and want to delete it, you can use the following command:

  1. kind delete cluster --name=kind

To start Chaos Dashboard, run the following command:

  1. cd ui && yarn
  2. # start
  3. yarn workspace @ui/app start:default # cross-env REACT_APP_API_URL=http://localhost:2333 BROWSER=none react-scripts start

Learn more

After finishing the above preparation, you can try to Add a New Chaos Experiment type.