Chaos Snake lets you play snake while wrecking havock in your Kubernetes cluster. Have fun while you can.
Each piece of food you eat corresponds to a pod in your cluster (I left out kube-system though..).
To install Chaos Snake using Homebrew, you can run the following commands:
brew tap deggja/chaossnake https://github.com/deggja/chaossnake
brew install chaossnakeTo build Chaos Snake from the source, you need a working Go environment with version 1.21 or higher. Follow these steps:
git clone https://github.com/deggja/chaossnake.git --depth 1
cd chaossnake
go build -o chaossnakeTo start the game, simply run the compiled binary:
./chaossnakeThis will run the game in default mode. The snake will only eat resources of type pod and avoid system critical workloads in kube-system.
To specify a configuration file, use the --config/-c flag.
./chaossnake --config config.jsonThis will run the game in config mode. The snake will eat all resource types in all namespaces defined in the configuration file.
{
"resource_types": ["pods", "replicasets", "deployments", "services"],
"namespaces": {
"include": ["grafana", "default", "netfetch", "podinfo", "workloads"],
"exclude": ["kube-system"]
}Use the arrow keys to navigate the snake around the screen:
| Key | Action |
|---|---|
| Arrow up | Move up |
| Arrow down | Move down |
| Arrow left | Move left |
| Arrow right | Move right |
| Space | Pause or Resume |
| CTRL + C | Quit the game |
Chaos Snake will needs access to a Kubernetes cluster. Ensure your kubeconfig is set up correctly before starting the game. The application currently expects the default kubeconfig or a kubeconfig environment variable.
As you play and the pods are deleted, Chaos Snake will log its actions to a chaos.log file for your review.
Feel free to dive in! Open an issue or submit PRs.
This project utilizes Termloop, a simple Go library for creating terminal-based games. Thanks to the creators and contributors of Termloop for providing such a versatile tool.
Chaos Snake is inspired by Chaos Monkey from Netflix as well as Kubeinvaders - so thank you to these awesome projects.
Chaos Snake is released under the MIT License. Check out the LICENSE file for more information.