<p>I am trying to setup RabbitMQ Operator and RabbitMQ Cluster  on K8S cluster on bare metal using this <a href="https://www.rabbitmq.com/kubernetes/operator/using-operator.html#create" rel="nofollow noreferrer">link</a></p>
<p>K8S Cluster has got 1 master and 1 worker node</p>
<p>RabbitMQ Cluster pod log</p>
<p>[root@re-ctrl01 containers]# kubectl logs definition-server-0 -n rabbitmq-system</p>
<pre><code>BOOT FAILED  (Tailored output)
===========
ERROR: epmd error for host definition-server-0.definition-nodes.rabbitmq-system: nxdomain (non-existing domain)

11:51:13.733 [error] Supervisor rabbit_prelaunch_sup had child prelaunch started with rabbit_prelaunch:run_prelaunch_first_phase() at undefined exit with reason {epmd_error,&quot;definition-server-0.definition-nodes.rabbitmq-system&quot;,nxdomain} in context start_error.  Crash dump is being written to: erl_crash.dump...
</code></pre>
<p>[root@re-ctrl01 containers]# kubectl describe pod definition-server-0 -n rabbitmq-system</p>
<pre><code>Name:         definition-server-0
Namespace:    rabbitmq-system
Priority:     0
Events:
  Type     Reason     Age               From               Message
  ----     ------     ----              ----               -------
  Normal   Scheduled  44s               default-scheduler  Successfully assigned rabbitmq-system/definition-server-0 to re-ctrl01.local
  Normal   Pulled     43s               kubelet            Container image &quot;rabbitmq:3.8.16-management&quot; already present on machine
  Normal   Created    43s               kubelet            Created container setup-container
  Normal   Started    43s               kubelet            Started container setup-container
  Normal   Pulled     42s               kubelet            Container image &quot;rabbitmq:3.8.16-management&quot; already present on machine
  Normal   Created    42s               kubelet            Created container rabbitmq
  Normal   Started    42s               kubelet            Started container rabbitmq
  Warning  Unhealthy  4s (x3 over 24s)  kubelet            Readiness probe failed: dial tcp 10.244.0.xxx:5672: connect: connection refused
</code></pre>
<p>I added the following entries to <code>/etc/hosts</code> file of <code>worker node</code> because I am NOT sure whether the entry has to be added to <code>master or worker</code></p>
<pre><code>[root@re-worker01 ~]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
127.0.0.1   re-worker01.local re-worker01 definition-server-0.definition-nodes.rabbitmq-system
</code></pre>
<p>I am stuck with this issue for almost 2 days.  I googled and found similar issues but none resolved my issue</p>
<p>I see multiple issues in pod logs and describe output and I am unable to find out the root cause</p>
<ol>
<li>Where can I find <code>erl_crash.dump</code>  file on K8S ?</li>
<li>Is this really a hostname related issue ?</li>
<li>10.244.0.xxx:5672: connect: connection refused  - Is this issue is because of <code>'epmd'</code> or something else ?</li>
</ol>

<p>I managed to resolve the issue after spending lot of time</p>
<p>I added the host <code>definition-server-0.definition-nodes.rabbitmq-system</code> to <code>/etc/hosts</code> file of RabbitMQ Cluster pod using <strong>hostAliases</strong></p>
<p>YAML to add <strong>hostAliases</strong> is given below</p>
<pre><code>apiVersion: rabbitmq.com/v1beta1
kind: RabbitmqCluster
metadata:
  name: definition
  namespace: rabbitmq-system
spec:
  replicas: 1
  override:
    statefulSet:
      spec:
        template:
          spec:
            containers: []
            hostAliases:
            - ip: &quot;127.0.0.1&quot;
              hostnames:
              - &quot;definition-server-0&quot;
              - &quot;definition-server-0.definition-nodes.rabbitmq-system&quot;
</code></pre>
