skip to Main Content

I have two kubernetes clusters running inside AWS EKS. How can I connect them both so that both can communicate and share data ?

On one cluster only stateless applications are running while on another stateful like Redis DB, RabbitMQ etc.

Which will be the easiest way to setup communication ?

2

Answers


  1. Chosen as BEST ANSWER

    I will be following the suggested approach by @marcincuber to use internal load balancer.

    However, I also got one another workaround exposing the Redis, RabbitMQ service type as LoadBalancer.

    Since my both cluster in the same VPC there is no need of VPC peering or any gateway setup, I am thinking to restrict the traffic via using Kubernetes default service loadBalancerSourceRanges.


  2. If you have a specific cluster to run DBs and other private stateful workloads, then ensure that your worker nodes for that EKS cluster are private.

    Next step would be to create service resource to expose your Redis DB with an internal endpoint. You can achieve it by specifying following:

    annotations:
        service.beta.kubernetes.io/aws-load-balancer-internal: "true"
    

    With the above you are going to have entire cluster and stateful workloads exposed using internal endpoints. Once this is done, you have two options to connect your VPCs.

    1. VPC peering to allow one cluster to connect with the other.
    2. Transit Gateway which two VPCs will use to communicate privately.
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search