How to access from outside a RabbitMQ Kubernetes cluster using rabbitmqctl?

6/12/2019

I've a RabbitMQ cluster running on a Kubernetes environment. I don't have access to the containers shell, so I'm trying to run rabbitmqctl from a local container (same image).

These ports are exposed: - 15672 (exposed as 32672) - 5671 (exposed as 32671) - 4369 (exposed as 32369) - 25672 (exposed as 32256)

The correct cookie is on $HOME/.erlang.cookie on my local container.

How to specify the cluster URL and port to rabbitmqctl, so I can access the RabbitMQ cluster from outside?

Is it necessary to expose other ports?

Is it even possible to do this, since I can't find any reference to this on documentation?

-- João Olavo Vasconcelos
kubernetes
rabbitmq

1 Answer

6/12/2019

You will want to expose port 4369 and 25672 using the same port numbers externally as I can't think of a way to tell the Erlang VM running rabbitmqctl to use a different port for EPMD lookups. You should also expose 35672-35682 using the same port range externally.

Since you're using Kubernetes I'll assume that you are using long names. Assume that, within your container, your node name is rabbit@container1.my.org, to access it externally use this command:

rabbitmqctl -l -n rabbit@container1.my.org

Please note that container1.my.org must resolve via DNS to the correct IP address to connect to that container.


NOTE: the RabbitMQ team monitors the rabbitmq-users mailing list and only sometimes answers questions on StackOverflow.

-- Luke Bakken
Source: StackOverflow