Skip to content

Play the classic roguelike game Brogue in your Kubernetes cluster with Pepr acting as the dungeon master to validate and mutate your game/Kubernetes objects.

Notifications You must be signed in to change notification settings

schaeferka/pepr-dungeon-crawl

Repository files navigation

Pepr Dungeon Crawl

Play the classic roguelike dungeon crawler BrogueCE in your Kubernetes cluster with Pepr acting as the dungeon master to validate and mutate your game/Kubernetes objects



Demo Video - Part 1

pepr-demo-part-1.mov

Demo Video - Part 2 (showing deletion of monster by deleting deployment through K9s

pepr-demo-part-2.mov

Pepr Monitor view from npx pepr monitor near start of game


Pepr Monitor view from npx pepr monitor near end of game


Introduction

Lately I've been spending a lot of time working with Pepr and Kubernetes. Along the way, I ran into KubeDoom which inspired me to find a fun way to explore how Pepr interacts with a cluster using validating and mutating webhooks. The result of this exploration was Pepr Dungeon Crawl.

Table of Contents

Overview

Pepr Dungeon Crawl is made up of two main components: the BrogueCE game and the Pepr Dungeon Master.

The BrogueCE - Pepr Edition game is a deployment that runs a modified version of the classic roguelike dungeon crawler BrogueCE.

The Pepr Dungeon Master is a Pepr module that uses validating and mutating webhooks to interact with the Brogue game deployment. Pepr is a tool that allows you to easily build and deploy Kubernetes validating and mutating webhooks using a TypeScript file with easy to understand plain-English syntax.

Features

  • Run a modified version of the classic roguelike dungeon crawler Brogue in your Kubernetes cluster
  • Monsters in the game are represented by Kubernetes deployments
  • Killing monsters in the game will delete the corresponding deployment in the cluster
  • Deleting deployments in the cluster will kill the corresponding monster in the game
  • Pepr Dungeon Master module uses validating and mutating webhooks to interact with the Brogue game deployment
  • Pepr Dungeon Master module will prevent unwanted monsters from being deployed in the cluster, and will delete the in-game monster when the deployment is rejected. The included configuration will prevent the deployment of "rat", "pink-jelly", and "pit-bloat" monsters and will delete them from the game.
  • The number of pods for each monster deployment will be mutated to equal to the dungeon level on which it was created. For example, a "kobold" monster deployment created on dungeon level 3 will have 3 pods.

TODO

  • Represent the player character as a Kubernetes deployment
  • Represent player inventory as Kubernetes objects
  • Add a "secret" level that will create monsters to represent other objects in the cluster
  • Add additional options for adjusting the number of pods for each monster deployment.
  • Update brogue-pepr-edition/src/client/deploymentAction.js to use kubernetes-fluent-client.

Installation

Prerequisites

  • A Kubernetes cluster. If you don't have a cluster, you can create one using k3d with the following command:

    k3d cluster create
  • kubectl installed and configured to use your cluster. If you don't have kubectl installed, you can install it using Homebrew with the following command:

    brew install kubectl

Installation Steps

  1. Clone this repository:
git clone https://github.com/schaeferka/pepr-dungeon-crawl.git
  1. Change to the pepr-dungeon-crawl directory:
cd pepr-dungeon-crawl
  1. Change to the pepr-dungeon-master/pepr directory and install the dependencies:
cd pepr-dungeon-master/pepr
npm install
  1. Deploy the Pepr Dungeon Master module to your cluster:
npx pepr build
  1. Return to the root of the pepr-dungeon-crawl directory:
cd ../..
  1. Use the deploy script to apply the manifests to your cluster:
./deploy.sh
  1. Wait for the BrogueCE - Pepr Edition game and the Pepr Dungeon Master module to be deployed to your cluster. When the deployments are ready, you should see Forwarding from [::1]:5900 -> 5900 in the terminal.

Play Pepr Dungeon Crawl

After deploying both the BrogueCE - Pepr Edition game and the Pepr Dungeon Master module as described above, you're ready to play Pepr Dungeon Crawl.

To start the game, start a VNC viewer and connect to localhost:5900. If using the provided image, the password is pepr.

Once connected, open a terminal and run the following command to start the game:

./brogue

Tips

  • Having trouble staying alive in the game? Use the --wizard flag when starting the game from a terminal to enable wizard mode (makes you invincible and gives you starting items that make the game easier to play):

    ./brogue --wizard
  • Can't stand certain types of monsters? Adjust the Pepr Dungeon Master module to prevent them from being deployed in the cluster and delete them from the game. The initial configuration of the Pepr Dungeon Master module is in the pepr-dungeon-master directory of this repository.

  • See a monster in the game that you really don't want to fight? Delete the corresponding deployment in the cluster to kill the monster in the game. For example, to delete the "kobold-8" monster deployment, run the following command:

    kubectl delete deployment kobold-8 -n pepr-dungeon-crawl

About

Play the classic roguelike game Brogue in your Kubernetes cluster with Pepr acting as the dungeon master to validate and mutate your game/Kubernetes objects.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published