🧑💻 Spring Boot CRUD Microservice with CI/CD & Kubernetes
A simple Spring Boot CRUD REST API using MySQL & H2 , containerized with Docker , and deployed to Kubernetes using GitHub Actions.
✅ CRUD APIs for Product entity
✅ Built with Spring Boot, Maven, and Lombok
✅ Containerized using Docker with multi-stage builds
✅ CI/CD with GitHub Actions --> Working on it
✅ Kubernetes Deployment, HPA, and Service
✅ Ingress routing with NGINX & TLS --> can use ingress but locally ran it on port forwarding
✅ Works with H2
✅ Versioned Microservice APIs
Java 17 + Spring Boot 2.2.4
Maven + Lombok
Docker (Multi-stage)
Kubernetes (via Minikube)
GitHub Actions (CI/CD)
Ingress
HPA for CPU scaling
MySQL / H2 database
Method
Endpoint
Description
GET
/products
Get all products
POST
/addProduct
Add a product
POST
/addProducts
Add multiple products
GET
/productById/{id}
Get product by ID
GET
/product/{name}
Get product by name
PUT
/update
Update a product
DELETE
/delete/{id}
Delete a product
# Clone the repo
git clone https://github.com/sujall18/springboot-devops.git
cd springboot-devops
# Run with Maven
mvn clean spring-boot:run
# Docker
# Build Docker image
docker build -t spring-crud .
# Run container
docker run -p 8080:8080 spring-crud
# Start Minikube
minikube start
# Deploy app
kubectl apply -f k8s/manifests-files
# Port-forward for testing
kubectl port-forward svc/crud-svc 8080:80
curl http://localhost:8080/
Version
Description
v1.0
Base version with /health, /products
v1.1
Add /products/search by keyword
v2.0
Query param-based search + handling
🤝 Author
Sujal Gaddam