Phase 1 modernization of the sample ecommerce microservices project to a Kubernetes-native local runtime.
Install and verify these before running the project:
- Java 17
- Maven 3.8+
- Docker Desktop
- Kubernetes enabled in Docker Desktop
kubectlavailable in your terminal
Quick checks:
java -version
mvn -version
docker version
kubectl version --client
kubectl get nodesExpected:
- Docker Desktop is running
- Kubernetes is enabled
kubectl get nodesshows the local Docker Desktop node asReady
- Clone or download the repository.
- Open a terminal in the project root:
cd C:\git\microservices-ecommerce-2- Confirm the Kubernetes manifests are present under
k8s\. - Confirm the helper script exists:
dir start.batUse the provided startup script from the repository root:
start.batWhat start.bat does:
- removes old Kubernetes resources for this app
- removes stale local Docker images for this app
- builds all three Spring Boot services
- builds Docker images with explicit
v2tags - deploys the Kubernetes manifests
- waits for the three deployments to become ready
- prints pod, service, and ingress status
The application runs as three services inside Kubernetes:
ecommerceproductimages
Internal service discovery uses Kubernetes DNS:
http://ecommerce-service:8090http://product-service:8090http://images-service:8090
For Docker Desktop local access, use:
http://localhost:8090/ecommerce-service/ecommerceProducts
This works because ecommerce-service is exposed as a Kubernetes LoadBalancer service on port 8090.
Check that everything is running:
kubectl get pods -n ecommerce
kubectl get svc -n ecommerce
kubectl get ingress -n ecommerceExpected:
product,images, andecommercepods are1/1 Runningecommerce-serviceis exposed on port8090
Test the main API:
curl http://localhost:8090/ecommerce-service/ecommerceProductsUseful log commands:
kubectl logs -n ecommerce deploy/product
kubectl logs -n ecommerce deploy/images
kubectl logs -n ecommerce deploy/ecommerceThis project no longer uses:
nginxconsulconsul-templateHOST_IPdocker-composeruntime routing
The Ingress manifest is still present as part of the Phase 1 Kubernetes migration, but on a default Docker Desktop setup the stable local endpoint for this repo is the LoadBalancer service URL on localhost:8090.