chaos-pipeline

by startxfr

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

Helm chart used to deploy Tekton chaos testing pipelines on Openshift or Kubernetes cluster. The pipelines run krkn (kraken) scenarios against the cluster infrastructure or an application, gated by the cerberus health signal. This chart is part of the startx chaos helm chart suite.

About this chart

Chaos Chart : Pipeline

This helm chart deploys Tekton chaos testing pipelines on an Openshift or Kubernetes cluster. The pipelines run krkn scenarios, one task per scenario, gated by the cerberus health signal:

  • chaos-infra: chaos testing of the cluster infrastructure (platform pods, node pressure, node reboot).
  • chaos-application: chaos testing of an application stack, chosen with the parameters of the run.

Upstream project: krkn-chaos/krkn version v5.2.15, image quay.io/krkn-chaos/krkn, and krkn-chaos/krkn-hub (documentation). The tasks use the tekton.dev/v1 API.

Installing this chart runs nothing: it creates the tasks and the pipelines. A chaos run starts only when you create a PipelineRun.

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.

  • OpenShift Pipelines (see the cluster-pipeline chart) or Tekton Pipelines with the v1 API.
  • Optional: a cerberus instance (see the chaos-cerberus chart) whose allowedNamespaces contains the namespace of the pipelines.

Chaos scenarios destroy resources. Read each scenario before enabling it, start with pod scenarios, and never run node 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-pipeline

4. Install this component

# Install the pipeline project
helm install --set project.enabled=true chaos-pipeline-project startx/chaos-pipeline
# Deploy the tasks and the pipelines
helm install --set pipeline.enabled=true -n chaos-pipeline chaos-pipeline-instance startx/chaos-pipeline
# Start a run of the infrastructure pipeline
oc create -n chaos-pipeline -f https://raw.githubusercontent.com/startxfr/helm-repository/master/charts/chaos-pipeline/examples/tekton/pipelinerun-infra.yaml

Default values

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

  • 1 project named chaos-pipeline
  • 1 serviceaccount named chaos-pipeline, with a chaos clusterrole and its binding
  • 1 configmap named chaos-pipeline-scenarios with the enabled scenarios
  • 4 tasks: cerberus-check, clusteroperator-check, krkn-run and krkn-hub-scenario
  • 2 pipelines: chaos-infra (3 platform pod scenarios enabled) and chaos-application (pod and container scenarios enabled)
  • no pipelinerun

Values files

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

chaos-pipeline values dictionary

KeyDefaultDescription
project{...}Configuration of the project (or namespace). Inherit from the project chart
project.enabledfalseEnable creation of the namespace
pipeline.enabledfalseDeploy the chaos tasks and pipelines
pipeline.images.krkn.repositoryquay.io/krkn-chaos/krknkrkn image repository (task krkn-run)
pipeline.images.krkn.tagv5.2.15krkn image tag, used when no digest is set
pipeline.images.krkn.digestsha256:43b3efda...krkn image digest, takes precedence over the tag
pipeline.images.hub.repositoryquay.io/krkn-chaos/krkn-hubkrkn-hub image repository (task krkn-hub-scenario)
pipeline.images.hub.pullPolicyAlwayskrkn-hub image pull policy (rolling tags)
pipeline.images.check.repositoryregistry.access.redhat.com/ubi9/ubi-minimalImage with curl (task cerberus-check)
pipeline.images.check.tag9.9Check image tag, used when no digest is set
pipeline.images.check.digestsha256:08d4c70f...Check image digest, takes precedence over the tag
pipeline.privilegedfalseRun the krkn steps as privileged and bind the service account to the privileged SCC
pipeline.privilegedWorkloadsautoGive the service account the privileged SCC in privilegedNamespaces (auto: when an enabled scenario needs it)
pipeline.privilegedNamespaces[default]Namespaces where krkn starts its privileged helper pods
pipeline.nodeSelectornode-role.kubernetes.io/worker=Default of the node-selector parameter: nodes targeted by the node level scenarios (${NODE_SELECTOR})
pipeline.workloadNamespacedefaultDefault of the workload-namespace parameter: namespace of the krkn helper pods (${WORKLOAD_NAMESPACE}), added to privilegedNamespaces
pipeline.checkCriticalAlertsfalseFail a scenario when a critical alert is firing after the chaos (needs serviceaccounts/token create on prometheus-k8s, else silently skipped)
pipeline.healthCheck.interval2Interval of the HTTP health check (seconds)
pipeline.healthCheck.verifytrueVerify the TLS certificate of the health check endpoint (false for a self-signed route)
pipeline.healthCheck.existingSecret""Existing Secret with the optional keys bearer-token and auth (username,password, without " or \)
pipeline.imageSignatureVerificationtrueVerify the signature of the workload images started by krkn
pipeline.resources{}Resources requests and limits of the krkn steps
pipeline.checkResources{}Resources requests and limits of the cerberus-check step
pipeline.rbac.clusterAdminfalseBind the service account to cluster-admin instead of the chaos ClusterRole of this chart
pipeline.rbac.extraRules[]Rules added to the chaos ClusterRole of this chart
pipeline.cloud.existingSecret""Name of an existing Secret exposed as environment variables (cloud credentials of the node scenarios)
pipeline.cerberus.enabledtrueDefault of the cerberus-enabled pipeline parameter: gate the pipelines with the cerberus signal
pipeline.cerberus.urlhttp://cerberus.chaos-cerberus.svc.cluster.local:8080Default of the cerberus-url pipeline parameter
pipeline.cerberus.timeout300Default of the cerberus-timeout pipeline parameter (seconds)
pipeline.infra.enabledtrueDeploy the chaos-infra pipeline
pipeline.postCheck.clusterOperators.enabledfalseDefault of the clusteroperator-check parameter: final check that every ClusterOperator is available and not degraded
pipeline.postCheck.clusterOperators.ignore[]Default of the clusteroperator-ignore parameter: ClusterOperators left out of the check
pipeline.postCheck.clusterOpe

Deploy chaos-pipeline with OpenTenant

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