Convert Figma logo to code with AI

chaosblade-io logochaosblade

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

5,924
944
5,924
305

Top Related Projects

22,289

A powerful flow control component enabling reliability, resilience and monitoring for microservices. (面向云原生微服务的高可用流控防护组件)

Chaos Monkey is a resiliency tool that helps applications tolerate random instance failures.

A Chaos Engineering Platform for Kubernetes.

4,352

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

A powerful testing tool for Kubernetes clusters.

Quick Overview

ChaosBlade is an open-source chaos engineering platform that helps users simulate various system failures and test the resilience of cloud-native applications. It provides a wide range of experiment types, including CPU, memory, network, disk, and process faults, allowing developers and operators to identify potential weaknesses in their systems and improve overall reliability.

Pros

  • Comprehensive experiment types covering various aspects of system failures
  • Easy-to-use CLI and declarative YAML experiment definitions
  • Supports multiple platforms, including Kubernetes, Docker, and cloud providers
  • Extensible architecture allowing for custom experiment implementations

Cons

  • Learning curve for users new to chaos engineering concepts
  • Documentation could be more extensive and up-to-date
  • Limited integration with some popular observability and monitoring tools
  • Requires careful planning and execution to avoid unintended consequences in production environments

Getting Started

To get started with ChaosBlade, follow these steps:

  1. Install ChaosBlade:
curl -sf https://raw.githubusercontent.com/chaosblade-io/chaosblade/master/install.sh | sh
  1. Verify the installation:
blade version
  1. Run a simple CPU load experiment:
blade create cpu load --cpu-percent 80
  1. Destroy the experiment:
blade destroy <experiment_uid>

For more advanced usage and Kubernetes experiments, refer to the official documentation.

Competitor Comparisons

22,289

A powerful flow control component enabling reliability, resilience and monitoring for microservices. (面向云原生微服务的高可用流控防护组件)

Pros of Sentinel

  • Focuses on flow control, circuit breaking, and system protection
  • Provides real-time monitoring and dynamic rule configuration
  • Offers a rich set of adapters for various frameworks and libraries

Cons of Sentinel

  • Limited to Java ecosystem, while Chaosblade supports multiple languages
  • Lacks comprehensive chaos engineering capabilities compared to Chaosblade
  • Steeper learning curve for implementing complex scenarios

Code Comparison

Sentinel example:

try (Entry entry = SphU.entry("resourceName")) {
    // Business logic here
} catch (BlockException ex) {
    // Handle rejected request
}

Chaosblade example:

blade create cpu fullload --cpu-percent 80

Summary

Sentinel excels in flow control and system protection within the Java ecosystem, offering real-time monitoring and dynamic rule configuration. However, it has limitations in terms of language support and comprehensive chaos engineering capabilities compared to Chaosblade. Chaosblade provides a more versatile platform for chaos engineering across multiple languages and infrastructure components, but may lack some of the specific flow control features offered by Sentinel. The choice between the two depends on the specific requirements of the project and the desired scope of resilience testing.

Chaos Monkey is a resiliency tool that helps applications tolerate random instance failures.

Pros of Chaos Monkey

  • Specifically designed for AWS environments, making it ideal for cloud-native applications
  • Simpler setup and configuration process for those already using AWS
  • Integrates well with other Netflix OSS tools

Cons of Chaos Monkey

  • Limited to terminating EC2 instances, less versatile than ChaosBlade
  • Requires running on AWS, not suitable for on-premises or multi-cloud environments
  • Less active development and community support compared to ChaosBlade

Code Comparison

ChaosBlade (Go):

blade create cpu load --cpu-percent 80 --timeout 30

Chaos Monkey (Java):

@Configuration
public class ChaosMonkeyConfiguration {
    @Bean
    public ChaosMonkey chaosMonkey() {
        return new ChaosMonkey();
    }
}

ChaosBlade offers a more straightforward command-line interface for creating chaos experiments, while Chaos Monkey requires Java configuration and integration with Spring Boot applications.

ChaosBlade provides a wider range of chaos engineering capabilities, including network, disk, and process-level faults, making it more versatile for different scenarios. Chaos Monkey, on the other hand, focuses primarily on instance termination in AWS environments, which can be limiting for some use cases but simplifies setup for AWS users.

A Chaos Engineering Platform for Kubernetes.

Pros of Chaos Mesh

  • More comprehensive Kubernetes-native chaos engineering platform
  • Supports a wider range of chaos experiments, including pod, network, and I/O faults
  • Provides a user-friendly web UI for experiment management and visualization

Cons of Chaos Mesh

  • Steeper learning curve due to its more complex architecture
  • Requires Kubernetes cluster for operation, limiting its use in non-Kubernetes environments
  • Heavier resource consumption compared to ChaosBlade

Code Comparison

Chaos Mesh (YAML manifest):

apiVersion: chaos-mesh.org/v1alpha1
kind: PodChaos
metadata:
  name: pod-failure-example
spec:
  action: pod-failure
  mode: one
  selector:
    namespaces:
      - default

ChaosBlade (CLI command):

blade create k8s pod-pod fail --namespace default --kubeconfig ~/.kube/config

Both examples demonstrate creating a pod failure experiment, but Chaos Mesh uses a YAML manifest for Kubernetes-native integration, while ChaosBlade employs a CLI command.

4,352

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

Pros of Litmus

  • More extensive Kubernetes-native chaos engineering capabilities
  • Larger and more active community, with frequent updates and contributions
  • Comprehensive documentation and tutorials for easier adoption

Cons of Litmus

  • Steeper learning curve due to more complex architecture
  • Primarily focused on Kubernetes, limiting its use in non-containerized environments
  • Heavier resource footprint compared to Chaosblade

Code Comparison

Litmus experiment manifest:

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

Chaosblade experiment command:

blade create k8s pod-kill --namespace default --labels app=nginx --kubeconfig ~/.kube/config

Both tools offer ways to perform pod deletion experiments, but Litmus uses a declarative YAML approach, while Chaosblade employs a CLI-based method. Litmus provides more granular control and integration with Kubernetes resources, whereas Chaosblade offers a simpler, more straightforward execution model.

A powerful testing tool for Kubernetes clusters.

Pros of PowerfulSeal

  • Specifically designed for Kubernetes environments, offering deep integration and native support
  • Provides a web UI for easier management and visualization of chaos experiments
  • Supports autonomous mode for continuous chaos testing without manual intervention

Cons of PowerfulSeal

  • More limited scope, focusing primarily on Kubernetes-based systems
  • Less extensive fault injection scenarios compared to ChaosBlade's broader range of supported platforms
  • Steeper learning curve for users not familiar with Kubernetes concepts

Code Comparison

PowerfulSeal example (Python):

from powerfulseal.policy import PolicyRunner
from powerfulseal.k8s.k8s_inventory import K8sInventory

inventory = K8sInventory()
runner = PolicyRunner(inventory)
runner.run(policy_file="my_policy.yml")

ChaosBlade example (Go):

package main

import "github.com/chaosblade-io/chaosblade-spec-go/channel"

func main() {
    channel.Run("create", "cpu full load")
}

The code examples demonstrate the different approaches: PowerfulSeal uses a policy-based system tailored for Kubernetes, while ChaosBlade offers a more generic command-based interface for various chaos experiments across different platforms.

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

logo

Chaosblade: An Easy to Use and Powerful Chaos Engineering Toolkit

Build Status Financial Contributors on Open Collective codecov license CII Best Practices

中文版 README

Introduction

ChaosBlade is an Alibaba open source experimental injection tool that follows the principles of chaos engineering and chaos experimental models to help enterprises improve the fault tolerance of distributed systems and ensure business continuity during the process of enterprises going to cloud or moving to cloud native systems.

Chaosblade is an internal open source project of MonkeyKing. It is based on Alibaba's nearly ten years of failure testing and drill practice, and combines the best ideas and practices of the Group's businesses.

ChaosBlade is not only easy to use, but also supports rich experimental scenarios. The scenarios include:

  • Basic resources: such as CPU, memory, network, disk, process and other experimental scenarios;
  • Java applications: such as databases, caches, messages, JVM itself, microservices, etc. You can also specify any class method to inject various complex experimental scenarios;
  • C ++ applications: such as specifying arbitrary methods or experimental lines of code injection delay, tampering with variables and return values;
  • container: such as killing the container, the CPU in the container, memory, network, disk, process and other experimental scenarios;
  • Cloud-native platforms: For example, CPU, memory, network, disk, and process experimental scenarios on Kubernetes platform nodes, Pod network and Pod itself experimental scenarios such as killing Pods, and container experimental scenarios such as the aforementioned Docker container experimental scenario;

Encapsulating scenes by domain into individual projects can not only standardize the scenes in the domain, but also facilitate the horizontal and vertical expansion of the scenes. By following the chaos experimental model, the chaosblade cli can be called uniformly. The items currently included are:

  • chaosblade: Chaos experiment management tool, including commands for creating experiments, destroying experiments, querying experiments, preparing experimental environments, and canceling experimental environments. It is the execution of chaotic experiments. Tools, execution methods include CLI and HTTP. Provides complete commands, experimental scenarios, and scenario parameter descriptions, and the operation is simple and clear.
  • chaosblade-spec-go: Chaos experimental model Golang language definition, scenes implemented using Golang language are easy to implement based on this specification.
  • chaosblade-exec-os: Implementation of basic resource experimental scenarios.
  • chaosblade-exec-docker: Docker container experimental scenario implementation, standardized by calling the Docker API.
  • chaosblade-exec-cri: Container experimental scenario implementation, standardized by calling the CRI.
  • chaosblade-operator: Kubernetes platform experimental scenario is implemented, chaos experiments are defined by Kubernetes standard CRD method, it is very convenient to use Kubernetes resource operation method To create, update, and delete experimental scenarios, including using kubectl, client-go, etc., and also using the chaosblade cli tool described above.
  • chaosblade-exec-jvm: Java application experimental scenario implementation, using Java Agent technology to mount dynamically, without any access, zero-cost use It also supports uninstallation and completely recycles various resources created by the Agent.
  • chaosblade-exec-cplus: C ++ application experimental scenario implementation, using GDB technology to implement method and code line level experimental scenario injection.

CLI Command

You can download the latest chaosblade toolkit from Releases and extract it and use it. If you want to inject Kubernetes related fault scenarios, you need to install chaosblade-operator. For detailed Chinese usage documents, please see chaosblade-help-zh-cn .

chaosblade supports CLI and HTTP invocation methods. The supported commands are as follows:

  • prepare: alias is p, preparation before the chaos engineering experiment, such as drilling Java applications, you need to attach the java agent. For example, to drill an application whose application name is business, execute blade p jvm --process business on the target host. If the attach is successful, return the uid for status query or agent revoke.
  • revoke: alias is r, undo chaos engineering experiment preparation before, such as detaching java agent. The command is blade revoke UID
  • create: alias is c, create a chaos engineering experiment. The command is blade create [TARGET] [ACTION] [FLAGS]. For example, if you implement a Dubbo consumer call xxx.xxx.Service interface delay 3s, the command executed is blade create dubbo delay --consumer --time 3000 --Service xxx.xxx.Service, if the injection is successful, return the experimental uid for status query and destroy the experiment.
  • destroy: alias is d, destroy a chaos engineering experiment, such as destroying the Dubbo delay experiment mentioned above, the command is blade destroy UID
  • status: alias s, query preparation stage or experiment status, the command is blade status UID or blade status --type create
  • server: start the web server, expose the HTTP service, and call chaosblade through HTTP requests. For example, execute on the target machine xxxx: blade server start -p 9526 to perform a CPU full load experiment:curl "http://xxxx:9526/chaosblade?cmd=create%20cpu%20fullload"

Use the blade help [COMMAND] or blade [COMMAND] -h command to view help

Experience Demo

Download the chaosblade demo image and experience the use of the blade toolkit

demo.gif

Download image command:

docker pull chaosbladeio/chaosblade-demo

Run the demo container:

docker run -it --privileged chaosbladeio/chaosblade-demo

After entering the container, you can read the README.txt file to implement the chaos experiment, Enjoy it.

Cloud Native

chaosblade-operator The project is a chaos experiment injection tool for cloud-native platforms. It follows the chaos experiment model to standardize the experimental scenario and defines the experiment as Kubernetes CRD Resources, mapping experimental models to Kubernetes resource attributes, and very friendly combination of chaotic experimental models with Kubernetes declarative design. While relying on chaotic experimental models to conveniently develop scenarios, it can also well integrate Kubernetes design concepts, through kubectl or Write code to directly call the Kubernetes API to create, update, and delete chaotic experiments, and the resource status can clearly indicate the execution status of the experiment, and standardize Kubernetes fault injection. In addition to using the above methods to perform experiments, you can also use the chaosblade cli method to execute kubernetes experimental scenarios and query the experimental status very conveniently. For details, please read the chinese document: Chaos Engineering Practice under Cloud Native

Compile

This project is written in golang, so you need to install the latest golang version first. The minimum supported version is 1.11. After the Clone project, enter the project directory and execute the following command to compile:

make

If on a mac system, compile the current system version, execute:

make build_darwin

If you want to compile linux system version on mac system, execute:

make build_linux

You can also compile selectively, for example, you only need to compile cli and os scenes, then execute:

make build_with cli os
# If it is a mac system, run
make build_with cli os_darwin
# If you want to compile linux system version selectively, execute:
ARGS="cli os" make build_with_linux

Arch Linux install chaosblade-bin

yay -S chaosblade-bin

Bugs and Feedback

For bug report, questions and discussions please submit GitHub Issues.

You can also contact us via:

Contributing

We welcome every contribution, even if it is just punctuation. See details of CONTRIBUTING. For the promotion ladder of specific community participation students, see: (Contributor Ladder)

Business Registration

The original intention of our open source project is to lower the threshold for chaos engineering to be implemented in enterprises, so we highly value the use of the project in enterprises. Welcome everyone here ISSUE. After registration, you will be invited to join the corporate mail group to discuss the problems encountered by Chaos Engineering in the landing of the company and share the landing experience.

Contributors

Code Contributors

This project exists thanks to all the people who contribute. [Contribute].

License

Chaosblade is licensed under the Apache License, Version 2.0. See LICENSE for the full license text.