A simple MVP Django web application for military unit management, focused on basic functionality for Kubernetes deployment practice. This project serves as a learning tool for DevOps engineers practicing Kubernetes deployment, scaling, and management.
This project is intended solely for testing and learning purposes. It may contain security vulnerabilities and may not conform to security best practices. Do not use this application in production environments.
- User Authentication: Login/logout functionality using Django's built-in authentication system
- Soldier Management: Add, edit, delete, and view soldiers with basic information
- Equipment Tracking: Add, edit, delete, and view equipment with assignment to soldiers
- Dashboard: View counts, recent additions, and equipment status distribution
- Admin Panel: Django admin interface for data management
- Kubernetes Ready: Includes Dockerfile, docker-compose.yml, and Kubernetes manifests
- Backend: Python/Django 4.2+
- Database: PostgreSQL
- Frontend: Django Templates with Bootstrap CSS
- Authentication: Django's built-in authentication
- Containerization: Docker
- Orchestration: Kubernetes
- Python 3.11+
- pip
- PostgreSQL (optional, SQLite is used by default for development)
- Docker and Docker Compose (optional)
-
Clone the repository:
git clone https://github.com/cloudenochcsis/Military_Unit_Dashboard.git cd Military_Unit_Dashboard -
Create a virtual environment and activate it:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Create a
.envfile in the project root with the following variables (optional for development):DEBUG=1 SECRET_KEY=your_secret_key DATABASE_URL=postgres://user:password@localhost:5432/military_dashboard ALLOWED_HOSTS=localhost,127.0.0.1 -
Run migrations:
python manage.py migrate python manage.py makemigrations dashboard python manage.py migrate dashboard
-
Create a superuser:
python manage.py createsuperuser
-
Load sample data (optional):
python manage.py seed_data
-
Run the development server:
python manage.py runserver
-
Access the application at http://127.0.0.1:8000
-
Login with the superuser credentials you created in step 6
-
Create a
.envfile with the following required environment variables:cp .env.example .env # Edit .env to customize settings if needed -
Build and run the application using Docker Compose:
docker-compose up --build
-
Access the application at http://localhost:8000
-
Create a superuser:
docker-compose exec web python manage.py createsuperuser -
Load sample data (optional):
docker-compose exec web python manage.py seed_data
- Kubernetes cluster
- kubectl configured to connect to your cluster
-
Build and push the Docker image to a registry:
docker build -t your-registry/military-dashboard:latest . docker push your-registry/military-dashboard:latest -
Update the image name in
kubernetes/deployment.yamlto match your registry. -
Apply the Kubernetes manifests:
kubectl apply -f kubernetes/configmap.yaml kubectl apply -f kubernetes/deployment.yaml kubectl apply -f kubernetes/service.yaml
-
Access the application through the Ingress hostname (you may need to add the hostname to your /etc/hosts file):
military-dashboard.local
The application provides a health check endpoint at /health/ that returns a JSON response with status "ok". This endpoint is used by Kubernetes for liveness and readiness probes.
- Change the
SECRET_KEYto a secure value in production - Set
DEBUG=0in production - Update
ALLOWED_HOSTSwith your production domain - Consider using a managed PostgreSQL service
- Set up proper TLS/SSL for secure connections
- Implement proper backup strategies for the database
- Configure appropriate resource limits in Kubernetes manifests
- v1.0.0 - Initial MVP release with core features (Soldier and Equipment management, Dashboard, Docker and Kubernetes support)
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some 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.




