Skip to main content
Version: 0.9.1

Setup the development environment

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:

  1. Clone the Chaos Mesh repo to your local machine.

    git clone https://github.com/chaos-mesh/chaos-mesh.git
    cd chaos-mesh
  2. Install the Kubernetes API development framework - kubebuilder and kustomize.

    make ensure-all
  3. Make sure Docker is installed and running on your local machine.

  4. Make sure ${GOPATH}/bin is in your PATH.

    echo 'export PATH=$(go env GOPATH)/bin:${PATH}' >> ~/.bash_profile
    source ~/.bash_profile
  5. Check nodejs related environment.

     node -v
    yarn -v

Now you can test the toolchain by running:

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 Kubernetes cluster directly:

hack/kind-cluster-build.sh

The above script will create a Kubernetes cluster by kind. When you don't need this cluster, you can run the following command to delete it:

kind delete cluster --name=kind

Bootstrap Chaos Dashboard. (Optional)

cd ui && yarn
# Run it
REACT_APP_API_URL=http://localhost:2333 yarn start

Next step

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