<p>Tryin to run RabbitMQ on a local k8s cluster but it keeps restarting till will <code>CrashLoopBackOff</code> with an error:</p>
<pre><code>2021-12-28 18:11:50.098771+00:00 [erro] &lt;0.846.0&gt; Error on AMQP connection &lt;0.846.0&gt; (10.1.0.159:52048 -&gt; 10.1.0.156:5672 - rabbitConnectionFactory#5dcbb60:0, vhost: '/', user: 'guest', state: running), channel 0:
2021-12-28 18:11:50.098771+00:00 [erro] &lt;0.846.0&gt;  operation none caused a connection exception connection_forced: &quot;broker forced connection closure with reason 'shutdown'&quot;
2021-12-28 18:11:50.098771+00:00 [erro] &lt;0.1089.0&gt; Error on AMQP connection &lt;0.1089.0&gt; (10.1.0.158:54532 -&gt; 10.1.0.156:5672 - rabbitConnectionFactory#102cec62:0, vhost: '/', user: 'guest', state: running), channel 0:
2021-12-28 18:11:50.098771+00:00 [erro] &lt;0.1089.0&gt;  operation none caused a connection exception connection_forced: &quot;broker forced connection closure with reason 'shutdown'&quot;
2021-12-28 18:11:50.098888+00:00 [erro] &lt;0.820.0&gt; Error on AMQP connection &lt;0.820.0&gt; (10.1.0.155:51038 -&gt; 10.1.0.156:5672 - rabbitConnectionFactory#67b7c170:10, vhost: '/', user: 'guest', state: running), channel 0:
2021-12-28 18:11:50.098888+00:00 [erro] &lt;0.820.0&gt;  operation none caused a connection exception connection_forced: &quot;broker forced connection closure with reason 'shutdown'&quot;
</code></pre>
<p>service:</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
  annotations:
    appName: {{ include &quot;common.fullname&quot; . }}
    componentName: rabbitmq
  labels:
    io.kompose.service: rabbitmq
  name: rabbitmq
spec:
  ports:
    - name: &quot;{{ .Values.service.ports.rabbitmq.port1 }}&quot;
      port: {{ .Values.service.ports.rabbitmq.port1 }}
      targetPort: {{ .Values.service.ports.rabbitmq.port1 }}
    - name: &quot;{{ .Values.service.ports.rabbitmq.port2 }}&quot;
      port: {{ .Values.service.ports.rabbitmq.port2 }}
      targetPort: {{ .Values.service.ports.rabbitmq.port2 }}
  type: LoadBalancer
  selector:
    io.kompose.service: rabbitmq
status:
  loadBalancer: {}
</code></pre>
<p>deployment:</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  annotations:
    appName: {{ include &quot;common.fullname&quot; . }}
    componentName: rabbitmq
  labels:
    io.kompose.service: rabbitmq
    {{- include &quot;common.labels&quot; . | nindent 4 }}
  name: rabbitmq
spec:
  replicas: {{ .Values.replicaCount }}
  selector:
    matchLabels:
      io.kompose.service: rabbitmq
  strategy: {}
  template:
    metadata:
      annotations:
        appName: {{ include &quot;common.fullname&quot; . }}
        componentName: rabbitmq
      labels:
        io.kompose.service: rabbitmq
    spec:
      containers:
        - env:
            - name: DEFAULT_PASS
              valueFrom:
                secretKeyRef:
                  name: direct-secrets
                  key: rabbitmq-password
          envFrom:
            - configMapRef:
                name: rabbitmq-configmap
          image: rabbitmq:3-management
          livenessProbe:
            exec:
              command:
                - rabbitmq-diagnostics -q ping
            failureThreshold: 3
            periodSeconds: 30
            timeoutSeconds: 30
          name: rabbitmq
          ports:
            - containerPort: {{ .Values.app.rabbitmq.port1 }}
            - containerPort: {{ .Values.app.rabbitmq.port2 }}
          resources: {}
      restartPolicy: Always
status: {}
</code></pre>
<p>configmap:</p>
<pre><code>apiVersion: v1
kind: ConfigMap
metadata:
  name: rabbitmq-configmap
data:
  DEFAULT_USER: &quot;{{ .Values.app.rabbitmq.user }}&quot;
</code></pre>
<p>values:</p>
<pre><code>app:

  rabbitmq:
    host: rabbitmq
    port1: 5672
    port2: 15672
    password: guest
    user: guest

service:
  ports:
    rabbitmq:
      port1: 5672
      targetPort1: 5672
      port2: 15672
      targetPort2: 15672
</code></pre>
<p>Any thoughts on that?</p>
<p>PS.</p>
<p>Output from the pod <code>describe</code>:</p>
<pre><code>Events:
  Type     Reason     Age                 From               Message
  ----     ------     ----                ----               -------
  Normal   Scheduled  17m                 default-scheduler  Successfully assigned default/rabbitmq-df54875b8-6m4dq to docker-desktop
  Normal   Killing    12m (x3 over 15m)   kubelet            Container rabbitmq failed liveness probe, will be restarted
  Normal   Pulled     11m (x4 over 16m)   kubelet            Container image &quot;rabbitmq:3-management&quot; already present on machine
  Normal   Created    11m (x4 over 16m)   kubelet            Created container rabbitmq
  Normal   Started    11m (x4 over 16m)   kubelet            Started container rabbitmq
  Warning  Unhealthy  95s (x24 over 16m)  kubelet            Liveness probe failed: OCI runtime exec failed: exec failed: container_linux.go:380: starting container process caused: exec: &quot;rabbitmq-diagnostics -q ping&quot;: executable file not found in $PATH: unknown
</code></pre>
<p>For some reason is not able to find <code>rabbitmq-diagnostics</code> which was present in previous images.</p>

JackTheKnife
<p>It came up that image contains <code>rabbitmq-diagnostics</code> but when you will specify command as a single string like that, it's looking for a binary in the path that's literally the full string, including spaces, <code>rabbitmq-diagnostics -q ping</code>, so it should be something like this instead:</p>
<pre><code>          command:
            - rabbitmq-diagnostics
            - -q
            - ping
</code></pre>
<p>or:</p>
<pre><code>          command: ['rabbitmq-diagnostics', '-q', 'ping']
</code></pre>
