MCPcopy Index your code
hub / github.com/deggja/chaossnake

github.com/deggja/chaossnake @3.1.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release 3.1.0 ↗ · + Follow
71 symbols 138 edges 3 files 1 documented · 1% updated 4mo agov0.3.0 · 2025-01-17★ 178
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

go version

Serpent

Control snake. Eat food. Create chaos.

Contents

⭐ What is Serpent? ⭐

Serpent lets you play snake while wrecking havock in your Kubernetes cluster. Have fun while you can.

How does it work? 🤔

Each piece of food you eat corresponds to a pod in your cluster (I left out kube-system though..).

Installation

Homebrew 🍺

To install Serpent using Homebrew, you can run the following commands:

brew tap deggja/serpent https://github.com/deggja/serpent
brew install serpent

Build from source 💻

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

Usage

Starting the game

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.

Example Configuration File

{
    "resource_types": ["pods", "replicasets", "deployments", "services"],
    "namespaces": {
        "include": ["grafana", "default", "netfetch", "podinfo", "workloads"],
        "exclude": ["kube-system"]
    }

Playing Serpent

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

asciicast

Kubernetes interaction

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.

Contribute 🔨

Feel free to dive in! Open an issue or submit PRs.

Acknowledgments

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.

License

Serpent is released under the MIT License. Check out the LICENSE file for more information.

Extension points exported contracts — how you extend this code

KubernetesResource (Interface)
(no doc) [11 implementers]
kubernetes.go

Core symbols most depended-on inside this repo

Delete
called by 14
kubernetes.go
List
called by 13
kubernetes.go
contains
called by 2
kubernetes.go
fetchResources
called by 1
kubernetes.go
setDefaultConfig
called by 1
kubernetes.go
loadConfigFromFile
called by 1
kubernetes.go
getAllNamespaces
called by 1
kubernetes.go
getResourceHandler
called by 1
kubernetes.go

Shape

Method 33
Struct 19
Function 17
Class 1
Interface 1

Languages

Go97%
Ruby3%

Modules by API surface

kubernetes.go50 symbols
serpent.go19 symbols
serpent.rb2 symbols

For agents

$ claude mcp add chaossnake \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page