3

I have set up a microservice environment with kubernetes and a.o. eureka. The problems is that services get registered with the pod name and the clients try to access them directly and not with the kubernetes service. That's what I see in the eureka dashboard:

SERVICE-USERS   n/a (1) (1) UP (1) - service-users-1822504684-9b688:service-users:8501

Consequently, feign calls to that service fail with java.net.UnknownHostException: service-users-1822504684-9b688

Is there a way to make the eureka/kubernetes combination work? I understand that I could scrap eureka and let the clients talk to the kubernetes service directly.

A bit more info:

$ kubectl get pods
NAME                             READY     STATUS    RESTARTS   AGE
service-users-1822504684-9b688   1/1       Running   0          1h

$ kubectl get svc
NAME            CLUSTER-IP   EXTERNAL-IP   PORT(S)     AGE
service-users   10.0.0.119   <none>        8501/TCP    3d
miken32
  • 42,008
  • 16
  • 111
  • 154
Assen Kolov
  • 4,143
  • 2
  • 22
  • 32
  • This sounds like a possible duplicate of [Eureka and Kubernetes](http://stackoverflow.com/questions/40567429/eureka-and-kubernetes) ... you might want to provide some more details on how you configured your services / eureka. – pagid Feb 21 '17 at 11:29
  • I saw this: both answers advise to set up a service. That's what happens with a service. – Assen Kolov Feb 21 '17 at 11:48
  • As said before, maybe some details for the eureka configuration would be a good addition for your question... – pagid Feb 21 '17 at 21:15
  • Which details would you wish to see? – Assen Kolov Feb 21 '17 at 21:32
  • From reading a little into it, it seems that eureka uses some discovery configuration - that's maybe worth sharing – pagid Feb 21 '17 at 21:35
  • The service is registered with an unreachable pod name, so I guess no discovery configuration could help from this point. The whole client config (using spring-cloud-starter-eureka) is this one property: eureka.client.serviceUrl.defaultZone=http://eureka-server/eureka/, eureka-server being the kubernetes eureka service name. – Assen Kolov Feb 22 '17 at 16:21

0 Answers0