Containerized microservice that exposes an endpoint for calculating the n-th sequence of fibonacci.
This is a project for testing purposes.
- Java 11
- Minikube
- Docker
- Microservice developed using Spring Boot
- Fibonacci sequence calculated using fast doubling method
> ./gradlew bootRun
> curl http://localhost:8000/fib?n=1
1
> curl http://localhost:8000/fib?n=10
55
> curl http://localhost:8000/fib?n=72
498454011879264
- Multi-stage Dockerfile
- Docker compose file included
- Kubernetes with Horizontal Pod Autoscaler
> docker build -t <docker-image-name> .
> docker compose up
Please enable
metrics-server
minikube addon in order to allow HPA to work properly.
> minikube addons enable metrics-server
> minikube start
> kubectl apply -f fib.yaml
> minikube tunnel
> kubectl scale --replicas=<expected_replica_num> deployment kube-spring-fibonacci-deployment