Giter VIP home page Giter VIP logo

chaos-wave's Introduction

chaos-wave

chaos-wave will randomly kill and remove running container. Inspirted by chaos monkey form netflix.

Usage

$ docker run -v /var/run/docker.sock:/var/run/docker.sock furikuri/chaos-wave --interval 15m --duration 2h

Default interval is 10 minutes. Default duration is 1 hour.

Example usage with docker swarm service

First start a service within docker swarm.

$ docker service create --replicas=3 --name hello-docker furikuri/hello-docker

Let's observe the running containers with watch 'docker ps'.

Every 2,0s: docker ps                                                                                                                                                Sun Sep 11 12:31:50 2016

CONTAINER ID        IMAGE                          COMMAND                  CREATED             STATUS              PORTS               NAMES
c51676f6731f        furikuri/hello-docker:latest   "/bin/sh -c 'node ser"   8 seconds ago       Up 6 seconds        3000/tcp            hello-docker.1.8q22jjf5i7trubngv8wo4sh1v
9e6114c94252        furikuri/hello-docker:latest   "/bin/sh -c 'node ser"   8 seconds ago       Up 6 seconds        3000/tcp            hello-docker.2.5fwbshxr1p88mcszrs1u6zdxw
e0f33516014e        furikuri/hello-docker:latest   "/bin/sh -c 'node ser"   8 seconds ago       Up 6 seconds        3000/tcp            hello-docker.3.3yyalv0viof2x3runw9nb4yyr

Now let's start the chaos-wave. After 30 seconds we should see the first output, which tells us that the first container has been killed.

$ docker run -v /var/run/docker.sock:/var/run/docker.sock furikuri/chaos-wave --interval 30s --duration 2h
Duration: 2h0m0s.
Interval: 30s.
Stopping container with name '/hello-docker.2.5fwbshxr1p88mcszrs1u6zdxw'

This container will be not existing in our docker ps anymore.

Every 2,0s: docker ps                                                                                                                                                Sun Sep 11 12:32:54 2016

CONTAINER ID        IMAGE                          COMMAND                  CREATED              STATUS              PORTS               NAMES
44864f1ef4f6        furikuri/chaos-wave            "/app/main --interval"   33 seconds ago       Up 31 seconds                           high_hugle
c51676f6731f        furikuri/hello-docker:latest   "/bin/sh -c 'node ser"   About a minute ago   Up About a minute   3000/tcp            hello-docker.1.8q22jjf5i7trubngv8wo4sh1v
e0f33516014e        furikuri/hello-docker:latest   "/bin/sh -c 'node ser"   About a minute ago   Up About a minute   3000/tcp            hello-docker.3.3yyalv0viof2x3runw9nb4yyr

But after a few seconds, docker swarm should start a new container.

Every 2,0s: docker ps                                                                                                                                                Sun Sep 11 12:33:01 2016

CONTAINER ID        IMAGE                          COMMAND                  CREATED              STATUS              PORTS               NAMES
1bdad8b5d987        furikuri/hello-docker:latest   "/bin/sh -c 'node ser"   4 seconds ago        Up 1 seconds        3000/tcp            hello-docker.2.9qp4ld0rn5y102u84kqcjldrm
44864f1ef4f6        furikuri/chaos-wave            "/app/main --interval"   39 seconds ago       Up 37 seconds                           high_hugle
c51676f6731f        furikuri/hello-docker:latest   "/bin/sh -c 'node ser"   About a minute ago   Up About a minute   3000/tcp            hello-docker.1.8q22jjf5i7trubngv8wo4sh1v
e0f33516014e        furikuri/hello-docker:latest   "/bin/sh -c 'node ser"   About a minute ago   Up About a minute   3000/tcp            hello-docker.3.3yyalv0viof2x3runw9nb4yyr

Todos

  • Regex argument for container names to kill

License

MIT

chaos-wave's People

Contributors

furikuri avatar

Stargazers

Jean-Pierre Palik avatar Julien Maitrehenry avatar Alex Escalante avatar Adrian van Dongen avatar AJ Bahnken avatar Isagani Mendoza avatar Alexandre G. avatar  avatar Carlos Castillo avatar Mladen Knezic avatar Conrad Pankoff avatar Nicolas Brousse avatar

Watchers

James Cloos avatar  avatar

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.