A hands-on DevOps workshop project demonstrating microservices architecture with containerization and orchestration.
This project implements a simple calculator system using microservices architecture:
- API Gateway routes requests to individual services
- 5 Microservices handle operations: Add, Subtract, Multiply, Divide
┌─────────────────────────────────┐
│ API Gateway (Port 3000) │
├─────────────────────────────────┤
│ │ │ │
↓ ↓ ↓ ↓
Add Subtract Multiply Divide
(3001) (3002) (3003) (3004)
- Node.js 18+
- npm 9+
- Docker Desktop
- Kubernetes enabled in Docker Desktop
Terminal 1: Gateway
cd gateway
npm install
npm startTerminal 2: Add Service
cd add-service
npm install
npm startTerminal 3: Subtract Service
cd subtract-service
npm install
npm startTerminal 4: Multiply Service
cd multiply-service
npm install
npm startTerminal 5: Divide Service
cd divide-service
npm install
npm startGateway Health:
curl http://localhost:3000/healthGateway Info:
curl http://localhost:3000/infoOperations:
curl "http://localhost:3000/add?a=10&b=5"
curl "http://localhost:3000/subtract?a=10&b=3"
curl "http://localhost:3000/multiply?a=6&b=7"
curl "http://localhost:3000/divide?a=20&b=4"# Gateway
docker build -t jsanthoshkiran/calculator-gateway:v1 ./gateway
docker push jsanthoshkiran/calculator-gateway:v1
# Add Service
docker build -t jsanthoshkiran/calculator-add:v1 ./add-service
docker push jsanthoshkiran/calculator-add:v1
# Subtract Service
docker build -t jsanthoshkiran/calculator-subtract:v1 ./subtract-service
docker push jsanthoshkiran/calculator-subtract:v1
# Multiply Service
docker build -t jsanthoshkiran/calculator-multiply:v1 ./multiply-service
docker push jsanthoshkiran/calculator-multiply:v1
# Divide Service
docker build -t jsanthoshkiran/calculator-divide:v1 ./divide-service
docker push jsanthoshkiran/calculator-divide:v1docker run -p 3001:3001 jsanthoshkiran/calculator-add:v1
docker run -p 3002:3002 jsanthoshkiran/calculator-subtract:v1
docker run -p 3003:3003 jsanthoshkiran/calculator-multiply:v1
docker run -p 3004:3004 jsanthoshkiran/calculator-divide:v1
docker run -p 3000:3000 -e ADD_SERVICE_URL=http://host.docker.internal:3001 jsanthoshkiran/calculator-gateway:v1kubectl apply -f k8s/deployment.yaml
kubectl apply -f k8s/service.yamlkubectl get deployments
kubectl get pods
kubectl get svckubectl port-forward svc/calculator-gateway-service 3000:3000kubectl scale deployment calculator-add --replicas=5kubectl logs -f deployment/calculator-gatewayJenkins pipeline automatically:
- Builds Docker images
- Runs tests
- Pushes to Docker Hub
- Deploys to Kubernetes --- For testing a trigger
- Microservices architecture
- Docker containerization
- Kubernetes orchestration
- CI/CD pipeline automation
- GitHub version control workflow
- Production-ready deployment