
This microservice application is composed of the following flask applications :
- NaturalLanguageProcessingService: takes in a travel order as text and defines what the origin and destination are.
- VoiceRecognitionService: takes in an audio, returns its transcription.
- TravelOptimizerService: takes in the origin and destination, and returns an optimized train itinerary between the two.
- Public API: This is the api that will be available to our end user. It will :
- Take in a travel order, either text or audio
- If the input is an audio file, request its transcription from the VoiceRecognitionService
- Send the text travel order to the NaturalLanguageProcessingService to get the travel's origin and destination
- Send the origin and destination to the TravelOptimizerService
- Return the optimized travel plan to the user.
For each service :
-
Build and tag your image
docker build -t your-username/your-image-name:your-tag .
-
Push it it to the docker hub registry
docker login
docker push your-username/your-image-name:your-tag
terraform apply
-
(First time only) Authenticate kubectl to gcloud
gcloud config set project travelorderresolver-401809 gcloud container clusters get-credentials "primary" --region "europe-west9-a"
-
Apply all kubernetes manifests found in the k8s/ folder
kubectl apply -f ./k8s
-
Check that services are ok
kubectl get svc
-
Check that the ingress has properly started
kubectl describe ingress microservices-ingress
-
Get the ip of the ingress ressource (Cloud HTTP(S) Load Balancer)
kubectl get ingress microservices-ingress -o=jsonpath='{.status.loadBalancer.ingress[0].ip}'
-
Start the cluster
minikube start
-
Apply all manifests
kubectl apply -f ./k8s/
-
(Optional) Set up the ingress (nginx routing)
- Enable minikube cluster's Ingress Controller
minikube addons enable ingress
- Verify that the ingress controllers are set up
kubectl get pods --all-namespaces
- Create a route from localhost to the Minikube cluster's services :
minikube tunnel
- Add the services to your hosts file (Your computer's dns will replace the service name with the cluster's ip when you request a service. The ingress controller can then use the header
"host":<service-name>.localattached to your request to route it to the appropriate service )127.0.0.1 nlp-service.local
127.0.0.1 voice-recognition-service.local
127.0.0.1 travel-optimizer-service.local
127.0.0.1 public-api.local
- Enable minikube cluster's Ingress Controller
-
See an overview the cluster
minikube dashboard
-
(Optional: if ingress not set up) Expose services to the outside of the cluster:
minikube service <service-name>