Load Balancer is a microservice application built with Spring Boot. It provides an endpoint to check the status of the service and is deployed in a Kubernetes cluster. This service interacts with other microservices and is designed to be simple and efficient.
- Status Endpoint: Returns a message including the hostname of the pod serving the request.
- Kubernetes Deployment: Deployed as a Load Balancer service in a Kubernetes cluster.
- Docker
- Kubernetes (Minikube)
- Maven (JDK 17)
-
Clone the Repository
git clone https://github.com/mikailakar/LoadBalancer.git cd LoadBalancer/order-service
-
Start Minikube
minikube start
-
Build the Application
mvn clean package
-
Build the Docker Image
docker build -t order-service:1.0.0 .
-
Deploy the Application
kubectl apply -f k8s/order-service.yaml
-
Deploy using Skaffold
skaffold run
-
Verify the Deployment
kubectl get pods
-
Create a Tunnel
minikube tunnel
-
Verify the Service
kubectl get svc
-
Test the Load Balancer
Open Postman, create one GET end-point at http://127.0.0.1:8080/status and uncheck Connection(keep-alive). You should see a message indicating the hostname of the pod.