Convert Figma logo to code with AI

litmuschaos logolitmus

Litmus helps SREs and developers practice chaos engineering in a Cloud-native way. Chaos experiments are published at the ChaosHub (https://hub.litmuschaos.io). Community notes is at https://hackmd.io/a4Zu_sH4TZGeih-xCimi3Q

4,352
684
4,352
379

Top Related Projects

Chaos Engineering Toolkit & Orchestration for Developers

A Chaos Engineering Platform for Kubernetes.

An easy to use and powerful chaos engineering experiment toolkit.(阿里巴巴开源的一款简单易用、功能强大的混沌实验注入工具)

2,754

Chaos testing, network emulation, and stress testing tool for containers

A powerful testing tool for Kubernetes clusters.

Quick Overview

Litmus is an open-source Chaos Engineering platform for Kubernetes environments. It provides a comprehensive set of tools and frameworks to design, execute, and observe chaos experiments, helping teams improve the resilience and reliability of their cloud-native applications.

Pros

  • Extensive library of pre-defined chaos experiments for various Kubernetes resources
  • Integrates well with CI/CD pipelines for automated chaos testing
  • Provides a user-friendly web interface (ChaosCenter) for experiment management
  • Supports custom experiment creation and workflow automation

Cons

  • Steep learning curve for users new to Chaos Engineering concepts
  • Limited support for non-Kubernetes environments
  • Some advanced features may require additional setup and configuration
  • Documentation can be overwhelming for beginners

Code Examples

  1. Installing Litmus using Helm:
helm repo add litmuschaos https://litmuschaos.github.io/litmus-helm/
helm install chaos litmuschaos/litmus --namespace=litmus --create-namespace
  1. Applying a pod-delete chaos experiment:
apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata:
  name: nginx-chaos
  namespace: default
spec:
  appinfo:
    appns: 'default'
    applabel: 'app=nginx'
    appkind: 'deployment'
  chaosServiceAccount: pod-delete-sa
  experiments:
    - name: pod-delete
      spec:
        components:
          env:
            - name: TOTAL_CHAOS_DURATION
              value: '30'
            - name: CHAOS_INTERVAL
              value: '10'
            - name: FORCE
              value: 'false'
  1. Running a chaos experiment using the Litmus CLI:
litmus run chaos --name nginx-chaos

Getting Started

To get started with Litmus:

  1. Install Litmus on your Kubernetes cluster:

    kubectl apply -f https://litmuschaos.github.io/litmus/2.9.0/litmus-2.9.0.yaml
    
  2. Access the ChaosCenter UI:

    kubectl port-forward svc/chaos-litmus-frontend-service 9091:9091 -n litmus
    

    Open http://localhost:9091 in your browser.

  3. Create a ChaosExperiment and ChaosEngine as shown in the code examples above.

  4. Run the experiment using the ChaosCenter UI or Litmus CLI.

  5. Observe the results and analyze the impact on your application.

Competitor Comparisons

Chaos Engineering Toolkit & Orchestration for Developers

Pros of Chaostoolkit

  • Language-agnostic with support for multiple programming languages
  • Extensible architecture allowing custom extensions and integrations
  • Comprehensive documentation and active community support

Cons of Chaostoolkit

  • Steeper learning curve for beginners
  • Less focus on Kubernetes-specific chaos experiments
  • Smaller ecosystem of pre-built experiments compared to Litmus

Code Comparison

Litmus experiment definition:

apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata:
  name: nginx-chaos
spec:
  appinfo:
    appns: 'default'
    applabel: 'app=nginx'
  chaosServiceAccount: pod-delete-sa
  experiments:
    - name: pod-delete

Chaostoolkit experiment definition:

{
    "version": "1.0.0",
    "title": "What happens when we kill a microservice?",
    "description": "N/A",
    "steady-state-hypothesis": {
        "title": "Services are all available and healthy",
        "probes": [
            {
                "type": "probe",
                "name": "all-services-are-healthy",
                "tolerance": true,
                "provider": {
                    "type": "python",
                    "module": "chaosk8s.probes",
                    "func": "all_microservices_healthy"
                }
            }
        ]
    },
    "method": [
        {
            "type": "action",
            "name": "kill-microservice",
            "provider": {
                "type": "python",
                "module": "chaosk8s.pod.actions",
                "func": "terminate_pods",
                "arguments": {
                    "label_selector": "app=my-app",
                    "name_pattern": "my-app-*",
                    "rand": true
                }
            },
            "pauses": {
                "after": 10
            }
        }
    ]
}

A Chaos Engineering Platform for Kubernetes.

Pros of Chaos Mesh

  • More extensive fault injection types, including network, I/O, and kernel faults
  • Better support for multi-cluster scenarios and cloud-native environments
  • User-friendly web UI for experiment management and visualization

Cons of Chaos Mesh

  • Steeper learning curve due to more complex architecture
  • Less extensive documentation compared to Litmus
  • Fewer pre-built chaos experiments available out-of-the-box

Code Comparison

Litmus experiment definition:

apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata:
  name: nginx-chaos
spec:
  appinfo:
    appns: 'default'
    applabel: 'app=nginx'
  chaosServiceAccount: pod-delete-sa
  experiments:
    - name: pod-delete

Chaos Mesh experiment definition:

apiVersion: chaos-mesh.org/v1alpha1
kind: PodChaos
metadata:
  name: pod-failure
spec:
  action: pod-failure
  mode: one
  selector:
    labelSelectors:
      'app': 'nginx'

Both Litmus and Chaos Mesh are powerful chaos engineering tools for Kubernetes environments. Litmus offers a more straightforward approach with extensive documentation and pre-built experiments, making it easier for beginners. Chaos Mesh provides more advanced features and fault injection types, catering to complex scenarios and cloud-native environments. The choice between the two depends on the specific requirements and complexity of the target infrastructure.

An easy to use and powerful chaos engineering experiment toolkit.(阿里巴巴开源的一款简单易用、功能强大的混沌实验注入工具)

Pros of ChaosBlade

  • Supports a wider range of platforms, including Linux, Windows, and Kubernetes
  • Offers a more extensive set of chaos experiments, including network, disk, and process-level faults
  • Provides a CLI tool for easier experiment execution and management

Cons of ChaosBlade

  • Less focus on cloud-native environments compared to Litmus
  • Smaller community and fewer integrations with other tools
  • Documentation is not as comprehensive as Litmus

Code Comparison

ChaosBlade experiment definition:

apiVersion: chaosblade.io/v1alpha1
kind: ChaosBlade
metadata:
  name: cpu-load
spec:
  experiments:
  - scope: node
    target: cpu
    action: fullload

Litmus experiment definition:

apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata:
  name: cpu-stress
spec:
  appinfo:
    appns: default
    applabel: 'app=nginx'
  chaosServiceAccount: litmus-admin
  experiments:
  - name: cpu-stress

Both ChaosBlade and Litmus are powerful chaos engineering tools, but they cater to slightly different use cases. ChaosBlade offers a broader range of experiments across various platforms, while Litmus is more focused on cloud-native and Kubernetes environments. The choice between the two depends on the specific requirements of your infrastructure and the types of chaos experiments you need to perform.

2,754

Chaos testing, network emulation, and stress testing tool for containers

Pros of Pumba

  • Simpler setup and usage, focused specifically on Docker container chaos testing
  • Lightweight and easy to integrate into existing Docker environments
  • Supports network emulation for simulating various network conditions

Cons of Pumba

  • Limited scope compared to Litmus, focusing primarily on Docker containers
  • Fewer built-in experiments and scenarios compared to Litmus' extensive catalog
  • Less active community and development compared to Litmus

Code Comparison

Pumba command example:

pumba netem --duration 2m delay --time 3000 re2:^redis

Litmus experiment example:

apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata:
  name: nginx-chaos
spec:
  appinfo:
    appns: 'default'
    applabel: 'app=nginx'
    appkind: 'deployment'
  chaosServiceAccount: pod-delete-sa
  experiments:
    - name: pod-delete
      spec:
        components:
          env:
            - name: TOTAL_CHAOS_DURATION
              value: '30'

While Pumba focuses on Docker-specific chaos engineering with simple command-line usage, Litmus offers a more comprehensive Kubernetes-native chaos engineering platform with a wider range of experiments and scenarios.

A powerful testing tool for Kubernetes clusters.

Pros of PowerfulSeal

  • Focused on Kubernetes-specific chaos testing, providing deeper integration with K8s components
  • Offers a powerful CLI interface for quick and easy chaos experiments
  • Includes a web UI for visualizing and managing chaos scenarios

Cons of PowerfulSeal

  • Less extensive ecosystem and community support compared to Litmus
  • More limited in terms of supported platforms and integrations
  • Fewer pre-defined chaos experiments and scenarios available out-of-the-box

Code Comparison

PowerfulSeal example:

from powerfulseal.policy import PolicyRunner
from powerfulseal.k8s import K8sClient

k8s_client = K8sClient()
runner = PolicyRunner(k8s_client)
runner.run(policy_file="chaos_policy.yml")

Litmus example:

apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata:
  name: nginx-chaos
spec:
  appinfo:
    appns: 'default'
    applabel: 'app=nginx'
  chaosServiceAccount: pod-delete-sa
  experiments:
    - name: pod-delete

Both projects aim to introduce chaos into Kubernetes clusters, but they differ in their approach and implementation. PowerfulSeal offers a more programmatic and Kubernetes-focused solution, while Litmus provides a broader range of chaos experiments and a more extensive ecosystem.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

LitmusChaos

LitmusChaos

Open Source Chaos Engineering Platform

Slack Channel GitHub Workflow Docker Pulls GitHub stars GitHub issues Twitter Follow OpenSSF Best Practices FOSSA Status YouTube Channel



Read this in other languages.

🇰🇷 🇨🇳 🇧🇷 🇮🇳

Overview

LitmusChaos is an open source Chaos Engineering platform that enables teams to identify weaknesses & potential outages in infrastructures by inducing chaos tests in a controlled way. Developers & SREs can practice Chaos Engineering with LitmusChaos as it is easy to use, based on modern Chaos Engineering principles & community collaborated. It is 100% open source & a CNCF project.

LitmusChaos takes a cloud-native approach to create, manage and monitor chaos. The platform itself runs as a set of microservices and uses Kubernetes custom resources (CRs) to define the chaos intent, as well as the steady state hypothesis.

At a high-level, Litmus comprises of:

  • Chaos Control Plane: A centralized chaos management tool called chaos-center, which helps construct, schedule and visualize Litmus chaos workflows
  • Chaos Execution Plane Services: Made up of a chaos agent and multiple operators that execute & monitor the experiment within a defined target Kubernetes environment.

architecture summary

At the heart of the platform are the following chaos custom resources:

  • ChaosExperiment: A resource to group the configuration parameters of a particular fault. ChaosExperiment CRs are essentially installable templates that describe the library carrying out the fault, indicate permissions needed to run it & the defaults it will operate with. Through the ChaosExperiment, Litmus supports BYOC (bring-your-own-chaos) that helps integrate (optional) any third-party tooling to perform the fault injection.

  • ChaosEngine: A resource to link a Kubernetes application workload/service, node or an infra component to a fault described by the ChaosExperiment. It also provides options to tune the run properties and specify the steady state validation constraints using 'probes'. ChaosEngine is watched by the Chaos-Operator, which reconciles it (triggers experiment execution) via runners.

The ChaosExperiment & ChaosEngine CRs are embedded within a Workflow object that can string together one or more experiments in a desired order.

  • ChaosResult: A resource to hold the results of the experiment run. It provides details of the success of each validation constraint, the revert/rollback status of the fault as well as a verdict. The Chaos-exporter reads the results and exposes information as prometheus metrics. ChaosResults are especially useful during automated runs.

ChaosExperiment CRs are hosted on hub.litmuschaos.io. It is a central hub where the application developers or vendors share their chaos experiments so that their users can use them to increase the resilience of the applications in production.

Use cases

  • For Developers: To run chaos experiments during application development as an extension of unit testing or integration testing.
  • For CI/CD 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 deployment system and increases resilience.

Getting Started with Litmus

To get started, check out the Litmus Docs and specifically the Installation section of the Getting Started with Litmus page.

Contributing to Chaos Hub

Check out the Contributing Guidelines for the Chaos Hub

Community

Community Resources:

Feel free to reach out if you have any queries,concerns, or feature requests

  • Give us a star ⭐️ - If you are using LitmusChaos or think it is an interesting project, we would love a star ❤️

  • Follow LitmusChaos on Twitter @LitmusChaos.

  • Subscribe to the LitmusChaos YouTube channel for regular updates & meeting recordings.

  • To join our Slack Community and meet our community members, put forward your questions & opinions, join the #litmus channel on the Kubernetes Slack.

Community Meetings

  1. Community Meetings These will be hosted every 3rd Wednesday of every month at 5:30 PM GMT /6:30 PM CEST /10 PM IST The community meetings will involve discussing community updates, sharing updates on new features/releases and discussing user/adopter stories. Everyone in the community is invited for the same to participate in the LitmusChaos community meetings.

  2. Contributor Meetings These will be hosted every second & last Thursday of every month at 2:30 PM GMT /3:30 PM CEST /7 PM IST The contributor meetings are only meant to discuss technical and non-technical contributions to LitmusChaos. Maintainers, present Contributors and aspiring contributors are invited to participate in the LitmusChaos contributor meetings to discuss issues, fixes, enhancements and future contributions

Fill out the LitmusChaos Meetings invite form to get your Calendar invite!

Videos

And More....

Blogs

Community Blogs:

Adopters

Check out the Adopters of LitmusChaos

(Send a PR to the above page if you are using Litmus in your chaos engineering practice)

License

Litmus is licensed under the Apache License, Version 2.0. See LICENSE for the full license text. Some of the projects used by the Litmus project may be governed by a different license, please refer to its specific license.

FOSSA Status

Litmus Chaos is part of the CNCF Projects.

CNCF

Important Links

Litmus Docs Litmus Docs
CNCF Landscape Litmus on CNCF Landscape