integrate eureka with kubernetes issue integrate eureka with kubernetes issue kubernetes kubernetes

integrate eureka with kubernetes issue


The problem here is that Eureka is a stateful app and you cannot scale it by just increasing the number of replicas.

See the Eureka "peer awereness" docs : http://cloud.spring.io/spring-cloud-netflix/spring-cloud-netflix.html


As it seems you want to replace Eureka discovery by Kubernetes discovery here is another answer (from http://cloud.spring.io/spring-cloud-netflix/spring-cloud-netflix.html) :

First disable eureka support in Ribbon:

ribbon:  eureka:   enabled: false

Then add a config property like this in your gateway for every microservice you want to access through your gateway (you could load those properties with a config server).

app1:     ribbon:    listOfServers: app1-k8s-service-nameapp2:     ribbon:    listOfServers: app2-k8s-service-name

Then your gateway should be able correctly route calls to your microservices.


Since you disabled eureka, only using zuul proxy :

server.ribbon.listOfServers=localhost:9090,localhost:9091,localhost:9092server.ribbon.eureka.enabled=false

in case you are deploying on k8s (kubernetes), use the service name

ribbon:   eureka:     enabled: falsezuul:  routes:    organization-proxy:      serviceId: organization-service      path: /organization/**organization-proxy:     ribbon:    listOfServers: organization

enter image description here