Jouda-Hidri / Tern

Migration service

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tern

The Arctic tern holds the record for the longest migration route of any bird, traveling from the Arctic to the Antarctic and back again every year.

The Antarctic tern is a species of tern that is native to the Antarctic region.

We want to migrate a service (Tern service) from legacy (Antarctic version) to a new version (Arctic version). We want Arctic to be receiving the traffic and synch with Antarctic, without falling in the issue of cascading HTTP.

We want to use Istio to maintain 2 deployments of the same app. The 2 services communicate using gRPC. On the gRPC callback, we make a call to Tapi using WebClient. Tapi exposes a a very large CSV file that we want to read using streaming, to avoid the issue of loading a large data in memory.

Setup

Make sure you have Docker, Minikube and maven 3.6.3 installed.

minikube start #(using virtualbox)    
minikube addons enable metrics-server    
eval $(minikube docker-env)    
mvn clean install    
docker build -t tern .    
cd deployment    
kubectl apply -f artic.yaml    
kubectl apply -f antartic.yaml    
kubectl apply -f postgres.yaml
minikube dashboard

minikube service artic

curl -d '{"text":"some-text"}' -H "Content-Type: application/json" -X POST {artic_host}    
curl {artic_host}

Istio

Make sure you have istio 1.18 installed.

# to download istio:    
curl -L https://istio.io/downloadIstio | sh -
# from inside istio folder
export PATH=$PWD/bin:$PATH
istioctl install --set profile=demo -y

kubectl label namespace default istio-injection=enabled    

kubectl apply -f https://raw.githubusercontent.com/istio/istio/release-1.18/samples/addons/prometheus.yaml    
kubectl apply -f https://raw.githubusercontent.com/istio/istio/release-1.18/samples/addons/kiali.yaml    
kubectl apply -f https://raw.githubusercontent.com/istio/istio/release-1.18/samples/addons/grafana.yaml    

istioctl dashboard kiali

Locust

In order to have a loadTest and see traffic animation on Kiali

Screenshot 2023-07-02 at 16 01 47

To setup Locust, clone this project https://github.com/Jouda-Hidri/tern-lt

Tapi

On the gRPC callback, Tapi is called Screenshot 2023-07-03 at 13 12 50

To setup Tapi, clone this project: https://github.com/Jouda-Hidri/tapi

About

Migration service


Languages

Language:Kotlin 97.5%Language:Dockerfile 2.5%