chaos-cerberus

by startxfr

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

Helm chart used to deploy cerberus on Openshift or Kubernetes cluster. Cerberus is a watchdog publishing a go/no-go signal about the cluster health. This chart is part of the startx chaos helm chart suite.

About this chart

Chaos Chart : Cerberus

This helm chart deploys Cerberus on an Openshift or Kubernetes cluster. Cerberus is a watchdog that monitors the health of a cluster (nodes, cluster operators, critical namespaces, routes) and publishes a go/no-go signal (True or False) on an HTTP endpoint. Chaos tools such as krkn and the chaos pipelines read this signal before and after injecting failures.

Upstream project: krkn-chaos/cerberus (formerly openshift-scale/cerberus, then chaos-kubox and redhat-chaos), version 1.0.4, image quay.io/krkn-chaos/cerberus (documentation). The project is in maintenance mode and publishes no versioned image tag: this chart pins the image by digest. Cerberus is optional: krkn has its own health checks, and upstream warns that a Cerberus running inside the cluster it watches can itself be disrupted by a chaos scenario.

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

4. Install this component

# Install the cerberus project
helm install --set project.enabled=true chaos-cerberus-project startx/chaos-cerberus
# Deploy the cerberus instance
helm install --set cerberus.enabled=true -n chaos-cerberus chaos-cerberus-instance startx/chaos-cerberus

Default values

Nothing is deployed by default. With project.enabled=true and cerberus.enabled=true the chart creates:

  • 1 project named chaos-cerberus
  • 1 serviceaccount named cerberus, with a read-only clusterrole and its binding (local mode)
  • 1 configmap with the cerberus configuration
  • 1 networkpolicy allowing the pods of the chaos-kraken and chaos-pipeline namespaces to read the signal
  • 1 deployment named cerberus, unprivileged, watching the cluster it runs in
  • 1 service named cerberus (port 8080)

Values files

helm install chaos-cerberus-project startx/chaos-cerberus -f https://raw.githubusercontent.com/startxfr/helm-repository/master/charts/chaos-cerberus/values-startx-project.yaml
helm install chaos-cerberus-deploy startx/chaos-cerberus -f https://raw.githubusercontent.com/startxfr/helm-repository/master/charts/chaos-cerberus/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.appcerberusApplication name (functional tenant, default use Chart name)
context.version1.0.4Version name of this application (default use Chart appVersion)

chaos-cerberus values dictionary

KeyDefaultDescription
project{...}Configuration of the project (or namespace). Inherit from the project chart
project.enabledfalseEnable creation of the namespace
cerberus.enabledfalseEnable deploying the cerberus watchdog
cerberus.image.repositoryquay.io/krkn-chaos/cerberusImage repository
cerberus.image.taglatestImage tag, used when no digest is set
cerberus.image.digestsha256:59abd5d1...Image digest, takes precedence over the tag
cerberus.image.pullPolicyIfNotPresentImage pull policy
cerberus.privilegedfalseRun the container as privileged and bind the service account to the privileged SCC
cerberus.resources{}Resources requests and limits of the container
cerberus.exposefalseExpose the signal outside of the cluster (route based)
cerberus.allowedNamespaces[chaos-kraken, chaos-pipeline]Namespaces allowed to read the signal (networkpolicy)
cerberus.distributionopenshiftKind of cluster watched (openshift or kubernetes)
cerberus.isDaemontrueRun as a daemon (infinite loop instead of iterations checks)
cerberus.iterations25Number of iterations when cerberus is not a daemon
cerberus.sleep_time15Sleep time between 2 checks (seconds)
cerberus.timeout10Timeout of a single check (seconds)
cerberus.watch_nodestrueWatch nodes health as part of the global health signal
cerberus.watch_cluster_operatorstrueWatch cluster operators health as part of the global health signal
cerberus.watch_terminating_namespacestrueWatch terminating namespaces as part of the global health signal
cerberus.watch_master_schedulabletrueWatch for schedulable control plane nodes
cerberus.controlPlaneLabelnode-role.kubernetes.io/control-planeLabel identifying the control plane nodes
cerberus.watch_url_routes[]Url list of endpoints to watch as part of the global healthcheck (double array)
cerberus.watch_namespaces[...]List of namespaces to watch (supports regex patterns). Defaults to the critical OpenShift namespaces
cerberus.watch_namespaces_ignore_pattern["^installer.*"]Regex patterns for namespaces to exclude from watching
cerberus.custom_checks[]List of custom check scripts to run (path relative to the working directory). Example: ["custom/my_check.py"]
cerberus.customCheckScripts{}Custom check scripts copied in the custom directory (file name: python content exposing a main() function)
cerberus.prometheus.enabledfalseEnable the prometheus checks (API server latency, etcd leader changes). In local mode, binds the service account to cluster-monitoring-view
cerberus.prometheus.urlhttps://thanos-querier...:9091Prometheus or thanos querier URL
cerberus.prometheus.token""Bearer token used to query prometheus (in local mode, defaults to the service account token)
cerberus.runAsUser""User id of the container. Leave empty on OpenShift (assigned by the SCC), set it on plain Kubernetes (ex

Deploy chaos-cerberus with OpenTenant

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