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.
git clone https://github.com/pingcap/chaos-mesh.git
cd chaos-mesh
- Install the K8s API development framework - kubebuilder and kustomize.
make install-kubebuilder
make install-kustomize
Start the docker service. Most Linux distributions use
systemctl
to start services. If you do not havesystemctl
, use the service command.Make sure
${GOPATH}/bin
is in yourPATH
by executing:echo 'export PATH=$(go env GOPATH)/bin:${PATH}' >> ~/.bash_profile
andsource ~/. 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:
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:
hack/kind-cluster-build.sh
Next steps
Congratulations! You are now all set up for Chaos Mesh development. Try the following tasks:
- Develop a New Chaos Type
- [Add facilities to chaos daemon]