A containerized Python API simulating restaurant operations, fully monitored with Prometheus, Alertmanager, and Grafana, running on Minikube.
- Overview
- Architecture
- Project Structure
- Prerequisites
- Step-by-Step Deployment
- Access the Services
- Contributing
- License
This project simulates a restaurant service API with real-time monitoring.
The full stack is orchestrated on Kubernetes using Minikube for local testing and learning.
Features:
- Python Flask app simulating restaurant orders
- Prometheus + Alertmanager for metrics & alerts
- Grafana dashboards
- Ready-to-run on Minikube
- Optional Docker run for API-only testing
[ Flask App ] --> [ Kubernetes Service ]
| Metrics exposed on /metrics
v
[ Prometheus ] <-> [ Alertmanager ]
|
v
[ Grafana Dashboards ]
restaurant-simulation-API/
├── app/
│ ├── restaurante_app.py
│ └── requirements.txt
├── prometheus/
│ ├── prometheus-config.yaml
│ ├── prometheus-rules.yaml
│ ├── prometheus-deployment.yaml
│ └── prometheus-service.yaml
├── grafana/
│ ├── grafana-datasource.yaml
│ ├── grafana-deployment.yaml
│ └── grafana-service.yaml
├── alertmanager/
│ ├── alertmanager-config.yaml
│ ├── alertmanager-deployment.yaml
│ └── alertmanager-service.yaml
├── k8s/
│ ├── deployment.yaml
│ └── service.yaml
├── Dockerfile
├── README.md
└── CONTRIBUTING.md
- Minikube installed and running
- kubectl CLI
- Docker (optional, for local builds)
- Python 3.10+ (for local dev only)
-
Start Minikube
minikube start
-
Deploy the Flask App
kubectl apply -f k8s/deployment.yaml kubectl apply -f k8s/service.yaml
-
Deploy Prometheus
kubectl apply -f prometheus/
-
Deploy Alertmanager
kubectl apply -f alertmanager/
-
Deploy Grafana
kubectl apply -f grafana/
-
Verify Deployments
kubectl get pods kubectl get svc
Enable Minikube tunnel or port-forwarding:
minikube service listTypical ports:
- Flask App:
NodePortfromk8s/service.yaml - Prometheus UI:
NodePortfromprometheus-service.yaml - Alertmanager:
NodePortfromalertmanager-service.yaml - Grafana:
NodePortfromgrafana-service.yaml
Example:
minikube service grafana-servicedocker build -t restaurant-api .
docker run -p 8000:8000 restaurant-apiSee CONTRIBUTING.md for guidelines.
This project is licensed under the MIT License.