Search code examples
spring-bootspring-cloud

Migrating to Kubernetes, still need Spring Cloud Eureka/Zuul?


We are in the process of industrialising our first microservices application which is predominantly built using Spring Boot 2. We are currently using Spring Cloud Zuul for our routing and Eureka for service discovery.

We are looking to use Kubernetes on AWS (using EKS). My question is there still value of running Eureka and Zuul for service discovery/routing or can they be replaced by Kubernetes.


Solution

  • It all depends on what you want to achieve here.

    If you have existing applications that are registering themselves with Eureka and you want to use those services, then I'd say yes to have as little impact as possible. If you are only going to use Kubernetes then it could make sense to use its registry. Although there are others (eg. Consul, Eureka, Zookeeper) who would be a better candidate in case you want to have a hybrid system, or if you want to move from Kubernetes to X in the future.

    If you want to have an API gateway as entrypoint, then there are a lot of different solutions (Spring Cloud Gateway, Apigee, haproxy, nginx,...) with which you can use the cloud platform load balancers too. Basically you create routes between the endpoint in your API gateway and the address of the load balancer of Kubernetes (service). Now if you want to use smart load balancing, eg. using the circuitbreaker pattern, then I’d leverage the power of service discovery and client-side load balancing and stop using the load balancer of the platform. In the end it all comes down to what functionality you need.

    One thing to note is that most of the Spring Cloud Netflix components have entered maintenance mode, see this post: https://spring.io/blog/2019/01/23/spring-cloud-greenwich-release-is-now-available#spring-cloud-netflix-projects-entering-maintenance-mode