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

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

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

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

<p>Is it necessary to expose other ports?</p>

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

João Olavo Vasconcelos
<p>You will want to expose ports 4369 and 25672 using the same port numbers externally as I can't think of a way to tell the Erlang VM running <code>rabbitmqctl</code> to use a different port for EPMD lookups. You should also expose <a href="https://www.rabbitmq.com/networking.html#ports" rel="nofollow noreferrer">35672-35682</a> using the same port range externally.</p>
<p>Since you're using Kubernetes, I'll assume that you are using long names. Assume that, within your container, your node name is <code>rabbit@container1.my.org</code>, to access it externally use this command:</p>
<pre><code>rabbitmqctl -l -n rabbit@container1.my.org
</code></pre>
<p>Please note that <code>container1.my.org</code> <em>must</em> resolve via DNS to the correct IP address to connect to that container.</p>
<hr />
<p><sub><b>NOTE:</b> the RabbitMQ team monitors the <code>rabbitmq-users</code> <a href="https://groups.google.com/forum/#!forum/rabbitmq-users" rel="nofollow noreferrer">mailing list</a> and only sometimes answers questions on Stack Overflow.</sub></p>
