Giter VIP home page Giter VIP logo

pacman-tanzu's Introduction

Running Pac-Man on Kubernetes

test comment

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 pacman

helm 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 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.

https://github.com/font/k8s-example-apps/tree/master/pacman-nodejs-app

Security changes to the deployment such as setting up mongodb auth were thanks to Dav1x you can find his Pac-Man deployment for OpenShift here.

pacman-tanzu's People

Contributors

saintdle avatar andre-dreyer avatar michaelcade avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.