chaos
by startxfr
Helm chart used to deploy a full chaos-testing toolkit composed kraken, cerberus, litmus, chaos-mesh and kube-monkey configured for Openshift clusters. This chart is part of the startx chaos helm chart suite.
About this chart
Chaos Chart : Main
This helm chart is used to deploy a chaos test suite composed of cerberus, kraken (krkn), Tekton chaos pipelines, litmus, chaos mesh and kube-monkey.
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. chaos-xxx charts.
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
4. Install this suite
# Install the projects
helm install \
--set cerberus.enabled=true --set cerberus.project.enabled=true \
--set kraken.enabled=true --set kraken.project.enabled=true \
--set pipeline.enabled=true --set pipeline.project.enabled=true \
--set litmus.enabled=true --set litmus.project.enabled=true \
--set mesh.enabled=true --set mesh.project.enabled=true \
--set monkey.enabled=true --set monkey.project.enabled=true \
chaos-projects startx/chaos
# Deploy the cerberus instance
helm install -n chaos-cerberus \
--set cerberus.enabled=true \
chaos-cerberus-instance startx/chaos-cerberus
# Run a krkn (kraken) chaos job with one scenario
helm install -n chaos-kraken \
--set kraken.enabled=true --set kraken.scenarios.pods-monitoring.enabled=true \
chaos-kraken-run startx/chaos-kraken
# Deploy the Tekton chaos pipelines (requires OpenShift Pipelines)
helm install -n chaos-pipeline \
--set pipeline.enabled=true \
chaos-pipeline-instance startx/chaos-pipeline
# Deploy the litmus instance
helm install \
--set litmus.enabled=true --set litmus.litmus.enabled=true \
chaos-litmus-instance startx/chaos-litmus
# Deploy the mesh instance
helm install \
--set mesh.enabled=true --set mesh.mesh.enabled=true \
chaos-mesh-instance startx/chaos-mesh
# Deploy the monkey instance
helm install \
--set monkey.enabled=true --set monkey.monkey.enabled=true \
chaos-monkey-instance startx/chaos-monkey
5. Manage with ArgoCD
Deploy via ArgoCD Applications
chaos is an umbrella chart. The recommended GitOps approach is one AppProject shared across the suite and one Application per sub-chart (cerberus, kraken, pipeline, litmus, mesh, monkey) to allow independent lifecycle management.
git clone https://gitlab.com/startx1/helm.git
cd helm-repository/charts/chaos/examples/argocd/
oc apply -k .
Values files
Default values file (values.yaml)
Deploy chaos namespaces
Deploy the chaos test suite environment :
- 1 project named chaos-cerberus
- 1 project named chaos-kraken
- 1 project named chaos-pipeline
- 1 project named chaos-litmus
- 1 project named chaos-mesh
- 1 project named chaos-monkey
helm install \
--set cerberus.enabled=true --set cerberus.project.enabled=true \
--set kraken.enabled=true --set kraken.project.enabled=true \
--set litmus.enabled=true --set litmus.project.enabled=true \
--set mesh.enabled=true --set mesh.project.enabled=true \
--set monkey.enabled=true --set monkey.project.enabled=true \
chaos startx/chaos
Deploy cerberus
Deploy the cerberus component
helm install -n chaos-cerberus \
--set cerberus.enabled=true \
chaos-cerberus startx/chaos-cerberus
Deploy kraken
Deploy the kraken component
helm install -n chaos-kraken \
--set kraken.enabled=true --set kraken.scenarios.pods-monitoring.enabled=true \
chaos-kraken startx/chaos-kraken
Deploy litmus
Deploy the litmus component
helm install \
--set litmus.enabled=true --set litmus.litmus.enabled=true \
chaos-litmus startx/chaos-litmus
Deploy Chaos-mesh
Deploy the chaos-mesh component
helm install \
--set mesh.enabled=true --set mesh.mesh.enabled=true \
chaos-mesh startx/chaos-mesh
Deploy Kube-monkey
Deploy the kube-monkey component
helm install \
--set monkey.enabled=true --set monkey.monkey.enabled=true \
chaos-monkey startx/chaos-monkey
Values dictionary
context values dictionary
| Key | Default | Description |
|---|---|---|
| context.scope | default | Name of the global scope for this application (organizational tenant) |
| context.cluster | localhost | Name of the cluster running this application (platform tenant) |
| context.environment | dev | Name of the environment for this application (ex: dev, factory, preprod or prod) |
| context.component | demo | Component name of this application (logical tenant) |
| context.app | generic | Application name (functional tenant, default use Chart name) |
| context.version | 0.0.1 | Version name of this application (default use Chart appVersion) |
| cerberus | {...} | Configuration of the cerberus component. Inherit from the chaos-cerberus chart (see chart options for more options) |
| kraken | {...} | Configuration of the kraken component. Inherit from the chaos-kraken chart (see chart options for more options) |
| pipeline | {...} | Configuration of the Tekton chaos pipelines. Inherit from the chaos-pipeline chart (see chart options for more options) |
| litmus | {...} | Configuration of the litmus component. Inherit from the chaos-litmus chart (see chart options for more options) |
| mesh | {...} | Configuration of the chaos-mesh component. Inherit from the chaos-mesh chart (see chart options for more options) |
| monkey | {...} | Configuration of the kube-monkey component. Inherit from the chaos-monkey chart (see chart options for more options) |
Usage examples
Deploy the full chaos suite in sequence
The recommended deployment order: namespaces first, then cerberus (healthcheck), then engines.
# 1. Create all chaos namespaces
helm install chaos-namespaces startx/chaos \
--set cerberus.enabled=true --set cerberus.project.enabled=true \
--set kraken.enabled=true --set kraken.project.enabled=true \
--set litmus.enabled=true --set litmus.project.enabled=true \
--set mesh.enabled=true --set mesh.project.enabled=true \
--set monkey.enabled=true --set monkey.project.enabled=true
# 2. Deploy cerberus (healthcheck watchdog) first
helm install chaos-cerberus startx/chaos-cerberus \
--set cerberus.enabled=true \
-n chaos-cerberus
# 3. Deploy the Tekton chaos pipelines, gated by cerberus
helm install chaos-pipeline startx/chaos-pipeline \
--set pipeline.enabled=true \
--set pipeline.cerberus.url=http://cerberus.chaos-cerberus.svc.cluster.local:8080 \
-n chaos-pipeline
# 4. Or run a single krkn (kraken) chaos job
helm install chaos-kraken startx/chaos-kraken \
--set kraken.enabled=true \
--set kraken.scenarios.pods-monitoring.enabled=true \
--set kraken.cerberus.enabled=true \
--set kraken.cerberus.url=http://cerberus.chaos-cerberus.svc.cluster.local:8080 \
-n chaos-kraken
Deploy only cerberus + kraken (minimal chaos pair)
# my-chaos-minimal-values.yaml
cerberus:
enabled: true
cerberus:
enabled: true
kubeconfig:
mode: token
token:
server: https://api.prod.example.com:6443
token: sha256~REPLACE
kraken:
enabled: true
kraken:
enabled: true
mode: job
cerberusUrl: http://cerberus.chaos-cerberus.svc.cluster.local:8080
kubeconfig:
mode: token
token:
server: https://api.prod.example.com:6443
token: sha256~REPLACE
helm install my-chaos startx/chaos -f my-chaos-minimal-values.yaml
Deploy with ArgoCD
The chaos umbrella is deployed by ArgoCD as one AppProject (chaos) and 6 Applications, one for each tool: chaos-cerberus-instance, chaos-kraken-instance, chaos-litmus-instance, chaos-mesh-instance, chaos-monkey-instance, chaos-pipeline-instance. Each Application installs the
chart of its tool in its own namespace (chaos-cerberus, chaos-kraken, chaos-pipeline, chaos-litmus, chaos-mesh, chaos-monkey) and creates that namespace itself (project.enabled: true), so there is no separate project wave.
The files are in examples/argocd/.
git clone https://github.com/startxfr/helm-repository.git
cd helm-repository/charts/chaos
oc apply -k examples/argocd/
- Sync policy :
chaos-kraken-instancehas no automated sync, every sync of it starts a chaos run; the 5 other Applications sync automatically (prune,selfHeal). - Finalizer : every Application carries
resources-finalizer.argocd.argoproj.io; delete the Applications before the AppProject. - Order : the examples set no sync wave.
chaos-kraken-instanceandchaos-pipeline-instancepoint at the cerberus service ofchaos-cerberus, so syncchaos-cerberus-instancefirst. - chaos-mesh : its Application uses
ServerSideApply=trueandignoreDifferenceson the generated certificates and webhookcaBundlefields (see thechaos-meshREADME). - Version :
targetRevision: 21.3.xfollows the minor release; pin an exact version in production (ADR-0004). - cluster-argocd :
values-app-chaos.yamlof thecluster-argocdchart deploys the same six tools from the git repository (stable) with the AppProjectchaos-all(sync wave 0) and the Applicationschaos-all-<tool>-instance(sync wave 50, and 54 forchaos-pipeline). These names differ from thechaosandchaos-<tool>-instanceofexamples/argocd/and are kept on purpose, see Names of values-app-chaos.yaml. - AppProject : 7 destination namespaces (
chaos-cerberus,chaos-kraken,chaos-pipeline,chaos-litmus,chaos-mesh,chaos-monkey,default) and the cluster resources the tools need (namespaces, projects, SCC, cluster roles, CRDs, chaos-mesh webhooks). The AppProject generated invalues-app-chaos.yamlhas an 8th destination,openshift-gitops: the generator adds it to everyvalues-app-*.yamlfile.
Names of values-app-chaos.yaml
values-app-chaos.yaml keeps the AppProject chaos-all and t
Deploy chaos with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has chaos 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.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartchaos is pinned at v21.3.419 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- 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