chaos-mesh

by startxfr

Helm chartv21.3.418App 2.8.8GPL-3.0-or-laterVerified publisher

Helm chart used to deploy chaos-mesh on Openshift or Kubernetes cluster. Chaos-mesh is as a chaos engine with a gui to define and execute chaos scenarios for Kubernetes clusters. This chart is part of the startx chaos helm chart suite.

About this chart

Chaos Chart : Mesh

This helm chart is used to deploy Chaos Mesh on an Openshift or Kubernetes cluster. Chaos Mesh is a chaos engine driven by custom resources (PodChaos, NetworkChaos, TimeChaos...) or by its web dashboard.

Upstream project : chaos-mesh/chaos-mesh, deployed with the upstream helm chart chaos-mesh version 2.8.8 ; images ghcr.io/chaos-mesh/chaos-mesh, chaos-daemon and chaos-dashboard, tag v2.8.8.

This chart is part of the chaos startx helm chart series focused on deploying various kind of chaos tools for cluster infrastructure or applications chaos-testing.

Requirements and guidelines

Read the startx helm-repository homepage for more information on how to use these resources.

Deploy this helm chart on openshift

1. Connect to your Openshift cluster

oc login -t <token> <cluster-url>

2. Install the repository

helm repo add startx https://helm-repository.readthedocs.io/en/latest/repos/stable/

3. Get information about this chart

helm show chart startx/chaos-mesh

4. Install this component

# Create the chaos-mesh namespace
helm install chaos-mesh-project startx/chaos-mesh --set project.enabled=true
# Deploy the mesh instance
helm install chaos-mesh-instance startx/chaos-mesh --set mesh.enabled=true -n chaos-mesh

Default values

The default values.yaml deploys nothing : each part is switched on by its enabled key.

  • project.enabled=true : 1 namespace chaos-mesh (see the project chart)
  • mesh.enabled=true : the chaos-mesh controller, daemon, dashboard, DNS server and Prometheus, 2 SecurityContextConstraints anyuid-mesh and privileged-mesh with their Role and RoleBinding, 1 Route server (unless mesh.expose=false)

The custom resource definitions (chaos-mesh.org) are shipped in the crds/ directory of the upstream chart : helm installs them at the first install and never upgrades them.

KeyDefaultDescription
context.scopecompanynameName of the global scope for this application (organizational tenant)
context.clusterclusternameName of the cluster running this application (platform tenant)
context.environmentdevName of the environment for this application (ex: dev, factory, preprod or prod)
context.componentchaosComponent name of this application (logical tenant)
context.appchaos-meshApplication name (functional tenant, default use Chart name)
context.version2.8.8Version name of this application (default use Chart appVersion)
project{...}Values of the project chart, which creates the namespace
project.enabledfalseCreate the namespace
project.project.namechaos-meshName of the namespace ; also the namespace of the resources created by this chart
mesh{...}Values of the upstream chaos-mesh chart, passed as is
mesh.enabledfalseDeploy chaos-mesh and the anyuid-mesh and privileged-mesh SecurityContextConstraints
mesh.exposetrueCreate the Openshift route server to the dashboard (when mesh.enabled and mesh.dashboard.create)
mesh.chaosDaemon.runtimecrioContainer runtime of the nodes ; socketPath goes with it
mesh.dashboard.createtrueDeploy the web dashboard
mesh.dashboard.securityModetrueThe dashboard asks for a token instead of using its own service account
mesh.dashboard.rootUrlhttps://server-chaos-mesh.apps.mycluster.comPublic URL of the dashboard, to adapt to the cluster
mesh.prometheus.createtrueDeploy a Prometheus with a persistent volume

Values files

helm install chaos-mesh-project startx/chaos-mesh -f https://raw.githubusercontent.com/startxfr/helm-repository/master/charts/chaos-mesh/values-startx-project.yaml
helm install chaos-mesh-instance startx/chaos-mesh -f https://raw.githubusercontent.com/startxfr/helm-repository/master/charts/chaos-mesh/values-startx-deploy.yaml -n startx-chaos-mesh

Usage examples

Default : namespace then chaos-mesh

Two releases of the same chart, the namespace first.

helm install chaos-mesh-project startx/chaos-mesh --set project.enabled=true
helm install chaos-mesh-instance startx/chaos-mesh --set mesh.enabled=true -n chaos-mesh

Minimal : engine only

No dashboard, no route, no Prometheus, no DNS server : experiments are applied as custom resources.

# my-mesh-minimal-values.yaml
mesh:
  enabled: true
  expose: false
  dashboard:
    create: false
  prometheus:
    create: false
  dnsServer:
    create: false
helm install chaos-mesh-instance startx/chaos-mesh -f my-mesh-minimal-values.yaml -n chaos-mesh

Advanced : highly available controller and a first experiment

Three controller replicas, the dashboard published under the cluster domain, then a PodChaos that kills one pod of an application.

# my-mesh-values.yaml
context:
  scope: myorg
  cluster: mycluster
  environment: prod
  component: chaos
  app: chaos-mesh
mesh:
  enabled: true
  controllerManager:
    replicaCount: 3
  dashboard:
    rootUrl: https://server-chaos-mesh.apps.mycluster.example.com
  prometheus:
    create: false
helm install chaos-mesh-instance startx/chaos-mesh -f my-mesh-values.yaml -n chaos-mesh
cat <<EOF | oc apply -f -
apiVersion: chaos-mesh.org/v1alpha1
kind: PodChaos
metadata:
  name: pod-kill-myapp
  namespace: chaos-mesh
spec:
  action: pod-kill
  mode: one
  selector:
    namespaces:
      - myapp-namespace
    labelSelectors:
      app.kubernetes.io/name: myapp
EOF

Deploy with ArgoCD

One AppProject and two Applications : chaos-mesh-project (wave 1, the namespace) then chaos-mesh-instance (wave 5, chaos-mesh). The files are in examples/argocd.

git clone https://github.com/startxfr/helm-repository.git
cd helm-repository/charts/chaos-mesh
oc apply -k examples/argocd/

Each Application sets the enabled key of the other part to false, so that the two Applications never render the same resource. Delete chaos-mesh-instance first, wait for it to be gone, then delete chaos-mesh-project (it has no finalizer : a namespace can be slow to terminate).

Things to know with ArgoCD :

  • Custom resource definitions : ArgoCD installs and upgrades the definitions of the crds/ directory. They are too large for a client side apply, hence ServerSideApply=true in the instance Application. Do not set skipCrds : nothing else installs them.
  • Prometheus volume : with a WaitForFirstConsumer StorageClass the volume claim stays Pending and ArgoCD waits for it before creating the pod that would bind it. The example sets mesh.prometheus.create: false ; otherwise give an Immediate StorageClass.
  • Generated certificates : the upstream chart generates a new certificate authority, the webhook and chaosd certificates and a rollme annotation at every render. The instance Application ignores these fields (ignoreDifferences and RespectIgnoreDifferences=true) : without it the Application is always OutOfSync and the certificates rotate at every refresh.
  • AppProject : the chart creates MutatingWebhookConfiguration and ValidatingWebhookConfiguration resources ; both are in the clusterResourceWhitelist of the example.

History

ReleaseDateDescription
16.19.592024-12-09Align all chart to the 16.19.59 release
17.14.902025-04-30Publish stable release for 4.17 version
18.11.712025-11-27Align all charts to the same release
18.23.02026-02-28Start 4.19 branch
19.23.172026-03-02Align all dependencies to chart v19.23.11
20.14.152026-03-02Update all charts to OCP version 4.20.14
21.3.02026-03-02Update all chart to OCP version 4.21.3
21.3.2782026-08-14add centigpu
21.3.3002026-10-21Add new charts and align all to this release
21.3.3092026-10-27Adding new charts perconna and align all to v21.3.309
21.3.3132026-11-04Add cluster-unifai and cluster-qdrant, align all charts to 21.3.313
21.3.3212026-11-05Adding external secret management
21.3.3612026-11-10Release chaos-mesh restored chart
21.3.3712026-11-19Add Sail, oauthProxy, DSCInitialization, spot machines and annotations support
21.3.3772026-11-19full repository release: aligned pins, ArgoCD source fix, schemas and docs
21.3.3792026-11-19conventions wave: spelling, READMEs, ArgoCD examples and values-app, oauth switch
21.3.3892026-11-19full repository release: HTTPS dependency URLs, dependency-ordered release, schema guard, docs and examples
21.3.3902026-11-20full repository release: test fix, keepalived README, aligned pins
21.3.3912026-11-21chaos charts: krkn v5.2.15, new chaos-pipeline chart, security fixes for litmus and monkey; breaking, see README migration notes
21.3.3922026-11-21full repository release: chaos-pipeline run parameters and authenticated health check, aligned pins
21.3.3972026-11-21stable repository release 21.3.397: all charts aligned, unifai delegation cap documentation
21.3.3982026-11-21project: dockercfg existingSecret; chaos-pipeline: empty default for scenarios, optional ClusterOperator final check; chaos schemas regenerated
21.3.4102026-11-22full repository release: README conventions (Values files, Deploy with ArgoCD), conventions page
21.3.4122026-11-22full repository release: internal pins on the previous published version (ADR-0006)
21.3.4162026-11-23stable update: chart fixes (project, cluster-mongo, cluster-oadp, cluster-pipeline, cluster-machine, example-catalog); cluster-dvo accepts the grafana keys next to its historical keys, which keep priority
21.3.4182026-11-23commit a stable release of all charts

Deploy chaos-mesh with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has chaos-mesh on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartchaos-mesh is pinned at v21.3.418 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply