chaos-pipeline
by startxfr
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
v1API. - Optional: a cerberus instance (see the chaos-cerberus chart) whose
allowedNamespacescontains 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
- startx-project : values-startx-project.yaml creates the
startx-chaos-pipelinenamespace - startx-deploy : values-startx-deploy.yaml deploys the pipelines in
startx-chaos-pipeline, gated by the cerberus ofstartx-chaos-cerberus
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
| 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 | pipeline | Application name (functional tenant, default use Chart name) |
| context.version | 5.2.15 | Version name of this application (default use Chart appVersion) |
chaos-pipeline 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 |
| pipeline.enabled | false | Deploy the chaos tasks and pipelines |
| pipeline.images.krkn.repository | quay.io/krkn-chaos/krkn | krkn image repository (task krkn-run) |
| pipeline.images.krkn.tag | v5.2.15 | krkn image tag, used when no digest is set |
| pipeline.images.krkn.digest | sha256:43b3efda... | krkn image digest, takes precedence over the tag |
| pipeline.images.hub.repository | quay.io/krkn-chaos/krkn-hub | krkn-hub image repository (task krkn-hub-scenario) |
| pipeline.images.hub.pullPolicy | Always | krkn-hub image pull policy (rolling tags) |
| pipeline.images.check.repository | registry.access.redhat.com/ubi9/ubi-minimal | Image with curl (task cerberus-check) |
| pipeline.images.check.tag | 9.9 | Check image tag, used when no digest is set |
| pipeline.images.check.digest | sha256:08d4c70f... | Check image digest, takes precedence over the tag |
| pipeline.privileged | false | Run the krkn steps as privileged and bind the service account to the privileged SCC |
| pipeline.privilegedWorkloads | auto | Give 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.nodeSelector | node-role.kubernetes.io/worker= | Default of the node-selector parameter: nodes targeted by the node level scenarios (${NODE_SELECTOR}) |
| pipeline.workloadNamespace | default | Default of the workload-namespace parameter: namespace of the krkn helper pods (${WORKLOAD_NAMESPACE}), added to privilegedNamespaces |
| pipeline.checkCriticalAlerts | false | Fail a scenario when a critical alert is firing after the chaos (needs serviceaccounts/token create on prometheus-k8s, else silently skipped) |
| pipeline.healthCheck.interval | 2 | Interval of the HTTP health check (seconds) |
| pipeline.healthCheck.verify | true | Verify 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.imageSignatureVerification | true | Verify 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.clusterAdmin | false | Bind 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.enabled | true | Default of the cerberus-enabled pipeline parameter: gate the pipelines with the cerberus signal |
| pipeline.cerberus.url | http://cerberus.chaos-cerberus.svc.cluster.local:8080 | Default of the cerberus-url pipeline parameter |
| pipeline.cerberus.timeout | 300 | Default of the cerberus-timeout pipeline parameter (seconds) |
| pipeline.infra.enabled | true | Deploy the chaos-infra pipeline |
| pipeline.postCheck.clusterOperators.enabled | false | Default 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.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartchaos-pipeline is pinned at v21.3.412 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