This repository is about developing a microservices-based app. More specifically:
-
Use the MVC pattern to design and develop a RESTful microservice that receives text through an HTTP request, redacts it and sends it back in pdf format as a response. The microservice should be discoverable through a registration service (e.g. Netflix’s Eureka service). The redaction should handle at least names, email addresses, and street addresses.
-
Use the MVC pattern to design and develop a web server that obtains input from a UI, generates an appropriate HTTP request containing the text, and sends it over to the redaction microservice. It then receives and saves the returned pdf.
This practical coursework is about containerizing and deploying a microservices-based app. More specifically:
- Containerize all microservices developed previously and execute the containers locally.
- Deploy all containerized microservices on a cluster and execute them.
- Scale out the app by deploying 3 replicas of the redaction microservice.
- Create a new version of the redaction microservice that includes one additional piece of functionality, namely hashing. This functionality is accessible via its own endpoint.
- The microservice implements HATEOAS: any request to the redaction functionality, should return a response including the link to the hashing functionality.
- Containerize the new version and use a rolling update to replace the old version with the new one.
Demo zone:
europe-west1-b
gcloud auth configure-docker
gcloud config set project PROJECT_ID
gcloud config set compute/zone compute-zone
gcloud container clusters create cluster-name
cd pdf
docker build -t apournaras/pdf .
docker run -p 3333:3333 apournaras/pdf
docker push apournaras/pdf
cd pdf
docker build -t gcr.io/caramel-banner-388810/pdf .
docker run -p 3333:3333 gcr.io/caramel-banner-388810/pdf
docker push gcr.io/caramel-banner-388810/pdf
docker compose up -d
docker compose down
cd kubernetes
kompose convert -f ..\docker-compose.yml
Add this type in each service.yml
type: LoadBalancer
cd kubernetes
kubectl apply -f .
kubectl rollout status deployment/redaction
kubectl rollout restart deployment/redaction