Skip to content

muhammadhammad2005/rock-paper-scissors-k8s

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rock-Paper-Scissors Web Game | Flask + Docker + Kubernetes + CI/CD

A simple but complete Rock–Paper–Scissors web game built with Flask, containerized using Docker, and deployed on Kubernetes (AWS EKS) using a fully automated GitHub Actions CI/CD pipeline.

The backend is a Flask web app handling the game logic in-memory (no database required). This project focuses on cloud deployment, containerization, and CI/CD automation.

This project demonstrates a real-world DevOps workflow: from code → container → registry → cloud → Kubernetes.


🚀 Tech Stack

  • Backend: Python (Flask)
  • Frontend: HTML, CSS, JavaScript
  • Container: Docker
  • Orchestration: Kubernetes
  • Cloud: AWS EKS
  • CI/CD: GitHub Actions
  • Registry: Docker Hub

🏗 Architecture Flow

Developer (Git Push)

GitHub Actions (CI/CD)

Build Docker Image

Push to Docker Hub

Deploy to AWS EKS

Kubernetes Service exposes the App

User accesses via Browser

architecture-flow-horizontal

🧪 Run Locally (Without Docker)

cd app
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
python app.py
http://localhost:5000

🐳 Run with Docker

docker build -t rps .
docker run -p 5000:5000 rps

Open:

http://localhost:5000

☸ Deploy to Kubernetes (Manual)

You need a working cluster (Minikube, Kind, or AWS EKS):

kubectl apply -f k8s/deployment.yaml
kubectl apply -f k8s/service.yaml

Check:

kubectl get pods
kubectl get svc

🤖 CI/CD with GitHub Actions (Production Setup)

This repo includes a fully automated pipeline:

Pipeline Steps

  1. Push code to main
  2. GitHub Actions builds Docker image
  3. Image is pushed to Docker Hub
  4. Pipeline connects to AWS EKS
  5. Kubernetes manifests are applied
  6. App is updated automatically

🔐 Required GitHub Secrets

You must configure these secrets:

Secret Name
DOCKERHUB_USERNAME
DOCKERHUB_TOKEN
AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
AWS_REGION
KUBE_CONFIG

How to get KUBE_CONFIG

aws eks update-kubeconfig --region us-east-1 --name <cluster-name>
cat ~/.kube/config | base64 -w 0

Paste output into:

KUBE_CONFIG

🎮 Demo

rps-game-screenshot

🌍 Where This App Works

Environment Works
Local Flask Yes
Docker Yes
Minikube / Kind Yes
AWS EKS Yes
CI/CD Deployment Yes

💼 Why This Project is Portfolio-Strong

This project shows:

  1. Real containerization
  2. Real Kubernetes deployment
  3. Real CI/CD automation
  4. Real cloud infrastructure
  5. No fake demos, no simulations

This is the same workflow used in real DevOps teams, demonstrating production-grade practices.

📌 Future Improvements

  • Add Ingress + custom domain (Kubernetes Networking)
  • Add HTTPS (TLS/Cert-Manager)
  • Add monitoring (Prometheus + Grafana)
  • Add Helm chart (Deployment Automation)
  • Horizontal Pod Autoscaling (K8s Scaling)

👤 Author

Muhammad Hammad

DevOps & Cloud Engineer | AWS • Docker • Kubernetes • Terraform • CI/CD

📜 License

MIT License

About

Rock-Paper-Scissors web game demonstrating full DevOps workflow: Flask app → Docker → Kubernetes (AWS EKS) → GitHub Actions CI/CD

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors