Basic Example of Spring Boot Microservices with Istio
Steps to run -:
-
Build the docker images of the microservices. Note - The docker should be running. mvn com.google.cloud.tools:jib-maven-plugin:build -Dimage=<{docker-id}/{image-name}>
-
Check your docker and kubernetes is running fine, if not start them first
-
Open a terminal and go to the path where istio is installed and apply the manifest using the profile demo. istioctl manifest apply --set profile=demo
-
Now, deploy the yaml files in the kube folder. Go to the source path of the cloned project kubectl apply -f kube
-
Check the pods are in running state using kubectl get pods. Wait till the pods are in running state by checking the command
-
Determine the IP using -: (kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{jsonpath='{.status.loadBalancer.ingress[0].hostname}')
-
Determine the http port -: (kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{jsonpath='{.spec.ports}') This will give all the ports. Check for http2 and use it
-
Run the application from the browser such as -: http://localhost/service-1 // http://localhost/service-2
-
After all done remove the services -: kubectl delete -f kube
-
Remove the manifest -: istioctl manifest generate --set profile=demo | kubectl delete -f -