This project demonstrates a Python microservices application (Frontend and Backend) deployed on Kubernetes with a complete observability stack including Prometheus, Grafana, and Loki.
To run this project, you need the following tools installed:
- Minikube (Recommended for local development) or Docker Desktop (with Kubernetes enabled).
- Ensure your cluster is running:
minikube startor your equivalent.
- kubectl: The Kubernetes command-line tool.
- Docker: For building microservice images.
- Python 3.9+: For local testing of microservices.
- Used for version control and cloning the repository.
Navigate to the microservices directory and build the Docker images. If using Minikube, point your shell to the Minikube Docker daemon:
# If using Minikube:
eval $(minikube docker-env)
# Build Frontend
docker build -t frontend:v1 ./python-k8s-app/microservices/frontend
# Build Backend
docker build -t backend:v1 ./python-k8s-app/microservices/backendApply the Kubernetes manifests in the k8s directory:
kubectl apply -f python-k8s-app/k8s/Verify all pods are running:
kubectl get pods- Frontend: Access via NodePort
30002(if using Minikube:minikube service frontend-service --url). - Grafana: Access via NodePort
30003(if using Minikube:minikube service grafana-service --url).
python-k8s-app/microservices/: Source code and Dockerfiles for Frontend and Backend.python-k8s-app/k8s/: Kubernetes manifests for the application and observability stack (Loki, Prometheus, Grafana, Promtail)..gemini/: Context and configuration for the Gemini CLI agent.