"How can I connect a StatefulSet in Cluster 1 to a StatefulSet in Cluster 2, both located in different regions? Is there a way to establish communication between StatefulSets across different region clusters?"

Sunil Yadav 25 Reputation points
2024-05-28T08:26:55.85+00:00

"How can I connect a StatefulSet in Cluster 1 to a StatefulSet in Cluster 2, both located in different regions? Is there a way to establish communication between StatefulSets across different region clusters?"

Example -
"I have a Solr instance (StatefulSet) in AKS Cluster 1 and want to connect it to a ZooKeeper instance (StatefulSet) in AKS Cluster 2. While I know it's possible to connect through a service via a private DNS zone, the requirement here is to connect directly to each node resource rather than through the service, due to the distributed nature of the StatefulSet pods. How can I achieve this node-to-node connection between the two clusters?"

Azure Kubernetes Service (AKS)
Azure Kubernetes Service (AKS)
An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
2,399 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. SaiSurya Vamsi Sapireddy 0 Reputation points
    2024-05-28T08:36:47.44+00:00

    I think creating a DNS will resolve the issue and configuring both the stateful sets to DNS zone which will be help in cross connection between the cluster and as both the clusters are using same DNS zone there would be no downtime on each of these cluster.

    Step1: Create a DNS zone

    Step2: Create stateful sets for each of these cluster to use DNS

    Step 3: Configure DNS with the both these stateful-sets of two clusters


  2. Miguel Fernández Corral 210 Reputation points
    2024-05-28T09:23:19.17+00:00

    You can use Azure CNI (advanced) networking:

    https://learn.microsoft.com/en-us/azure/aks/concepts-network


  3. Prrudram-MSFT 28,161 Reputation points Moderator
    2024-08-07T15:02:28.7+00:00

    Hi @Sunil Yadav

    I can share some high level steps here to connect StatefulSets across different Azure regions, you can follow these steps:

    Create a Private DNS Zone: Set up a private DNS zone that both clusters can use. This will help in resolving the internal DNS names of the pods across clusters. Then, you can configure Azure CNI (Advanced) Networking: Use Azure CNI for advanced networking capabilities. This allows you to create a virtual network that spans multiple regions, enabling direct communication between pods in different clusters. Set Up VNet Peering, peer the virtual networks of both clusters. This will allow the pods in one cluster to communicate with the pods in the other cluster directly. Use Headless Services, by creating headless services for your StatefulSets. This will ensure that each pod gets a stable DNS name that can be resolved across clusters. Configure Network Policies: Ensure that the network policies allow traffic between the pods in different clusters. This might involve setting up appropriate firewall rules and security groups. Test the Connection: Verify the connectivity by testing the communication between the pods in different clusters. You can use tools like kubectl exec to run commands inside the pods and check the connectivity.

    By following these steps, you should be able to achieve node-to-node communication between your Solr instance in AKS Cluster 1 and your ZooKeeper instance in AKS Cluster 2

    Hope this helps!

    --please don't forget to "[Accept the answer]" if the reply is helpful--

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.