Skip to main content

Create and run chaos experiments

Harness Chaos Engineering (HCE) gives you the flexibility to create elaborate chaos experiments that help create complex, real-life failure scenarios against which you can validate your applications. At the same time, the chaos experiments are declarative and you can construct them using the Chaos Studio user interface with no programmatic intervention.

A chaos experiment is composed of chaos faults that are arranged in a specific order to create a failure scenario. The chaos faults target various aspects of an application, including the constituent microservices and underlying infrastructure. You can tune the parameters associated with these faults to impart the desired chaos behavior.

For more information, go to flow of control in a chaos experiment.

Here is a interactive guide you can use to understand how to create a chaos experiment with a fault, pod-delete.

Execute experiment on a schedule

  1. To schedule the experiment run for specific periods, select Cron(Recurring run), enter the values based on what you select among Minutes or Hourly or Daily or Monthly or Yearly. The Cron Expression is automatically generated based on how you schedule to run the experiment.

  2. Select Set Schedule.

    cron experiment

Advanced experiment setup options

You can select Advanced Options on the Experiment Builder tab to configure the advanced options (described below) while creating an experiment for a Kubernetes chaos infrastructure:

Advanced Options

General options

Node Selector

Specifies the node on which the experiment pods will be scheduled. Provide the node label as a key-value pair.

  • Can be used with node-level faults to avoid the scheduling of the experiment pod on the target node(s).

  • Can be used to limit the scheduling of the experiment pods on nodes that have an unsupported OS.

    Node Selector

Toleration

Specifies the tolerations that must be satisfied by a tainted node to be able to schedule the experiment pods. For more information on taints and tolerations, go to the Kubernetes documentation.

  • Can be used with node-level faults to avoid the scheduling of the experiment pod on the target node(s).

  • Can be used to limit the scheduling of the experiment pods on nodes that have an unsupported OS.

    Toleration

Annotations

Specifies the annotations to be added to the experiment pods. Provide the annotations as key-value pairs. For more information on annotations, go to the Kubernetes documentation.

  • Can be used for bypassing network proxies enforced by service mesh tools like Istio.

    Annotations

Security options

Enable runAsUser

Specifies the user ID to be used for starting all the processes in the experiment pod containers. By default 1000 user ID is used.

  • Allows privileged access or restricted access for experiment pods

    runAsUser

Enable runAsGroup

Specifies the group ID to be used for starting all the processes in the experiment pod containers instead of a user ID.

  • Allows privileged access or restricted access for experiment pods

    runAsGroup