how to register eureka services un Kubernetes

2/21/2017

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
-- Assen Kolov
kubernetes
netflix-eureka

0 Answers