<p>I have been experimenting with setting up a RabbitMQ cluster with Kubernetes.
After doing some research, I stumbled upon the following 2 useful tutorials: 
<a href="https://kubernetes.io/docs/tasks/job/coarse-parallel-processing-work-queue/" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/job/coarse-parallel-processing-work-queue/</a> and <a href="https://github.com/rabbitmq/rabbitmq-peer-discovery-k8s/tree/master/examples/k8s_statefulsets" rel="nofollow noreferrer">https://github.com/rabbitmq/rabbitmq-peer-discovery-k8s/tree/master/examples/k8s_statefulsets</a></p>

<p>The first sets up a simple RabbitMQ Service with a ReplicationController and pushes through a test message, while the second goes a bit further and sets up a StatefulSet with RBAC etc.. So far, so good.</p>

<p>However, when I complete the second tutorial, I am trying to push a test message through, like in the first tutorial by running the slightly adjusted commands:</p>

<pre><code>export BROKER_URL=amqp://guest:guest@rabbitmq:5672
/usr/bin/amqp-declare-queue --url=$BROKER_URL -q foo -d
</code></pre>

<p>which then throws the error</p>

<pre><code>logging in to AMQP server: a socket error occurred
</code></pre>

<p>At first I thought the URL was wrong, but I verified that it by substituting <code>rabbitmq</code> with the ip address feteched using <code>nslookup rabbitmq</code> (as demonstrated in the first tutorial).</p>

<p>Could anyone help out on what I am missing here?</p>

<p>Thanks</p>

<p>I resolved the problem, it appears the kubernetes guide is outdated: if you use a newer image of unbutu (for example, ubuntu:18.04) when testing, it seems to work! </p>
