Skip to main content
Version: 2.2.3

Quick Start (Test Recommended)

This document describes how to quickly start Chaos Mesh in a test or local environment.

note

In this document, the Chaos Mesh installation is a script installation for quick trial only.

If you need to install Chaos Mesh in the production environment or other strict non-test scenarios, it is recommended to use Helm. For details, refer to Installation using Helm (recommended for production).

Environment preparation

Please ensure that the Kubernetes cluster is deployed in the environment before the trial. If the Kubernetes cluster has not been deployed, you can refer to the links below to complete the deployment:

Quick installation

To install Chaos Mesh in a test environment, run the following script:

note
  • If the current environment is kind, add the --local kind parameter at the end of the script.

    If you want to specify a kind version, add the --kind-version xx parameter at the end of the script, for example:

  • If the current environment is K3s, add the --k3s parameter at the end of the script.

  • If the current environment is Microk8s, add the --microk8s parameter at the end of the script.

After running this script, Chaos Mesh automatically installs the CustomResourceDefining (CRD) that matches the version, all required components, and related Service Account configurations.

For more installation details, refer to the source code of the install.sh.

Verify the installation

To check the running status of Chaos Mesh, execute the following command:

kubectl get po -n chaos-mesh

The expected output is as follows:

NAME                                        READY   STATUS    RESTARTS   AGE
chaos-controller-manager-69fd5c46c8-xlqpc 3/3 Running 0 2d5h
chaos-daemon-jb8xh 1/1 Running 0 2d5h
chaos-dashboard-98c4c5f97-tx5ds 1/1 Running 0 2d5h

If your actual output is similar to the expected output with NAME, READY, STATUS, RESTARTS, and AGE, it means that Helm is installed successfully.

note

If the STATUS of your actual output is not Running, then execute the following command to check the Pod details, and troubleshoot issues according to the error information.

# Take the chaos-controller as an example
kubectl describe po -n chaos-mesh chaos-controller-manager-69fd5c46c8-xlqpc
note

If leader-election feature is turned off manually, chaos-controller-manager should only have 1 replication.

NAME                                        READY   STATUS    RESTARTS   AGE
chaos-controller-manager-69fd5c46c8-xlqpc 1/1 Running 0 2d5h
chaos-daemon-jb8xh 1/1 Running 0 2d5h
chaos-dashboard-98c4c5f97-tx5ds 1/1 Running 0 2d5h

Run Chaos experiments

After verifying that the installation is complete, you can run a Chaos experiment to experience the features of Chaos Mesh.

For the method to run the experiment, it is recommended to refer to Run a Chaos experiment. After successfully creating the experiment, you can observe the running status of the experiment on the Chaos Dashboard.

Uninstall Chaos Mesh

To uninstall Chaos Mesh, execute the following command:

You can also delete the chaos-mesh namespace to directly uninstall Chaos Mesh:

kubectl delete ns chaos-mesh

FAQ

Why the local directory appears in the root directory after installation?

If you don't install kind in the existing environment, and you use the --local kind parameter when executing the installation command, the install.sh script will automatically install the kind in the local directory under the root directory.