Skip to content

parameshn/Cloud-Native-Microservice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cloud-Native Microservice

Product Catalog

Overview

Containerized Spring Boot microservice with multiple API versions deployed on Kubernetes with CI/CD automation.

Quick Start

Prerequisites

  • Docker
  • Kubernetes/Minikube
  • Java 11+
  • Maven

Local Setup

git clone https://github.com/parameshn/Cloud-Native-Microservice.git
cd Cloud-Native-Microservice
mvn spring-boot:run

Docker Deployment

# Build image
docker build -t product-service:v2.0 .
# Run container
docker run -p 8080:8080 product-service:v2.0

Kubernetes Deployment

# Start cluster
minikube start
minikube addons enable ingress
# Deploy
kubectl apply -f k8s/
# Access service
minikube tunnel

API Documentation

📮 Postman Collection

Endpoints

  • GET /api/v1/health - Health check
  • GET /api/v1/products - Get all products
  • POST /api/v1/products - Create product
  • GET /api/v1/products/{id} - Get product by ID
  • PUT /api/v1/products - Update product
  • DELETE /api/v1/products/{id} - Delete product
  • GET /api/v1/products/search?keyword=laptop - Search products (v1.1+)

Versions

  • v1.0: Basic CRUD operations
  • v1.1: + Search functionality
  • v2.0: + Enhanced search with pagination

Project Structure

├── src/
├── k8s/
│   ├── deployment-v1.yaml
│   ├── deployment-v2.yaml
│   └── ingress.yaml
├── .github/workflows/
├── Dockerfile
└── docker-compose.yml

Testing

# Local testing
curl http://localhost:8080/api/v1/health
# Kubernetes testing
curl http://product-service.local/v1/health

CI/CD

GitHub Actions pipeline automatically:

  • Runs tests
  • Builds Docker images
  • Deploys to Kubernetes

Set required secrets:

  • DOCKERHUB_USERNAME
  • DOCKERHUB_TOKEN

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Containerized Spring Boot microservice with multiple API versions(V1.0,V2.0,V3.0) deployed on Kubernetes with CI/CD automation.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors