Microservices in Docker Container

4/17/2018

I am using Spring Cloud for Creating Microservice Architecture.

I was using the below feature from the Spring Cloud

  • Zuul – API gateway service that provides dynamic routing, monitoring, resiliency, security, and more -
  • Ribbon – Client side load balancer
  • Feign – Declarative REST client
  • Eureka – Service registration and discovery
  • Sleuth – Distributed tracing via logs
  • Zipkin – Distributed tracing system with request visualization.
  • Hystrix - Circuit Breaker, Fault Tolerance, Hystrix Dashboard for all API

Now Lets say if I have 100 microservices, then we need 100 servers to maintain each microservices. So I thought of using Kubernetes to solve this issue by deploying each microservices in a separate docker container, so now since Kubernetes takes care of microserivice health check, autoscaling, load-balancing so do I need to again use Ribbon, Eureka and Zuul.

Can anyone please help me on this

-- Alex Man
docker
java
kubernetes
microservices
spring-cloud

2 Answers

4/17/2018

Even when you use Spring Cloud, 100 services do NOT mean 100 servers. In Spring Cloud the packaging unit is Spring Boot application and a single server may host many such Spring Boot applications. If you want, you can containerize the Spring Boot applications and other Spring Cloud infrastructure support components. But that is not Kubernetes.

If you move to Kubernetes, you don't need the infrastructure support services like Zuul, Ribbon etc. because Kubernetes has its own components for service discovery, gateway, load balancer etc. In Kubernetes, the packaging unit is Docker images and one or more Docker containers can be put inside one pod which is the minimal scaling unit. So, Kubernetes has a different set of components to manage the Microservices.

Kubernetes is a different platform than Spring cloud. Both have the same objectives. However, Kubernetes has some additional features like self healing, auto-scaling, rolling updates, compute resource management, deployments etc.

-- Saptarshi Basu
Source: StackOverflow

4/29/2018

Just to add to saptarshi basu's answer, you might want to look at https://dzone.com/articles/deploying-microservices-spring-cloud-vs-kubernetes as it walks through the comparison and asks which responsibilities you might want to be handled by which components when using Spring cloud on kubernetes

-- Ryan Dawson
Source: StackOverflow