This project collects weather data (temperature and humidity) from an ESP8266 IoT device and visualizes it using ThingsBoard. The system is robust due to the use of persistent volumes (PVs) that ensure data durability even in case of failures.
- Robust Data Storage: Uses persistent volumes (PVs) for reliable data storage.
- Real-time Data Processing: Event-driven data flow through Minio, RabbitMQ, Node-RED, and ThingsBoard.
- Cloud-Native Architecture: Leveraging Kubernetes (microk8s) for scalable and manageable deployment.
- Kubernetes (microk8s) for container orchestration and management.
- kubectl for interacting with the Kubernetes cluster.
- Minio for object storage and event triggering.
- RabbitMQ for handling messaging between services.
- Node-RED for workflow automation and data processing.
- ThingsBoard for visualizing IoT data.
- Grafana for monitoring system health through Prometheus metrics.
- Keycloak for securing and managing user access.
- MicroK8s: A lightweight Kubernetes distribution, required for deploying the system.
- kubectl: Command-line tool for interacting with the Kubernetes cluster.
sudo snap install microk8s --classicEnable required add-ons like Prometheus, Grafana, etc.:
microk8s enable dns storage prometheus grafanagit clone https://github.com/Niroth36/CloudPlatformESP.git
cd CloudPlatformESPThe start-yamls.sh script will deploy all necessary services (Minio, RabbitMQ, Node-RED, ThingsBoard, Grafana, etc.) to your Kubernetes cluster:
./start-yamls.shThis script will:
- Set up all Kubernetes resources (Deployments, Services, Persistent Volumes).
- Deploy and configure all services needed to process and visualize the data.
- Create a bucket in Minio for storing IoT sensor data.
- Configure access keys (access and secret key) so the ESP8266 can send data to Minio.
- Create an exchange to handle the events from Minio.
- Create a queue to capture the events triggered by Minio.
- Create a flow in Node-RED to integrate the Minio and RabbitMQ services:
- Capture events from RabbitMQ.
- Retrieve data from Minio.
- Process the data and send it to ThingsBoard.
- Set up ThingsBoard to receive data from Node-RED via HTTP POST and visualize it in dashboards.
kubectl apply -f grafana-deployment.yml
kubectl delete pod -n cloud-platform -l app=grafanakubectl apply -f grafana-service.yml- Open Keycloak:
- URL: http://192.168.1.95:30008
- Login as Admin:
- Username: admin
- Password: adminpassword
- Create a New Realm:
- Click the dropdown menu (top-left).
- Click Create Realm.
- Realm Name: cloud-platform
- Click Create.
- Go to Clients → Click Create Client.
- Client ID: grafana-client
- Client Type: OpenID Connect.
- Click Next.
- Enable OAuth2 Client Authentication:
- Client Authentication: ON (Grafana needs a client secret).
- Standard Flow: ✅ Enabled (Required for login via OAuth2).
- Direct Access Grants: ❌ Disabled.
- Click Save.
- Open the grafana-client settings.
- Root URL:
http://192.168.1.95:30000 - Valid Redirect URIs:
http://192.168.1.95:30000/login/generic_oauth - Web Origins:
http://192.168.1.95:30000
- Root URL:
- Click Save.
- Go to the Credentials tab.
- Copy the Client Secret.
kubectl apply -f grafana-deployment.yml
kubectl delete pod -n cloud-platform -l app=grafanaGrafana is accessible at: http://192.168.1.95:30000
python upload_to_minio.py- Access Minio's web interface:
http://<minio-ip>:9000.
- Access RabbitMQ:
http://<rabbitmq-ip>:15672.
- Access Node-RED:
http://<nodered-ip>:1880.
- Access ThingsBoard:
http://<thingsboard-ip>:8080.
kubectl port-forward -n cloud-platform svc/grafana 3000:80| Service | Username | Password |
|---|---|---|
| Minio | admin | password |
| RabbitMQ | admin | password |
| Node-RED | No auth | N/A |
| ThingsBoard | tenant@thingsboard.org | tenant |
| Grafana | admin | password |
| Keycloak | admin | password |
Fork the repository, create a new branch, and submit a pull request.
This project is licensed under the MIT License.