This project was executed using the services with the specific version listed below (on Windows 10 Pro):
- Docker 20.10.8
- Minikube 1.23.2
- Java 8
With the docker installed and running, execute:
docker login
Inform your docker hub credentials and press enter.
These credentials will be used by docker in the future to upload the images to your docker hub account.
Run the run.sh
script inside of all service folders passing the -n [USER_FROM_DOCKER_HUB]
run.sh -n thiago123789
like this:
- Email service
cd email
./run.sh -n thiago123789
- Bff service
cd bff
./run.sh -n thiago123789
- Subscription service
cd subscription
./run.sh -n thiago123789
First of all, we need to start the minikube
minikube start
After this, go to the Kubernetes folder and run the deploy-kubernetes.sh
./deploy-kubernetes.sh
if you want to use your own image repository from docker hub you must use -n [DOCKER_HUB_USER]
flag on the previous script, like the snippet below:
./deploy-kubernetes.sh -n thiago123789
⚠️ If you don't inform your docker hub user this script is gonna usethiago123789
by default
To test load balancer locally you need to use minikube tunnel running:
minikube tunnel
After this run:
kubectl get svc
The result will be something like this:
Now you need to use the external-ip to open the bff's swagger (on windows you can use localhost instead of 127.0.0.1)
So put on the browser the following address:
The swagger ui should appear with the endpoints available on bff service
⚠️ Can take some time until the swagger works after run minikube tunnel
The image above shows the architecture and how the services communicate between them.
All the operations from the BFF to the Subscription Service that will cause database change will be made using the RabbitMQ service
The connection string and credentials to access the RabbitMQ are configured on the Kubernetes secrets (secrets.yaml)
The email service is using Gmail to send the emails. The credentials used are also configured on Kubernetes secrets.
The communication between this service and the email service is made using RabbitMQ.
The requests related to adding new subscriptions and unsubscribe are received through RabbitMQ from the BFF service.
- add some cache service on bff get endpoints (using something like Redis)
- improve the logging
- add some service to help with trace requests
- improve swagger docs
- improve unit tests