Examm | ||
web | ||
z2 | ||
Apache:default.conf.sh | ||
Apache.conf.sh | ||
app:db_init.sql | ||
app:index.php | ||
deployment.yaml | ||
docker-compose.yaml | ||
Dockerfile | ||
index.html | ||
namespace.yaml | ||
prepare-app.sh | ||
pv-pvc.yaml | ||
README.md | ||
remove-app.sh | ||
script.js | ||
service.yaml | ||
start-app.sh | ||
statefulset.yaml | ||
stop-app.sh | ||
style.css | ||
test.php |
🧠 Typing Speed & RSI Awareness Game - Kubernetes Deployment
This project showcases a web-based Typing Speed & RSI Awareness Game deployed on a Kubernetes cluster. Although the game is a simple frontend app (HTML, CSS, JavaScript), the Kubernetes setup is fully compliant with deployment best practices and assignment requirements.
🎮 Game Overview
The application is designed to:
- Improve typing speed and accuracy.
- Educate users on RSI (Repetitive Strain Injury) prevention.
- Include real-time feedback and typing stats.
- Encourage healthy typing habits with periodic stretch reminders.
How to Run
Step 1: Prepare the Application
./prepare-app.sh
- Builds the Docker image:
typing-game
- Saves it as a
.tar
for loading on cluster nodes - Prepares persistent storage
Step 2: Deploy the Application
./start-app.sh
This applies:
- Namespace
- Deployment
- Service
- StatefulSet
- PersistentVolume + PersistentVolumeClaim
Step 3: Access the App
Open in your browser:
http://<your-node-ip>:30007
Replace
<your-node-ip>
with the external IP of your Kubernetes node.
Step 4: Clean Up
./stop-app.sh
This deletes all Kubernetes resources created by this project.
Assignment Requirements
1. Namespace
Requirement: All objects must belong to a custom namespace.
You Did: Defined typing-game
in namespace.yaml
, and referenced it in all other files.
2. Deployment
Requirement: Deploy your web application.
You Did: Used deployment.yaml
to deploy your frontend game using Nginx.
3. StatefulSet + PersistentVolume + PersistentVolumeClaim
Requirement: Demonstrate persistent storage via a StatefulSet.
You Did:
- Used
statefulset.yaml
with Alpine Linux writing logs to/data/log.txt
. - Mounted
/data
using a PVC created frompv-pvc.yaml
.
4. Service
Requirement: Expose your app.
You Did: Used a NodePort
service in service.yaml
on port 30007
.
5. start-app.sh
Requirement: Script to create all objects.
You Did: Automated creation of namespace, Deployment, Service, StatefulSet, PV/PVC.
6. stop-app.sh
Requirement: Script to delete all objects.
You Did: Cleanly removes all created Kubernetes objects.
7. prepare-app.sh
Requirement: Prepares the environment.
You Did: Builds and saves Docker image, prepares persistent volume.
8. Dockerfile
Requirement: Provide necessary container files.
You Did: Dockerfile builds a custom Nginx image that serves your HTML/JS/CSS game files.