What is Litmus?
Litmus is a tool to practice chaos engineering in a Kubernetes native way which utilises cloud-native approach to create, manage and monitor chaos. Litmus provides chaos specific CRDs for Cloud-Native developers and SREs to inject, orchestrate and monitor chaos to find weaknesses in Kubernetes deployments. It helps the users to validate resiliency by injecting chaos into their applications.
.Chaos is orchestrated using the following Kubernetes Custom Resource Definitions (CRDs):
- ChaosEngine: A resource to link a Kubernetes application or Kubernetes node to a ChaosExperiment. ChaosEngine is watched by Litmus' Chaos-Operator which then invokes Chaos-Experiments
- ChaosExperiment: A resource to group the configuration parameters of a chaos experiment. ChaosExperiment CRs are created by the operator when experiments are invoked by ChaosEngine.
- ChaosResult: A resource to hold the results of a chaos-experiment. The Chaos-exporter reads the results and exports the metrics into a configured Prometheus server.
- For Developers: To run chaos experiments during application development as an extension of unit testing or integration testing.
- For CI pipeline builders: To run chaos as a pipeline stage to find bugs when the application is subjected to fail paths in a pipeline.
- For SREs: To plan and schedule chaos experiments into the application and/or surrounding infrastructure. This practice identifies the weaknesses in the system and increases resilience.
How to install?
Installation of litmus can be done by executing the following command:
kubectl apply -f https://litmuschaos.github.io/pages/litmus-operator-v1.0.0.yaml
Verify if the chaos operator is running using the following command:
kubectl get pods -n litmus
chaos-operator-ce-554d6c8f9f-slc8k 1/1 Running 0 6m41s
Verify if chaos CRDs are installed using the following command:
kubectl get crds | grep chaos
Install OpenEBS chaos experiments Custom Resources
To create OpenEBS chaos experiments CRs, execute the following command:
kubectl create -f https://hub.litmuschaos.io/api/chaos?file=charts/openebs/experiments.yaml -n <application_namespace>
Verify if the chaos experiments are installed using the following command:
kubectl get chaosexperiments -n <application_namespace>
The output will be similar to the following: