This is a project for creating an end-to-end resume web application using Django and PostgreSQL. The application is designed to serve as an online resume, providing details about the individual and their work experiences. The project is containerized using Docker Compose, deployed on Kubernetes, and has integrated Prometheus and Grafana for observability.
- Backend: Django (Python)
- Database: PostgreSQL
- Frontend: HTML, CSS, JS
- Containerization: Docker
- Orchestration: Kubernetes
- Monitoring: Prometheus, Grafana
- CI/CD: ArgoCD
├── Dockerfile # Dockerfile for the Django app
├── blog # Django app handling the blog functionality
│ ├── __init__.py
│ ├── admin.py
│ ├── apps.py
│ ├── models.py
│ ├── views.py
│ ├── templates/
│ ├── static/
│ ├── migrations/
│ └── ...
├── custom_kube_prometheus_stack.yml # Prometheus configuration for Kubernetes
├── deploy # Kubernetes deployment configurations
│ ├── django-deployment.yaml
│ ├── django-service.yaml
│ ├── ingress.yaml
│ ├── postgres-deployment.yaml
│ ├── postgres-service.yaml
├── docker-compose.yml # Docker Compose configuration for local setup
├── environ.env # Environment variables
├── kube_apply.sh # Shell script to apply Kubernetes configurations
├── metallb-config.yaml # MetalLB configuration for LoadBalancer in Minikube
├── metallb.yaml # MetalLB installation YAML
├── manage.py # Django management script
├── requirements.txt # Python dependencies
└── ...
git clone https://github.com/Pshar10/Three-Tier-Web-Application.git
cd Three-Tier-Web-Application
To run the application locally using Docker Compose:
docker-compose up --build
-
Build the Docker image:
docker build -t yourusername/django-app .
-
Push the image to Docker Hub:
docker push yourusername/django-app
-
Set up Minikube for Kubernetes:
minikube start
-
Apply the Kubernetes configurations:
kubectl apply -f deploy/
-
Expose the services using
kubectl
:kubectl expose service django-service --type=NodePort --name=django-service
-
Install and access Prometheus for monitoring:
helm install prometheus prometheus-community/prometheus minikube service prometheus-server-ext
-
Install and access Grafana for visualization:
helm install grafana grafana/grafana kubectl expose service grafana --type=NodePort --target-port=3000 --name=grafana-ext minikube service grafana-ext
- Prometheus is used for scraping metrics and monitoring the Kubernetes cluster.
- Grafana is used for visualizing metrics collected by Prometheus.
- Access Prometheus at (example):
http://192.168.49.2:31343
orhttp://127.0.0.1:52997
.
- Access Grafana at (example):
http://192.168.49.2:31379
orhttp://127.0.0.1:53149
.
This application is deployed using Kubernetes for orchestration, providing scalability and fault tolerance. The deployment is automated through ArgoCD, enabling continuous delivery and seamless updates to the environment. Docker is used for containerization, allowing for consistent and efficient application packaging across different environments. The CI/CD pipeline integrates with GitHub Actions for automated builds and deployments. For observability, Prometheus is employed to collect metrics, while Grafana is used for visualizing those metrics and monitoring the health of the system. This architecture ensures an end-to-end automated workflow, from development to deployment, with real-time monitoring for continuous improvement.
Make sure to configure the necessary environment variables before running the app. You can find the required environment settings in the environ.env
file.
Feel free to fork this repository, make changes, and create pull requests. Any suggestions or improvements are welcome!
This project is licensed under the MIT License - see the LICENSE file for details.