Join an external cluster from POD always attempt to connect rabbitmq-headless.rabbitmq.svc.cluster.local #7848
-
Describe the bugBasically, I installed the RabbitMQ on K8s using the The RabbitMQ app and Bitnami chart version I use: App version: 3.11.9 After deploying it on the K8s, I tried to have it join an external RabbitMQ cluster running on EC2 instances with HA mode enabled. The purpose of doing it is that I am preparing a migration of RabbitMQ from EC2 to Kubernetes given here The RabbitMQ node name on the source ( EC2 instance ) is Command running on the POD to join the external RabbitMQ EC2 node:
But it fails and shows the following error always:
To make the IP 1.2.3.4 known to the RabbitMQ on K8s to connect to rabbit@rabbitmqec2 since the short node name rabbitmqec2 does not resolve globally, I tried the following methods on K8s:
Using the hostAliases option by adding the following in the helm chart so that the POD /etc/hosts will have an entry
I tried creating an external service name ( within the same namespace rabbitmq ) with the short node name pointing to the DNS resolving long node name, say rabbitmqec2.example.com ( where the long node name points to the EC2 IP 1.2.3.4 )
I tried the following entry in CoreDNS confirmap
Even though I tried all the above methods, the command Reproduction steps
Expected behaviorThe following command should work successfully on the POD and it should connect to the source RMQ node using any of the 3 methods.
Additional contextNo response |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 2 replies
-
Joining nodes from two separate clusters is a curious migration strategy that the core team never recommends anywhere. Blue/Green deployment is what should be done instead. Our team does not maintain any charts but I assume it uses Kubernetes peer discovery. While you
by default will connect to a local node. Use The command will resolve the hostname of the target ( |
Beta Was this translation helpful? Give feedback.
-
To reiterate:
|
Beta Was this translation helpful? Give feedback.
-
Thanks, @michaelklishin Regarding the Blue/Green deployment, it says the following First define the upstream on "green" and point it to "blue":
If the source RMQ node name is rabbit@rabbitmqec2 where rabbitmqec2 is short name and non resolvable from the new cluster, how does it connect? Or can we simply use the source cluster node IP like |
Beta Was this translation helpful? Give feedback.
-
@michaelklishin the Blue/Green deployment method works great. I am marking this discussion as solved. |
Beta Was this translation helpful? Give feedback.
Joining nodes from two separate clusters is a curious migration strategy that the core team never recommends anywhere.
Blue/Green deployment is what should be done instead.
Our team does not maintain any charts but I assume it uses Kubernetes peer discovery. While you
can form a cluster using peer discovery and manually add nodes, this is very rarely done.
by default will connect to a local node. Use
--node
if you want to tell a different node to connect totarget cluster member
. Before you do so, the node must be reset, as in, ALL of its datamust be wiped out so that it can sync from
[existing cluster member]
. Which is why this cluster…