Microservice architecture without service discovery

7/12/2018

I need help for the right workflow for developing with Jhipster when there is no local service discovery.

In my current private projects I used Jhipster registry for service discovery, and OAuth2 (Keycloak). Everything were deployed to Kubernetes, which worked perfectly.

Now I want to switch to Istio. Therefore I selected the option 'serviceDiscoveryType' : false.

In a kubernetes environment this probably works because the ingress definition handles routing. I haven't tried that yet.

My problem at this point is that I don't know how to develop locally without this. When I start a simple gateway (port 8080), which connects to a microservice (port 8081), I get an error, because it looks for the microservice at port 8080.

At this point I want to add, that everything is secured by Oauth2 (Keycloak).

Is there a possibility to route the secured calls to the right port (8081), maybe an option in 'webpack.dev.js'?

Thanks for any advice.

-- user1651904
istio
jhipster
kubernetes

1 Answer

7/12/2018

that's one issue we will cover in the future in jhipster. But currently here is what you can do:

  1. inner load balancing: when starting your services in docker-compose (chack out jhipster docker-compose, then you can access the services the same as in kubernetes. If you have a "foo-app" running, you can exec into any container and curl http://foo-app/ and get routed correctly.

  2. edge routing: in kubernetes you can define several ingress paths, to make example.com/ routing to gateway:8080, example.com/foo routing to foo:8081 (if that's the configuration). Docker-compose itself doesn't have any feature for that. However, you can solve that by building an NGINX reverse proxy for that.

Check out that: https://medium.com/@joatmon08/using-containers-to-learn-nginx-reverse-proxy-6be8ac75a757

it explains pretty good how to setup something similar

-- David Steiman
Source: StackOverflow