Containerized Spring Boot microservice with multiple API versions deployed on Kubernetes with CI/CD automation.
- Docker
- Kubernetes/Minikube
- Java 11+
- Maven
git clone https://github.com/parameshn/Cloud-Native-Microservice.git
cd Cloud-Native-Microservice
mvn spring-boot:run# Build image
docker build -t product-service:v2.0 .
# Run container
docker run -p 8080:8080 product-service:v2.0# Start cluster
minikube start
minikube addons enable ingress
# Deploy
kubectl apply -f k8s/
# Access service
minikube tunnelGET /api/v1/health- Health checkGET /api/v1/products- Get all productsPOST /api/v1/products- Create productGET /api/v1/products/{id}- Get product by IDPUT /api/v1/products- Update productDELETE /api/v1/products/{id}- Delete productGET /api/v1/products/search?keyword=laptop- Search products (v1.1+)
- v1.0: Basic CRUD operations
- v1.1: + Search functionality
- v2.0: + Enhanced search with pagination
├── src/
├── k8s/
│ ├── deployment-v1.yaml
│ ├── deployment-v2.yaml
│ └── ingress.yaml
├── .github/workflows/
├── Dockerfile
└── docker-compose.yml
# Local testing
curl http://localhost:8080/api/v1/health
# Kubernetes testing
curl http://product-service.local/v1/healthGitHub Actions pipeline automatically:
- Runs tests
- Builds Docker images
- Deploys to Kubernetes
Set required secrets:
DOCKERHUB_USERNAMEDOCKERHUB_TOKEN
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.