Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/richstokes/cheekymonkey
🐵 Literally a Chaos Monkey for your Kubernetes clusters
https://github.com/richstokes/cheekymonkey
chaos-engineering chaos-monkey kubernetes kubernetes-service python python-arcade
Last synced: 11 days ago
JSON representation
🐵 Literally a Chaos Monkey for your Kubernetes clusters
- Host: GitHub
- URL: https://github.com/richstokes/cheekymonkey
- Owner: richstokes
- License: bsd-3-clause
- Created: 2020-04-09T20:06:13.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-11-10T03:05:54.000Z (12 months ago)
- Last Synced: 2024-08-01T06:21:29.068Z (3 months ago)
- Topics: chaos-engineering, chaos-monkey, kubernetes, kubernetes-service, python, python-arcade
- Language: Python
- Homepage:
- Size: 7.21 MB
- Stars: 154
- Watchers: 5
- Forks: 23
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-repositories - richstokes/cheekymonkey - 🐵 Literally a Chaos Monkey for your Kubernetes clusters (Python)
README
## Cheeky Monkey
Inspired by Netflix's "[Chaos Monkey](https://github.com/Netflix/chaosmonkey)", 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 ` 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
- [Python Arcade Library](https://arcade.academy/index.html)
- [Monkey character sprites](https://www.gameartguppy.com/shop/monkey-game-character-sprites/ )
- [CREDITS.md](https://github.com/richstokes/cheekymonkey/blob/master/CREDITS.md)