Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/saintdle/pacman-for-k8s
Pac-Man the classic arcade game - deployment files for VMware Tanzu and other Kubernetes distributions.
https://github.com/saintdle/pacman-for-k8s
arcade-game kubernetes mongodb pac-man vmware-tanzu-kubernetes
Last synced: about 1 month ago
JSON representation
Pac-Man the classic arcade game - deployment files for VMware Tanzu and other Kubernetes distributions.
- Host: GitHub
- URL: https://github.com/saintdle/pacman-for-k8s
- Owner: saintdle
- License: apache-2.0
- Created: 2021-02-19T11:31:32.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-01-18T11:28:37.000Z (almost 3 years ago)
- Last Synced: 2024-12-10T07:13:13.046Z (about 1 month ago)
- Topics: arcade-game, kubernetes, mongodb, pac-man, vmware-tanzu-kubernetes
- Language: Shell
- Homepage:
- Size: 55.7 KB
- Stars: 30
- Watchers: 1
- Forks: 36
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Security: security/rbac.yaml
Awesome Lists containing this project
README
# Running Pac-Man on Kubernetes
Pac-Man the classic arcade game - deployment files for VMware Tanzu Kubernetes and all other Kubernetes distributions.
## Pre-Reqs
ServiceType: LoadBalancer must be available for external connectivity to the Pac-Man front-end, otherwise you'll need to make some changes to the files in the "services" folder.
## Deployment
### Using Helm to install
````
kubectl create namespace pacmanhelm repo add veducate https://saintdle.github.io/helm-charts/
helm install pacman veducate/pacman -n pacman# You can see the available values by running
helm show values veducate/pacman
````
[Read this blog post](https://veducate.co.uk/how-to-create-helm-chart/) to learn how this Helm Chart was created.### Using a Script for installation
Clone repo and run ```chmod +X pacman-install.sh``` and then run file ```./pacman-install.sh```or the following steps:
kubectl create namespace pacman
kubectl create -n pacman -f pacman-tanzu/#### Uninstall using a Script
Run file `./pacman-uninstall.sh`. This will delete all objects created by `./pacman-install.sh`Alternatively, run `./pacman-uninstall.sh keeppvc`. This will delete all objects except for the pacman namespace and the persistent volume claim. You can use this to demonstrate persistence of the MongoDB data by installing, playing a game and recording a high score, then unininstalling with the `keeppvc` argument. You can then run the installation again and the high score will persist.
## Architecture
The application is made up of the following components:
* Namespace
* Deployment
* MongoDB Pod
* DB Authentication configured
* Attached to a PVC
* Pac-Man Pod
* Nodejs web front end that connects back to the MongoDB Pod by looking for the Pod DNS address internally.
* RBAC Configuration for Pod Security and Service Account
* Secret which holds the data for the MongoDB Usernames and Passwords to be configured
* Service
* Type: LoadBalancer
* Used to balance traffic to the Pac-Man Pods## Source
These are modified files from the below github repo for the node.js version, which contain the necessary changes to run in VMware Tanzu Kubernetes Grid (TKG) such as updated api values and pod security policies (psp) with associated service accounts and RBAC.
>
Security changes to the deployment such as setting up mongodb auth were thanks to [Dav1x](https://github.com/dav1x/) you can find his [Pac-Man deployment for OpenShift here](https://github.com/dav1x/pacman-ocp).