Inter-Cluster Service Discovery in Bare Metal Kubernetes Machines

Hello, I am exploring options for service discovery in my new project.

So here is how it is :
I have multiple bare metal Kubernetes (Linux) machines, with no cloud providers.
I have multiple Kubernetes clusters, for this example lets name them Cluster-1 and Cluster-2.

Now suppose I have 10 microservices (spring boot), I would want to deploy them in both the clusters.
So all 10 microservices in both the clusters.

The service discovery mechanism that I need is like :

If a microservice ms-1 from Cluster-1 needs to call another microservice ms-2 then I want the communication preference to be within same cluster if ms-2 is up and healthy in Cluster-1.
However, if ms-2 is not up/running in Cluster-1 then the call from ms-1 (Cluster-1) must go to ms-2 (Cluster-2).

This has to obviously be supported in order to be functional in a multi-cluster geographical network.

I cannot achieve this by the service discovery mechanisms that native Kubernetes offers.

So I am deciding to try out Consul and deploy my microservices with Kubernetes services of type NodePort hoping that Consul will be able to resolve the host and nodePort of the target service both inter and intra cluster. Fingers crossed !!

Now I have mainly 2 questions :

  1. Do I need to use spring-cloud-consul in every microservice in order to talk to Consul and get the host:port of the target service ?
    I see Linkerd does provide some capability by which microservices can talk to Linkerd and Linkerd talks to Consul and resolves the service on behalf of spring-cloud-consul client.

    I even saw this post --> Linkerd with SpringBoot

    I want to know more details about how it can be done.

  2. Do I need Consul at all ? Does Linkerd offer a solution to my requirement ?
    If yes then please enlighten me how ?

Thanks for reading a long question. I hope I will get some prompt and positive guidance to proceed with my project.

Hi there!

I believe the resources you refer to (that reference Consul) are referring to Linkerd 1.x.

We’re just in the process of rolling out Kubernetes-native multicluster support in Linkerd 2.8… Check out some of our blog posts about the in-progress work like https://linkerd.io/2020/02/17/architecting-for-multicluster-kubernetes/ and https://linkerd.io/2020/02/25/multicluster-kubernetes-with-service-mirroring/. It would be great if you can give us feedback on whether this sort of solution would work for you!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.