theAsker
theAsker

Reputation: 527

Deploy Spring Microservices on Openshift

I need to deploy a few microservices on the Openshift. These microservices are implemented using Spring Cloud. I use Spring Eureka for service discovery/load-balancing && Spring Zuul for service routing.

From what I understand, Openshift already provides these features ( service discovery, load balancing, routing ) via Kubernetes.

With this being said, can I integrate Spring Eureka and Spring Zuul with the openshift platform?

Woudn't it be redundant to add Spring Eureka & Spring Zuul components into Openshift since the platform itself already provides these microservice features ?

I was thinking of removing the service registry & routing Spring components and just implement routing using Openshift. However, that would leave the project heavily dependent on this cloud platform.

What would your approach be? Use the features provided by the OpenShift (routing, load balancing) or use the ones provided by the Spring framework and try to integrate them with the cloud platform?

Thanks

Upvotes: 4

Views: 1747

Answers (2)

fgul
fgul

Reputation: 6501

I agree with @Jeff and I want to add about using spring zuul as a gateway instead of openshift routes:

  • If you use spring zuul as a gateway, you provide the accessing from single point to your cluster. Otherwise, your client you must know the urls exposing by openshift routes. It gets increase the complexity of your code and hard to maintain. A major benefit of using an API Gateway is that it encapsulates the internal structure of the application.
  • The other is about security. If you use openshift routes to expose your internal microservices, actually you open door of the microservice to the public world directly. In addition, If you want to use JWT or security token, you should choose the spring zuul.
  • The API Gateway provides each kind of client with a specific API. This reduces the number of round trips between the client and application.

Upvotes: 0

Jeff
Jeff

Reputation: 1955

It would indeed be redundant. Eureka can be replaced by Kubernetes services. (they provide a load balancer and a domain name for a group of pods) Zuul can be replaced by OpenShift Routes for exposing your services.

If you are using a platform, use the platform provided functionality. Kubernetes services will be used on any Kubernetes based platform. So I think that's the easy one to replace and keep your coupling to the platform low. The routing can be more difficult, if Zuul is only used for routing; replace it with the OpenShift router. If Zuul also has other responsibilities like security it might be better to stick with Zuul.

Upvotes: 2

Related Questions