Serpent 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 Serpent using Homebrew, you can run the following commands:
brew tap deggja/serpent https://github.com/deggja/serpent
brew install serpent
To build Serpent from the source, you need a working Go environment with version 1.21 or higher. Follow these steps:
git clone https://github.com/deggja/serpent.git --depth 1
cd serpent
go build -o serpent
To start the game, simply run the compiled binary:
./serpent
This 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.
./serpent --config config.json
This 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 |
Serpent 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, Serpent 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.
Serpent is released under the MIT License. Check out the LICENSE file for more information.