Giter Site home page Giter Site logo

mkerker / cheekymonkey Goto Github PK

View Code? Open in Web Editor NEW

This project forked from richstokes/cheekymonkey

0.0 1.0 0.0 7.52 MB

🐵 Literally a Chaos Monkey for your Kubernetes clusters

License: BSD 3-Clause "New" or "Revised" License

Python 99.61% Shell 0.39%

cheekymonkey's Introduction

Cheeky Monkey

Inspired by Netflix's "Chaos Monkey", this game quite literally sets a monkey loose in your Kubernetes cluster.

 

 

CHAOS ENGINEERING IS: "the discipline of experimenting on a distributed system in order to build confidence in the system's capability to withstand turbulent conditions in production."

This game is more for fun and demonstration purposes than to be a genuine chaos engineering tool. That said, over time I may add other disruptive features beyond simply killing pods. Feel free to open an "issue" with any suggestions!

 

Kubernetes pods are represented by crates in the game. The more pods you have, the more crates are dropped!

You control the monkey with the arrow keys, and punch crates with spacebar. You can also hold 'G' to grab a crate to your right and drag it around.

Every time the monkey destroys a crate, a pod in your cluster is randomly selected and deleted.

Press 'R' to reset the game.

 

Install & run

  1. Clone the repo
  2. pip install -r requirements.txt
  3. python cheekymonkey.py

Or with pyenv (recommended):

pyenv install 3.8.7
eval "$(pyenv init -)"
pyenv local 3.8.7
pip install -r requirements.txt
python ./cheekymonkey.py

 

Unless offline mode is set (see below), the game will attempt to connect to your currentt Kubernetes context.

Note: The game will target pods across ALL namespaces, unless you specify namespaces to exclude, for example:
python cheekymonkey.py --exclude kube-system cert-manager

 

Command line Options

--offline yes Switches to offline mode, no pods will be harmed
--exclude <namespace1> <namespace2> Space-separated list of namespaces to exclude

 

Other settings

Change the following in constants.py:

  • Resolution - set SCREEN_WIDTH and SCREEN_HEIGHT as desired
  • CONTAINER_FACTOR - Multiplication factor for creating crates based on the actual number of containers in your cluster. The idea is you can use this to get a reasonable number of crates in game if you have a lot of running pods in your cluster.
  • CONTAINER_HEALTH - How many times the monkey needs to hit the crate before its corresponding pod is killed
  • OFFLINE_CRATE_COUNT - How many crates to spawn in offline mode (Multiplied by CONTAINER_FACTOR)

You can have fun with the physics by using the plus/minus keys to change the punching force.

 

Credits

cheekymonkey's People

Contributors

richstokes avatar yhaenggi avatar

Watchers

James Cloos 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.