GithubHelp home page GithubHelp logo

titpetric / docker-chaos-monkey Goto Github PK

View Code? Open in Web Editor NEW
31.0 6.0 5.0 39 KB

A Chaos Monkey system for Docker and Docker Swarm

License: Other

Shell 100.00%
chaosmonkey netflix docker swarm chaos monkey failure

docker-chaos-monkey's Introduction

docker-chaos-monkey

A Chaos Monkey system for Docker and Docker Swarm.

Original ChaosMonkey Logo

Implemented for the book 12 Factor Applications with Docker and Go.

Using Chaos Monkey

Chaos monkey scripts take the following environment variables:

  • DOCKER_LABEL - default to role:disposable - the label of the containers to kill
  • SKIP_WARNING=1 - skip initial warning about chaos monkey being destructive

By default, if a container/service has the label role=disposable, then it is considered to be killed by chaos monkey. It is suggested to customize that label for service groups.

Chaos monkey won't kill the last alive container, but is not concurrency safe. Two deletions may be triggered in parallel, and both may succeed, bringing all your containers offline.

Docker / Docker Compose

Running the following would kill off one running local container with the role:disposable label.

  • DOCKER_LABEL=role:disposable ./chaos-docker.sh

You can pass the exact command you want to run on the container as the script arguments. For example: chaos-docker.sh (rm|kill|stop) -f. This allows you to customize the level with which your containers get killed off. It's would be fun to randomize this.

Docker Swarm

Running the following would kill off one locally running service container with the role:disposable label.

  • DOCKER_LABEL=role:disposable ./chaos.sh

The script doesn't take any additional arguments.

Rules

  • If the service has only 1 replica (1/1), a container will not be killed.
  • If the service has incomplete replicas (4/5), a container will not be killed.
  • If no containers are running on the current host, no containers will be killed.
  • Only one container per service is killed if the above conditions are met.

Creating a disposable service (example)

Creating a disposable service is as simple as adding a label role=disposable.

docker service create -l role=disposable --name gotwitter titpetric/gotwitter

Screenshot

Screenshot

docker-chaos-monkey's People

Contributors

titpetric avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

docker-chaos-monkey's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.