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

<p>On one cluster only stateless applications are running while on another stateful like <strong>Redis DB</strong>, <strong>RabbitMQ</strong> etc.</p>

<p>Which will be the easiest way to setup communication ?</p>

Harsh Manvar
<p>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. </p>

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

<pre><code>annotations:
    service.beta.kubernetes.io/aws-load-balancer-internal: "true"
</code></pre>

<p>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.</p>

<ol>
<li>VPC peering to allow one cluster to connect with the other.</li>
<li>Transit Gateway which two VPCs will use to communicate privately.</li>
</ol>
