A complete, production-ready microservices application deployed on Kubernetes with Docker containerization and Nginx ingress controller.
┌─────────────────────────────────────────┐
│ Kubernetes Cluster │
│ ┌───────────────────────────────────┐ │
│ │ Nginx Ingress Controller │ │
│ └────────────┬──────────────────────┘ │
│ │ │
│ ┌───────┴────────┐ │
│ │ │ │
│ ┌────▼─────┐ ┌────▼─────┐ │
│ │ Frontend │ │ Backend │ │
│ │ Service │ │ Service │ │
│ │ (React) │ │ (Go) │ │
│ │ 2 replicas│ │ 2 replicas│ │
│ └──────────┘ └──────────┘ │
└─────────────────────────────────────────┘
- Frontend: React 18 with modern hooks
- Backend: Go 1.21 with standard HTTP library
- Containerization: Docker with multi-stage builds
- Orchestration: Kubernetes (Minikube for local dev)
- Ingress: Nginx Ingress Controller
- Version Control: Git/GitHub
- Docker or Colima
- Minikube
- kubectl
- Helm (for ingress)
- Git
git clone https://github.com/YOUR_USERNAME/openstack-prod.git
cd openstack-prodminikube start --driver=docker --cpus=2 --memory=4g# Point Docker to Minikube's environment
eval $(minikube docker-env)
# Build backend
cd docker/backend
docker build -t backend-api:v1 .
# Build frontend
cd ../frontend
docker build -t frontend-app:v1 .cd ~/openstack-prod
# Deploy backend
kubectl apply -f kubernetes/deployments/backend-deployment.yaml
kubectl apply -f kubernetes/services/backend-service.yaml
# Deploy frontend
kubectl apply -f kubernetes/deployments/frontend-deployment.yaml
kubectl apply -f kubernetes/services/frontend-service.yaml
# Wait for pods to be ready
kubectl get pods -w# Enable nginx ingress
minikube addons enable ingress
# Apply ingress configuration
kubectl apply -f kubernetes/ingress/nginx-ingress.yaml
# Setup port forwarding
kubectl port-forward -n ingress-nginx svc/ingress-nginx-controller 8080:80Open your browser to: http://localhost:8080
Run the automated test script:
./scripts/test-app.shOr test manually:
# Test backend API
curl http://localhost:8080/api/hello
# Test frontend
curl http://localhost:8080/openstack-prod/
├── apps/
│ ├── backend/ # Go API source code
│ └── frontend/ # React app source code
├── docker/
│ ├── backend/ # Backend Dockerfile
│ └── frontend/ # Frontend Dockerfile + nginx config
├── kubernetes/
│ ├── deployments/ # K8s Deployment manifests
│ ├── services/ # K8s Service manifests
│ └── ingress/ # Ingress configuration
├── scripts/
│ └── test-app.sh # Automated testing script
└── README.md
- Multi-stage builds for optimized image sizes
- Non-root users for security
- Health checks built into images
- Backend: ~15MB final image
- Frontend: ~50MB final image
- High Availability: 2 replicas per service
- Health Probes: Liveness and readiness checks
- Resource Limits: CPU and memory constraints
- Service Discovery: DNS-based service communication
- Rolling Updates: Zero-downtime deployments
- Path-based routing:
/api/*→ Backend,/→ Frontend - Nginx: Production-grade reverse proxy
- Port forwarding: Easy local development access
Check pod status:
kubectl get podsView logs:
# Backend logs
kubectl logs -l app=backend
# Frontend logs
kubectl logs -l app=frontendDescribe resources:
kubectl describe deployment backend-deployment
kubectl describe service backend-service
kubectl describe ingress app-ingress- Make code changes in
apps/ - Rebuild Docker image
- Delete old deployment:
kubectl delete deployment <name> - Reapply:
kubectl apply -f kubernetes/deployments/<file>.yaml
For production deployment on OpenStack or other cloud platforms:
- Use real LoadBalancer instead of port-forward
- Add TLS/SSL certificates for HTTPS
- Implement monitoring (Prometheus + Grafana)
- Add logging (ELK stack or Loki)
- Use Helm charts for easier deployment
- Implement CI/CD (GitHub Actions, Jenkins)
- Add persistent storage if needed
- Configure horizontal pod autoscaling
Pull requests welcome! Please ensure:
- Code follows existing patterns
- Docker images build successfully
- All pods become Ready
- Tests pass
MIT License
Built as a DevOps learning project demonstrating Kubernetes, Docker, and microservices architecture.
Built with ❤️ using Kubernetes, Docker, Go, and React