Install Chaos Mesh using Helm
This document describes how to install Chaos Mesh in the production environment.
Prerequisites
Before installing Chaos Mesh, make sure that you have installed Helm in your environment.
To check whether Helm is installed or not, execute the following command:
helm version
The expected output is as follows:
version.BuildInfo{Version:"v3.5.4", GitCommit:"1b5edb69df3d3a08df77c9902dc17af864ff05d1", GitTreeState:"dirty", GoVersion: "go1.16.3"}
If your actual output is similar to the expected output with Version
, GitCommit
, GitTreeState
, and GoVersion
, it means that Helm is installed successfully.
In this document, Helm v3 is used in commands to make operations on Chaos Mesh. If Helm v2 is used in your environment, refer to Migrating Helm v2 to v3 or modify the Helm version to the v2 format.
Install Chaos Mesh using Helm
Step 1: Add Chaos Mesh repository
Add the Chaos Mesh repository to the Helm repository:
helm repo add chaos-mesh https://charts.chaos-mesh.org
Step 2: View the installable versions of Chaos Mesh
To see charts that can be installed, execute the following command:
helm search repo chaos-mesh
The above command will output the latest release of chart. If you want to install a historical version, execute the following command to view all released versions:
helm search repo chaos-mesh -l
After the above command is completed, you can start installing Chaos Mesh.
Step 3: Create the namespace to install Chaos Mesh
It is recommended to install Chaos Mesh under the chaos-mesh
namespace, or you can specify any namespace to install Chaos Mesh:
kubectl create ns chaos-mesh
Step 4: Install Chaos Mesh in different environments
When installing Chaos Mesh on Kubernetes v1.15(or an earlier version), you need to manually install CRD. For more information, see FAQ.
As the daemons of different container runtimes listen on different socket paths, you need to set the appropriate values during installation. You can run the following installation commands according to different environments.
- Docker
- Containerd
- K3s
- MicroK8s
- CRI-O
To install a specific version of Chaos Mesh, add the --version x.y.z
parameter after helm install
. For example, helm install chaos-mesh chaos-mesh/chaos-mesh -n=chaos-mesh --version 2.1.0
.
To ensure high availability, Chaos Mesh turns on leader-election
feature by default. If you do not need to use this feature, you can disable it manually with --set controllerManager.leaderElection.enabled=false
.
If version
<2.6.1
, you still need to set--set controllerManager.replicaCount=1
to reduce the controller manager to one replica.