This page serves as a guide to develop either a new Chaos Chart or a new experiment in a Chaos Chart which are published at ChaosHub.
Below are some key points to remember before understanding how to write a new chart or an experiment.
Chaos Charts repository : https://github.com/litmuschaos/chaos-charts
Litmusbooks repository : https://github.com/litmuschaos/litmus-ansible/tree/master/experiments
Website rendering code repository: https://github.com/litmuschaos/charthub.litmuschaos.io
The experiments & chaos libraries are typically written in Ansible, though not mandatory. Ensure that the experiments can be executed in a container & can read/update the litmuschaos custom resources. For example, if you are writing an experiment in Go, use this clientset
A group of Choas Experiments put together in a YAML file. Each group or chart has a metadata manifest called
that holds data such as
links etc.., This metadata is rendered on the ChartHub.
A chaos chart also consists of a
package manifest that is an index of available experiments in the chart.
ChaosExperiment is a CRD that specifies the nature of a Chaos Experiment. The YAML file that constitutes a Chaos Experiment CR is stored under a Chaos Chart of ChaosHub and typically consists of low-level chaos parameters specific to that experiment, set to their default values.
Here is an example chaos experiment CR for a pod-delete experiment
Litmus book is an
ansible playbook that encompasses the logic of pre-checks, chaos-injection, post-checks, and result-updates.
Typically, these are accompanied by a Kubernetes job that can execute the respective playbook.
Here is an example of the litmus book for the pod-delete experiment.
ansible business logic inside Litmus books can make use of readily available chaos functions. The chaos functions are available as
task-files which are wrapped in one of the chaos libraries. See plugins for more details.
Developing a Chaos Experiment
A detailed how-to guide on developing chaos experiments is available here