ncurses + kubernetes + snake
- The snake accepts a kubeconfig file and deploys kubernetes resources everytime the snake collects food
- This can be optionally disabled when the game starts
- The config can also be omitted entirely
- Before playing make sure your current kubectl context is a cluster that you are allowed to make changes to
- the only scenario where kube-snake will clean up after itself is if you provide a kubeconfig file and omit a bundle directory (see commands below)
- the python client doesn't have a mechanism yet for
kubectl delete -funtil this pr gets merged
- Before starting the game load kubernetes yaml files into a bundle/ directory
- yaml files in this directory will be deployed one by one as you collect food for the snake
snake-trailer.webm.mov
- pull the image:
docker pull mcmull27/snake:latest- only snake
docker run -it \
-e COLUMNS="$(tput cols)" \
-e LINES="$(tput lines)" \
mcmull27/snake
- kube mode using local kubeconfig
docker run -it \
-e COLUMNS="$(tput cols)" \
-e LINES="$(tput lines)" \
-v $HOME/.kube/config:/home/snake/.kube/config \
mcmull27/snake- using custom bundle (directory of kube manifests to deploy)
docker run -it \
-e COLUMNS="$(tput cols)" \
-e LINES="$(tput lines)" \
-v $HOME/.kube/config:/home/snake/.kube/config \
-v $(pwd)/bundle:/home/snake/bundle
mcmull27/snake-
requires:
- make
- clang
- python3-dev
- python3-pip
-
build with:
make -
run with:
./snake -
kubernetes mode requires:
pip3 install kubernetes -
test:
make test && ./test
- test make/build in a base ubuntu 20 image:
docker run -it -v $(pwd):/home/snake ubuntu:focal- build from source:
docker build . -t snake