chaos-master

command module
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 5, 2021 License: MIT Imports: 10 Imported by: 0

README

Build Status Go Report Card codebeat badge codecov.io

chaos-master

The master provides an api to send fault injections to the chaos bots

Chaos in practice
  1. Start by defining a ‘steady state’.
  2. Hypothesize that this steady state will continue in both the control group and the experimental group.
  3. Inject failures that reflect real world events.
  4. Try to disprove the hypothesis by looking for a difference in steady state between the control group and the experimental group.
  5. Recover fast to the ‘steady state’.

More info on https://principlesofchaos.org/

The master and bots focus on points 3 and 5

API

See the api specification after starting the master at \<host\>/chaos/api/v1/swagger/index.html

Starting Up

Start the chaos master providing a config.file that contains the job definitions. See an example of the file in the config/example folder.

# Contain the configuration for the port and scheme of the api. 
# The deafault values are port: 8080 and scheme: http
api_options:
  port: 8090
  scheme: http

# Contain the definition of all enabled failures. 
# Each failure injection needs to be defined in a job together with the targets that are in scope
jobs:
    # The unique name of the job. The character ',' is not allowed
  - job_name: "docker failure injection"
    # The type of the failure. Can be [Docker, Service, CPU, Server, Network]
    type: "Docker"
    # The name of the target component. Only applicable to Docker and Service failure types
    component_name: "nginx"
    # The list of targets for which is this failure can be applied
    targets: ['127.0.0.1:8083', '127.0.0.1:8081']
  - job_name: "network injection"
    type: "Network"
    targets: ['127.0.0.1:8081']

# Contains the tls configuration for the communication with the bots. 
# If not specified will default to http
# If specified the traffic to the bots will be https
# You can only provide a peer token if the traffic is https
bots:
  # CA certificate
  ca_cert: "config/test/certs/ca-cert.pem"
  # The pub cert for the connection with the bot
  public_cert: "config/test/certs/server-cert.pem"
  # peer token for authorization with the bot. A public cert needs to also be provided
  peer_token: 30028dd6-a641-4ac3-91d8-1e214ac5e6f6

# Contains the configuration for the healthcheck towards the bots
health_check:
  # If set to active the master with send a healthcheck request to the bots every 1 minute
  active: false
  # If set to active the status of the healthcheck will be reported in application log (stderr)
  report: false

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL