<p>I have k8s cluster (1.16) with one service in it's specific namespace, and a stateful set of rabbitmq (image: 3.8.0-alpine) with 3 replicas, one on each of my workers, in a different namespace.
I configured the service to connect rabbitmq with <code>amqp://user:password@rabbitmq-service.rabbitmq-namespace:5672</code></p>
<p>I'm getting this error in the logs of my service:</p>
<pre><code>Rabbit mq disconnected connect EHOSTUNREACH &lt;rabbitmq_svc_ip&gt;:5672
</code></pre>
<p>rabbitmq seems to be working fine. there are no errors shown in the pods.</p>
<p>What can I  check to find the issue and make them communicate?</p>

Capobar
<p>You asked for how to approach this issue, and so I am including how I would approach it.</p>
<p>I would describe your service to see if your pod ips are listed as endpoints behind it.</p>
<pre><code>kubectl describe service &lt;rabbitmq-service&gt;
</code></pre>
<p>If they are not listed, then I would look at your service's selector to make sure that it matches your statefulset.  If they are listed, then I would double check that your Service Port is actually 5672, and then I would exec into your pod where your app is running and try to <code>ping</code> the service name in your connection string to make sure it's reachable from your app's namespace.  I would also try to do <code>telnet</code> tests to your service name and port to ensure that your app can connect to your service on that port, and I would telnet to your rabbitmq pod ips and ports to ensure that your app can connect to them.  If telnet isn't in your image, I would install it for troubleshooting purposes.</p>
<pre><code>kubectl exec -it &lt;app-pod&gt; -n &lt;namespace&gt; /bin/bash
</code></pre>
<pre><code>telnet &lt;pod ip or service name&gt; &lt;port&gt; 
</code></pre>
