The idea is to build a CI/CD for Python-based microservices platform that fetches weather data and generates alerts. The application should be containerized, deployed to a local Kubernetes cluster (Minikube), monitored using Prometheus and Grafana, and delivered via an automated Jenkins CI/CD pipeline.
Design, build, deploy, monitor, and automate a multi-container Python microservices platform using DevOps tools.
Provided a simple Python application to fetch the weather information from OpenWeatherMap API three Python Flask microservices: Download the app and use your github personal account to do the exercise and share the repo url as end outcome.
| Service Name | Port | Role |
|---|---|---|
gateway |
4000 | Entry point, routes API calls |
weather-service |
5000 | Fetches live weather data (OpenWeatherMap API) |
alert-service |
6000 | Generates alerts based on weather data |
- Each service should expose
/healthand/metricsendpoints. - All APIs return JSON responses.
- All services should be containerized using Docker.
- Create a
Dockerfilefor each service. - Images must be tagged properly (
gateway:latest,weather-service:latest, etc.) - Containers must run using port as defined above.
Deploy each microservice to Kubernetes (Minikube) using raw YAML manifests.
- Create a Deployment and Service for each microservice.
- Expose
gatewayviaNodePortso it’s accessible on your browser. - Make sure services can talk to each other using service DNS (e.g.,
http://alert-service:6000/alert).
Set up a Jenkins pipeline that automates the following:
- Checkout code from your local GitHub repo
- Build Docker images for all services
- Deploy services to Kubernetes using
kubectl apply - Include basic health checks using
curl
-
Integrate
prometheus_flask_exporterinto each service -
Each service must expose
/metrics -
Deploy Prometheus to Kubernetes to scrape metrics
-
Deploy Grafana and create dashboards to visualize:
- API response time
- Alert count
- Error rate
- CPU/memory usage (node-exporter)
Provision your laptop with the necessary tools using:
-
Ansible to install:
- Docker
- Minikube
- Kubectl
- Jenkins