<p>I have an application running in a Kubernetes cluster Azure AKS which is made up of a website running in one deployment, background worker processes running as scheduled tasks in Kubernetes, RabbitMQ running as another deployment and a SQL Azure DB which is not part of the Kubernetes.</p>

<p>I would like to deploy achieve load balancing and failover by deploying another kubernetes cluster in another region and placing a Traffic Manager DNS Load Balancer in front of the web site.</p>

<p>The problem that I see is that if the two rabbit instances are in separate kubernetes clusters then items queued in one will not be available in the other. </p>

<p>Is there a way to cluster the rabbitmq instances running in each kubernetes cluster or something besides clustering?
Or is there a common design pattern that might avoid problems from having seperate queues?</p>

<p>I should also note that currently there is only one node running RabbitMq in the current kuberntes cluster but as part of this upgrade it seems like a good idea to run multiple nodes in each cluster which I think the current Helm charts support.</p>

Zack
<p>You shouldn't cluster RabbitMQ nodes across regions. Your cluster will get split brain because of network delays. To synchronise RabbitMQ queues, exchanges between clusters you can use federation or shovel plugin, depending on your use case.</p>

<p>Federation plugin can be enabled on a cluster by running commands: </p>

<pre><code>rabbitmqctl stop_app
rabbitmq-plugins enable rabbitmq_federation
rabbitmq-plugins enable rabbitmq_federation_management
rabbitmqctl start_app
</code></pre>

<p>Mode details on <a href="https://www.rabbitmq.com/federation.html" rel="nofollow noreferrer">Federation</a>.</p>

<p>For shovel:</p>

<pre><code>rabbitmq-plugins enable rabbitmq_shovel
rabbitmq-plugins enable rabbitmq_shovel_management
rabbitmqctl stop_app
rabbitmqctl start_app
</code></pre>

<p>Mode details on <a href="https://www.rabbitmq.com/shovel.html" rel="nofollow noreferrer">Shovel</a>.</p>

<p>Full example on how to setup Federation on RabbitMQ cluster can be found <a href="https://codespacelab.com/rabbitmq-multi-region-setup/" rel="nofollow noreferrer">here</a>.</p>
