Disadvantages of using Eureka for Kubernetes service discovery


David

context

I'm deploying a set of services containerized using Docker into AWS. Regardless of the deployment solution chosen (like raw EC2/ECS/Elastic Beanstalk/Fargate), we're going to face the problem of "service discovery".

To name just a few service discovery options I've considered:

  • AWS Route 53 Service Registry
  • Governor
  • Hach Corporation Consul
  • Spring Cloud Netflix Eureka

Details of my stack

I am developing a Java Spring Boot application using Spring Cloud and the target deployment environment is AWS.

Given that my stack is Spring based, spring cloud eureka makes sense to me when developing locally. Setting up a single node is easy, integrates well with the stack and ecosystem of choice, and requires very little setup.

Locally, we use docker compose (not swarm) to deploy the service - one of the containers deployed is a single node Eureka service discovery server.

However, when we move beyond local development into staging or production, we are considering options like Kubernetes.

My assessment of pros/cons

AWS Route 53 Service Registry

Requires us to specifically couple our code to AWS services. Not a problem by itself, we're stuck with the rest of the stack (SNS/SQS) anyway.

Since it relies on Route 53, making it slightly harder to run the stack locally, I guess we could open up a certain hosted zone for local development.

AWS native, no managed service registry or other "moving parts".

Spring Cloud Eureka

The downside is that it requires us to deploy and manage a cluster of highly available service registries, and it requires more resources. Another "movement part" to manage.

The advantage is that it fits our stack very well (spring ecosystem, spring boot, spring cloud, feign and zuul work well with this). It can also be easily run locally.

I think we need to configure the network and registry areas to ensure that clients publish their host addresses and not the docker container internal IP addresses. For example, if service A is on host A and wants to communicate with service B on host B, service B needs to advertise its EC2 address, not some internal docker IP.

question

If we are using Kubernetes for orchestration, there is no downside to using something like Spring Cloud Eureka over the built-in service discovery options described here https://kubernetes.io/docs/concepts/services-networking/service/ #discovering-services

Given that Kube provides this, using eureka deployed with kube for discovery doesn't seem like the best option. I think kube could do some optimizations to affect the usability and stability possible using eureka. For example, kube will know when to deploy a new service - eureka will have to rely on heartbeats/health checks, and depending on how it's configured (eg frequency), this can lead to stale records, while I think kube is not good enough for planned services A shutdown/reboot might not be affected by this. I'm guessing it can still handle unplanned failures like host failures or network partitions.

Does anyone have any advice on this? Do people use services like Kubernetes, but use other mechanisms for service discovery than those provided by kube. Is there a good reason to do one or the other?

Possible challenges I anticipate

We could replace eureka, but relying on Kube to perform discovery would mean that we would need to run kube locally for deployment, and currently we only have a simple small docker-compose file. Also, I'll have to see how easy it is to make sure this feature makes the ribbon, zuul, and pretense go perfectly.

Currently, we have eureka client configured for ribbon so that service A can serve service B like "service-b" and make ribbon resolve normal host through eureka client. I guess we can configure Ribbon to not use eureka and use an external Kube service name that will be resolved by Kube DNS at runtime...

Final note

Thanks in advance for any contributions or suggestions. I know this might draw attention to opinions. However, I'm hoping someone can provide objective guidance on when one solution is better than the other.

Alltej

You get instant service discovery with Kubernetes. So having another external service in the platform would be another application to maintain, deploy and possibly cause failures. Therefore, I would stick to the service discovery provided by Kubernetes.

Related


Disadvantages of using Eureka for Kubernetes service discovery

David context I'm deploying a set of services containerized using Docker into AWS. Regardless of the deployment solution chosen (like raw EC2/ECS/Elastic Beanstalk/Fargate), we're going to face the problem of "service discovery". To name just a few service dis

Disadvantages of using Eureka for Kubernetes service discovery

David context I'm deploying a set of services containerized using Docker into AWS. Regardless of the deployment solution chosen (like raw EC2/ECS/Elastic Beanstalk/Fargate), we're going to face the problem of "service discovery". To name just a few service dis

Custom Service Discovery Using Netflix Eureka

Mahesh Sind Currently, I'm working on a POC in an organization. Our goal is to implement service discovery. So I'm exploring Eureka. Eureka is great for unconditional discovery services. Our requirement is to implement conditional service discovery. Our curren

Custom Service Discovery Using Netflix Eureka

Mahesh Sind Currently, I'm working on a POC in an organization. Our goal is to implement service discovery. So I'm exploring Eureka. Eureka is great for unconditional discovery services. Our requirement is to implement conditional service discovery. Our curren

Custom Service Discovery Using Netflix Eureka

Mahesh Sind Currently, I'm working on a POC in an organization. Our goal is to implement service discovery. So I'm exploring Eureka. Eureka is great for unconditional discovery services. Our requirement is to implement conditional service discovery. Our curren

Custom Service Discovery Using Netflix Eureka

Mahesh Sind Currently, I'm working on a POC in an organization. Our goal is to implement service discovery. So I'm exploring Eureka. Eureka is great for unconditional discovery services. Our requirement is to implement conditional service discovery. Our curren

Custom Service Discovery Using Netflix Eureka

Mahesh Sind Currently, I'm working on a POC in an organization. Our goal is to implement service discovery. So I'm exploring Eureka. Eureka is great for unconditional discovery services. Our requirement is to implement conditional service discovery. Our curren

Custom Service Discovery Using Netflix Eureka

Mahesh Sind Currently, I'm working on a POC in an organization. Our goal is to implement service discovery. So I'm exploring Eureka. Eureka is great for unconditional discovery services. Our requirement is to implement conditional service discovery. Our curren

Custom Service Discovery Using Netflix Eureka

Mahesh Sind Currently, I'm working on a POC in an organization. Our goal is to implement service discovery. So I'm exploring Eureka. Eureka is great for unconditional discovery services. Our requirement is to implement conditional service discovery. Our curren

eureka unknownHostException in service discovery

prranay I have two microservices, eureka-client-1 running on localhost:8081 eureka-client-2 running on localhost:8082 Both are DiscoveryClient registered with 'eureka-server' running on localhost:8761. In the code snippet below, I am trying to call eureka-clie

eureka unknownHostException in service discovery

prranay I have two microservices, eureka-client-1 running on localhost:8081 eureka-client-2 running on localhost:8082 Both are DiscoveryClient registered with 'eureka-server' running on localhost:8761. In the code snippet below, I am trying to call eureka-clie

eureka unknownHostException in service discovery

prranay I have two microservices, eureka-client-1 running on localhost:8081 eureka-client-2 running on localhost:8082 Both are DiscoveryClient registered with 'eureka-server' running on localhost:8761. In the code snippet below, I am trying to call eureka-clie

Microservice Discovery Service in Kubernetes

Fuad Lately, I've read a lot about microservices and kubernetes and have also tried both techniques. I know the different components available in k8s like Pods, Services, Deployments... and I also know that services can be of type ClusterIP to restrict connect

Microservice Discovery Service in Kubernetes

Fuad Lately, I've read a lot about microservices and kubernetes and have also tried both techniques. I know the different components available in k8s like Pods, Services, Deployments... and I also know that services can be of type ClusterIP to restrict connect

Microservice Discovery Service in Kubernetes

Fuad Lately, I've read a lot about microservices and kubernetes and have also tried both techniques. I know the different components available in k8s like Pods, Services, Deployments... and I also know that services can be of type ClusterIP to restrict connect

Microservice Discovery Service in Kubernetes

Fuad Lately, I've read a lot about microservices and kubernetes and have also tried both techniques. I know the different components available in k8s like Pods, Services, Deployments... and I also know that services can be of type ClusterIP to restrict connect

Microservice Discovery Service in Kubernetes

Fuad Lately, I've read a lot about microservices and kubernetes and have also tried both techniques. I know the different components available in k8s like Pods, Services, Deployments... and I also know that services can be of type ClusterIP to restrict connect

Microservice Discovery Service in Kubernetes

Fuad Lately, I've read a lot about microservices and kubernetes and have also tried both techniques. I know the different components available in k8s like Pods, Services, Deployments... and I also know that services can be of type ClusterIP to restrict connect

Unable to register to discovery server service (EUREKA)

Heena Mittal: So when I run my service instance. It does not register itself with the discovery server. And there aren't any errors, so I'm not able to pinpoint the problem here. application.propertiesMy service looks like this and the application.propertiesdi

Eureka service discovery without Spring-boot

Upul Doluweera: I have written a Spring Boot microservice and a REST client. The client is part of another module and makes RESTful calls to the microservice. The microservice is registered in the Eureka registry and I want my clients (not the Spring Boot proj

Eureka service discovery without Spring-boot

Upul Doluweera: I have written a Spring Boot microservice and a REST client. The client is part of another module and makes RESTful calls to the microservice. The microservice is registered in the Eureka registry and I want my clients (not the Spring Boot proj

Unable to register to discovery server service (EUREKA)

Heena Mittal: So when I run my service instance. It does not register itself with the discovery server. And there aren't any errors, so I'm not able to pinpoint the problem here. application.propertiesMy service looks like this and the application.propertiesdi

Eureka service discovery without Spring-boot

Upul Doluweera I have written a Spring Boot microservice and a REST client. The client is part of another module and makes RESTful calls to the microservice. The microservice is registered in the Eureka registry and I want my clients (not the Spring Boot proje