• Stars
    star
    153
  • Rank 243,368 (Top 5 %)
  • Language
    Python
  • License
    BSD 3-Clause "New...
  • Created over 4 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

🐡 Literally a Chaos Monkey for your Kubernetes clusters

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

More Repositories

1

k8s-folding-at-home

β›‘ Run folding@home on your Kubernetes cluster
Dockerfile
104
star
2

Forza-data-tools

🏎 Tools for playing with Forza Motorsport/Horizon's "data out" feature
Go
82
star
3

GPT2-api

πŸ€– (Easily) run your own GPT-2 API. Post writing prompts, get AI-generated responses
Python
27
star
4

k8s-scripts

My collection of useful scripts for Kubernetes
Shell
21
star
5

AWS-budget-to-slack

AWS Lambda function for posting billing updates to your Slack channel
Python
13
star
6

ut99_macos_installer

Installs Unreal Tournament '99 on MacOS. Works with Apple Silicon
Shell
12
star
7

EvilPortal-M5Stack

😈 Evil Portal implementation for the M5Stack Core S3
C
10
star
8

lets-encrypt-confluence

Generate and install a free lets-encrypt SSL Certificate on Confluence
8
star
9

wavehider

πŸ•΅πŸΌβ€β™€οΈ Hide secret documents inside audio files
Go
7
star
10

Forza-TCS

Hardware-based traction control system for the Forza Motorsport & Forza Horizon games
C++
4
star
11

SlackTail

Stream a log file (or any other standard input) to a Slack channel in real time
Python
3
star
12

hugo-aws-lambda

Deploy a hugo site automatically with this AWS Lambda function
Python
3
star
13

Apple-Notes-to-Dropbox-Paper

πŸ““ Copy your Apple Notes to Dropbox Paper
Python
2
star
14

mbot-Ranger

My line follower for the mbot-Ranger platform
C++
1
star
15

cosmic_shuffle

Randomize your Spotify playlists
HTML
1
star
16

bluehose

Terminal interface for the Bluesky firehose πŸ‘©πŸ½β€πŸš’
TypeScript
1
star
17

dupehunter

Python script to find (and optionally, delete) duplicate files
Python
1
star
18

spotify-randomizer

For when you want to randomize your saved songs into a new playlist
Python
1
star
19

Genesis-Glitcher

πŸ¦” Toy that generates interesting, random glitch art by automatically corrupting Sega Genesis/Megadrive games.
HTML
1
star