A small end-to-end IoT data pipeline demonstrating containerized microservices on Kubernetes with FastAPI ingestion, MongoDB storage, and a background telemetry processor.
This project demonstrates a containerized IoT data pipeline deployed on Kubernetes, including a FastAPI ingestion service, MongoDB storage, a background telemetry processor, and a Python-based device simulator.
- Python (FastAPI, PyMongo)
- MongoDB
- Docker
- Kubernetes (kind)
- Terraform (cloud IaC example)
flowchart LR
subgraph Local_Environment
SIM[IoT Device Simulator]
end
subgraph Kubernetes_Cluster
API[FastAPI Ingestion API]
PROC[Telemetry Processor Service]
DB[(MongoDB Database)]
end
SIM -->|HTTP Telemetry| API
API -->|Store Raw Telemetry| DB
PROC -->|Read Raw Telemetry| DB
PROC -->|Write Processed Telemetry| DB
project-6-iot-k8s-platform/
README.md
terraform/
k8s/
services/
api/
processor/
simulator/
kind create cluster --name iot-localkubectl apply -f k8s/namespace.yamlkubectl apply -f k8s/mongodb.yamlVerify:
kubectl -n iot-platform get podsdocker build -t iot-api:0.1 ./services/api
kind load docker-image iot-api:0.1 --name iot-local
kubectl apply -f k8s/api.yamldocker build -t iot-processor:0.1 ./services/processor
kind load docker-image iot-processor:0.1 --name iot-local
kubectl apply -f k8s/processor.yamlkubectl -n iot-platform port-forward svc/iot-api 8000:8000In another terminal:
python3 simulator/send_telemetry.py --devices 3 --interval 1 --rounds 5- Simulator sends telemetry via HTTP
- FastAPI ingestion service stores raw telemetry in MongoDB
- Processor service reads new telemetry
- Processor classifies data (HOT, COLD, HUMID, NORMAL)
- Processed data stored in a separate MongoDB collection
The terraform/ folder contains an example Infrastructure as Code configuration for provisioning cloud infrastructure (e.g., VPC + networking skeleton).
This demonstrates:
- Infrastructure as Code practices
- Cloud-native thinking
- Separation of local development and cloud deployment patterns
- Microservices architecture on Kubernetes
- Docker image build & cluster loading
- Kubernetes Deployments, Services, Secrets, PVC
- NoSQL data storage with MongoDB
- Background data processing service
- End-to-end telemetry simulation
- DevOps workflow using kind
- Infrastructure as Code awareness (Terraform)
- Add Kafka for real message streaming
- Add Prometheus + Grafana monitoring
- Deploy to managed Kubernetes (EKS/GKE/AKS)
- Add CI/CD pipeline (GitHub Actions)
- Add Horizontal Pod Autoscaler
Pattarin Thunyapar
Master’s in Data Analytics
Focused on Data Engineering, Cloud, and AI Systems





