A production-ready Learning Management System (LMS) deployed on Kubernetes with comprehensive orchestration features including self-healing, auto-scaling, zero-downtime deployments, and load balancing.
- π User Management: Role-based access control (Admin, Educator, Learner)
- π Course Management: Create, update, archive courses with rich content
- π Progress Tracking: Automated learner progress monitoring
- ποΈ Certificate Generation: Automatic digital certificates on completion
- π± QR Code Integration: Quick course access via mobile devices
- π¬ Social Learning: Comments and interactions on courses
- π Zero-Downtime Deployments: Rolling updates with Kubernetes
- β‘ Auto-Scaling: Dynamic scaling based on load
- π‘οΈ Self-Healing: Automatic pod recovery and health checks
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Load Balancer β
β (NodePort: 30080) β
ββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββ
β
ββββββββββββββββββΌβββββββββββββββββ
β β β
ββββββΌββββββ ββββββΌββββββ ββββββΌββββββ
β Nginx β β Django β β Django β
β Proxy β β Web-1 β β Web-2 β
ββββββββββββ βββββββ¬βββββ βββββββ¬βββββ
β β
ββββββΌβββββββββββββββββΌβββββ
β MySQL 8.0 β
β (Persistent Volume) β
ββββββββββββββββββββββββββββ
| Component | Technology | Version |
|---|---|---|
| Framework | Django | 5.1.7 |
| Database | MySQL | 8.0 |
| Web Server | Nginx | 1.29.3 |
| Container Runtime | containerd | 2.1.4 |
| Orchestration | K3s | v1.33.5 |
| OS | Ubuntu | 22.04 LTS |
- 3 Linux VMs (1 master + 2 workers)
- Master: 2 vCPU, 4GB RAM
- Workers: 2 vCPU, 2GB RAM each
- Ubuntu 22.04 LTS or later
- Static IP addresses for external access
- SSH access to all nodes
- Docker (for image building)
git clone https://github.com/abhishektang/elevate-learning-k8s.git
cd elevate-learning-k8sOn Master Node:
cd All_mds
chmod +x install-k3s-master.sh
sudo ./install-k3s-master.shOn Each Worker Node:
# Copy token from master: sudo cat /var/lib/rancher/k3s/server/node-token
chmod +x install-k3s-worker.sh
# Edit script with your master IP and token
sudo ./install-k3s-worker.sh# Build Docker image
cd elevatelearning
docker build -t elevatelearning-web:latest .
# Import to K3s
sudo k3s ctr images import elevatelearning-web.tar
# Deploy to Kubernetes
cd k8s
kubectl apply -f namespace.yaml
kubectl apply -f configmap.yaml
kubectl apply -f mysql-deployment.yaml
kubectl apply -f django-deployment.yaml
kubectl apply -f nginx-deployment.yamlhttp://<MASTER_IP>:30080/elevatelearning/home/
Default Admin Credentials:
- Username:
admin - Password:
admin123
Run comprehensive tests to verify Kubernetes orchestration features:
chmod +x run-orchestration-tests.sh
./run-orchestration-tests.shTests Included:
- β Self-Healing: Automatic pod recovery
- β Load Balancing: Traffic distribution across pods
- β Auto-Scaling: Dynamic replica management (3β5β3)
- β Rolling Updates: Zero-downtime deployments
- β Rollback: Instant recovery to previous versions
Expected output: 5/5 tests passed β¨
elevate-learning-k8s/
βββ elevatelearning/ # Django application
β βββ elevatelearning/ # Project settings
β βββ elevatelearningapp/ # Main app (views, models, URLs)
β βββ templates/ # HTML templates
β βββ k8s/ # Kubernetes manifests
β β βββ namespace.yaml
β β βββ configmap.yaml
β β βββ mysql-deployment.yaml
β β βββ django-deployment.yaml
β β βββ nginx-deployment.yaml
β βββ Dockerfile # Container image definition
β βββ requirements.txt # Python dependencies
β βββ entrypoint.sh # Container startup script
β βββ nginx.conf # Nginx reverse proxy config
βββ All_mds/ # Documentation & scripts
β βββ install-k3s-master.sh # Master node setup
β βββ install-k3s-worker.sh # Worker node setup
β βββ deploy-to-k8s.sh # Deployment automation
β βββ K3S_SETUP_GUIDE.md # Cluster setup guide
β βββ DEPLOYMENT.md # Deployment instructions
β βββ ARCHITECTURE.md # Architecture documentation
β βββ PROJECT_PROPOSAL.md # Project overview
βββ run-orchestration-tests.sh # Automated test suite
βββ ORCHESTRATION_TEST_SCRIPT_README.md
βββ QUICK_START_TESTS.md
βββ .gitignore # Git ignore rules
βββ README.md # This file
Key configurations in k8s/configmap.yaml:
CSRF_TRUSTED_ORIGINS: "http://<YOUR_IP>:30080"
ALLOWED_HOSTS: "*"
DB_HOST: "mysql-service"
DB_NAME: "elevatelearning_db"
DB_USER: "djangouser"
DEBUG: "False"| Resource | Replicas | CPU | Memory |
|---|---|---|---|
| Django | 3 | 250m-500m | 512Mi-1Gi |
| MySQL | 1 | - | 2Gi |
| Nginx | 1 | - | 256Mi |
- β CSRF Protection: Token-based form validation
- β Secret Management: Kubernetes secrets for sensitive data
- β Role-Based Access: Admin, Educator, Learner roles
- β Network Policies: Pod-to-pod communication restrictions
- β Security Headers: X-Frame-Options, CSP, HSTS
- SSH private keys
- Database passwords
- Django SECRET_KEY
.envfiles
All sensitive files are excluded via .gitignore.
Health Check Endpoints:
- Liveness Probe:
/elevatelearning/home/ - Readiness Probe:
/elevatelearning/home/
Check Cluster Status:
kubectl get nodes -o wide
kubectl get pods -n elevatelearning -o wide
kubectl get services -n elevatelearningThis project is cloud-agnostic and can be deployed on:
- β GCP - Compute Engine VMs
- β AWS - EC2 instances with EKS or K3s
- β Azure - Azure VMs with AKS or K3s
- β On-Premises - Any Linux infrastructure
See documentation for migration guides.
- π K3s Setup Guide - Complete cluster setup
- π Deployment Instructions - Step-by-step deployment
- ποΈ Architecture Overview - System design
- β Requirements Verification - Feature checklist
- π Orchestration Tests - Testing documentation
This is an academic project, but suggestions are welcome!
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
For issues or questions:
- Check the documentation
- Review troubleshooting guides
- Open an issue on GitHub
β Star this repo if you find it helpful! β
Built with β€οΈ using Django, Kubernetes, and Cloud Native technologies.