chaos-kraken

by startxfr

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

Helm chart used to run krkn (kraken) chaos scenarios on Openshift or Kubernetes cluster. krkn is a chaos engine injecting failures in the cluster infrastructure and in applications. This chart is part of the startx chaos helm chart suite.

About this chart

Chaos Chart : Kraken

This helm chart runs krkn (formerly Kraken) chaos scenarios on an Openshift or Kubernetes cluster. krkn is a chaos engine injecting failures in the cluster infrastructure (pods of the platform, nodes, network, time) and in applications (pods, containers, network outage, storage), then checking that the platform recovers.

Upstream project: krkn-chaos/krkn, a CNCF sandbox project, version v5.2.15, image quay.io/krkn-chaos/krkn (documentation).

PeriodRepositoryImage
2020-2022cloud-bulldozer/krakenquay.io/openshift-scale/kraken
2022chaos-kubox/krknquay.io/chaos-kubox/krkn
2022-2024redhat-chaos/krknquay.io/redhat-chaos/krkn
2024-krkn-chaos/krknquay.io/krkn-chaos/krkn

A chaos run is a one-shot Job. Two engines are available:

  • core (default): one Job runs the krkn image with the scenarios enabled in kraken.scenarios. Several scenarios per run, full krkn configuration, image pinned by tag and digest.
  • hub: one Job per scenario enabled in kraken.hub.scenarios, each running a krkn-hub image configured by environment variables. krkn-hub tags are rolling (rebuilt every week).

To run the scenarios from Tekton pipelines, see the chaos-pipeline chart.

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.

Chaos scenarios destroy resources. Read each scenario before enabling it, start with pod scenarios, and never run node, network or time scenarios on a cluster you cannot afford to lose.

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-kraken

4. Install this component

# Install the kraken project
helm install --set project.enabled=true chaos-kraken-project startx/chaos-kraken
# Run one scenario: kill a prometheus pod of the cluster monitoring
helm install -n chaos-kraken chaos-kraken-run startx/chaos-kraken \
  --set kraken.enabled=true --set kraken.scenarios.pods-monitoring.enabled=true
# Follow the run
oc logs -n chaos-kraken -f job/kraken-test

The Job is immutable: uninstall the release (helm uninstall chaos-kraken-run) before running another set of scenarios.

Default values

Nothing is deployed by default, and every scenario is disabled. With project.enabled=true and kraken.enabled=true the chart creates:

  • 1 project named chaos-kraken
  • 1 serviceaccount named kraken, with a chaos clusterrole and its binding (local mode)
  • 1 configmap with the krkn configuration and 1 configmap with the enabled scenarios
  • 1 job named kraken-test, unprivileged, running the enabled scenarios against the cluster it runs in

Values files

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

Values dictionary

context values dictionary

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.appkrakenApplication name (functional tenant, default use Chart name)
context.version5.2.15Version name of this application (default use Chart appVersion)

chaos-kraken values dictionary

KeyDefaultDescription
project{...}Configuration of the project (or namespace). Inherit from the project chart
project.enabledfalseEnable creation of the namespace
kraken.enabledfalseUnleash the kraken ;)
kraken.enginecoreEngine used to run the chaos: core or hub
kraken.image.repositoryquay.io/krkn-chaos/krknImage repository (core engine)
kraken.image.tagv5.2.15Image tag, used when no digest is set
kraken.image.digestsha256:43b3efda...Image digest, takes precedence over the tag
kraken.image.pullPolicyIfNotPresentImage pull policy
kraken.privilegedfalseRun the krkn container as privileged and bind the service account to the privileged SCC
kraken.privilegedWorkloadsautoGive the service account the privileged SCC in privilegedNamespaces (auto: when an enabled scenario needs it)
kraken.privilegedNamespaces[default]Namespaces where krkn starts its privileged helper pods
kraken.runAsUser""User id of the container. Leave empty on OpenShift (assigned by the SCC), set it on plain Kubernetes (ex: 1001)
kraken.resources{}Resources requests and limits of the krkn container
kraken.rbac.clusterAdminfalseBind the service account to cluster-admin instead of the chaos ClusterRole of this chart
kraken.rbac.extraRules[]Rules added to the chaos ClusterRole of this chart
kraken.job.namekraken-testJob name (prefix of the job names with the hub engine)
kraken.job.activeDeadlineSeconds7200Maximum duration of the job (seconds)
kraken.job.suspendfalseCreate the job suspended
kraken.job.ttlSecondsAfterFinished""Delete the finished job after this delay (seconds), kept when empty
kraken.config.exitOnFailurefalseKeep false: krkn reads it only with cerberus enabled and then exits 1 after the first scenario, even on a healthy signal
kraken.config.waitDuration60Duration to wait between each scenario (seconds)
kraken.config.iterations1Number of times to execute the scenarios
kraken.config.daemonModefalseRun the scenarios forever
kraken.config.autoRollbacktrueRoll back the changes of a scenario that failed
kraken.config.imageSignatureVerificationtrueVerify the signature of the workload images started by krkn
kraken.config.reportFormats[]Formats of the report generated at the end of the run (html, pdf)
kraken.config.resiliencyRunModedisabledResiliency score mode (standalone, detailed or disabled)
kraken.cerberus.enabledfalseCheck the cerberus signal after each scenario
kraken.cerberus.url""URL of the cerberus signal (ex: http://cerberus.chaos-cerberus.svc.cluster.local:8080)
kraken.cerberus.checkApplicationRoutesfalseFail the run when a route watched by cerberus was unavailable
kraken.healthChecks.interval2Interval of the HTTP health checks run by krkn (seconds)
kraken.healthChecks.runDuringpostWhen to run the checks (pre, during, post or a list)
kraken.healthChecks.exitOnFailurefalseFail the run when a check fails
kraken.healthChecks.endpoints[]Endpoints to check (url, bearer_token, auth)
kraken.objectStateChecks.runDuring[]When to run the object condition checks (list of pre, during, post). Disabled when empty

Deploy chaos-kraken with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has chaos-kraken 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-kraken 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