How to discover services deployed on kubernetes from the outside?

7/30/2018

The User Microservice is deployed on kubernetes.

The Order Microservice is not deployed on kubernetes, but registered with Eureka.

My questions:

How can Order Microservice discover and access User Microservice through the Eureka??

-- Green Lei
kubernetes
netflix-eureka
spring-cloud

1 Answer

7/30/2018

First lets take a look at the problem itself: If you use an overlay network as Kubernetes CNI, the problem is that it creates an isolated Network thats not reachable from the outside (e.g. Flannel). If you have a network like that one solution would be to move the eureka server into kubernetes so eureka can reach the service in Kubernetes and the service outside of Kubernetes.

Another solution would be to tell eureka where it can find the service instead of auto discovery but for that you also need to make the service externally available with a Service of type NodePort, HostPort or LoadBalancer or with an ingress and I'm not sure its possible, but 11.2 in the following doc could be worth a look Eureka Client Discovery.

The third solution would be to use a CNI thats not using an overlay network like Romana which will make the service external routable by default.

-- BeWu
Source: StackOverflow