chaos-cerberus
by startxfr
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-krakenandchaos-pipelinenamespaces to read the signal - 1 deployment named cerberus, unprivileged, watching the cluster it runs in
- 1 service named cerberus (port 8080)
Values files
- startx-deploy : values-startx-deploy.yaml deploys cerberus in the
startx-chaos-cerberusnamespace, exposed by a route - startx-project : values-startx-project.yaml creates the
startx-chaos-cerberusnamespace
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
| Key | Default | Description |
|---|---|---|
| context.scope | companyname | Name of the global scope for this application (organizational tenant) |
| context.cluster | clustername | 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 | chaos | Component name of this application (logical tenant) |
| context.app | cerberus | Application name (functional tenant, default use Chart name) |
| context.version | 1.0.4 | Version name of this application (default use Chart appVersion) |
chaos-cerberus values dictionary
| Key | Default | Description |
|---|---|---|
| project | {...} | Configuration of the project (or namespace). Inherit from the project chart |
| project.enabled | false | Enable creation of the namespace |
| cerberus.enabled | false | Enable deploying the cerberus watchdog |
| cerberus.image.repository | quay.io/krkn-chaos/cerberus | Image repository |
| cerberus.image.tag | latest | Image tag, used when no digest is set |
| cerberus.image.digest | sha256:59abd5d1... | Image digest, takes precedence over the tag |
| cerberus.image.pullPolicy | IfNotPresent | Image pull policy |
| cerberus.privileged | false | Run the container as privileged and bind the service account to the privileged SCC |
| cerberus.resources | {} | Resources requests and limits of the container |
| cerberus.expose | false | Expose the signal outside of the cluster (route based) |
| cerberus.allowedNamespaces | [chaos-kraken, chaos-pipeline] | Namespaces allowed to read the signal (networkpolicy) |
| cerberus.distribution | openshift | Kind of cluster watched (openshift or kubernetes) |
| cerberus.isDaemon | true | Run as a daemon (infinite loop instead of iterations checks) |
| cerberus.iterations | 25 | Number of iterations when cerberus is not a daemon |
| cerberus.sleep_time | 15 | Sleep time between 2 checks (seconds) |
| cerberus.timeout | 10 | Timeout of a single check (seconds) |
| cerberus.watch_nodes | true | Watch nodes health as part of the global health signal |
| cerberus.watch_cluster_operators | true | Watch cluster operators health as part of the global health signal |
| cerberus.watch_terminating_namespaces | true | Watch terminating namespaces as part of the global health signal |
| cerberus.watch_master_schedulable | true | Watch for schedulable control plane nodes |
| cerberus.controlPlaneLabel | node-role.kubernetes.io/control-plane | Label 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.enabled | false | Enable the prometheus checks (API server latency, etcd leader changes). In local mode, binds the service account to cluster-monitoring-view |
| cerberus.prometheus.url | https://thanos-querier...:9091 | Prometheus 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.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartchaos-cerberus is pinned at v21.3.418 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