<p>I have docker-compose file with rabbitmq management image running. I am able to access UI for management.</p>

<pre><code>$ cat docker-compose.yml
---
version: '3.7'
services:
  rabbitmq:
    image: rabbitmq:management
    ports:
      - '5672:5672'
      - '15672:15672'
    environment:
      RABBITMQ_DEFAULT_VHOST: storage-collector-dev
      RABBITMQ_DEFAULT_USER: dev
      RABBITMQ_DEFAULT_PASS: dev
</code></pre>

<p>I am trying to convert that to Kubernetes Pods and services.</p>

<p>I am using Mac to run minikube.</p>

<p>Here are my files </p>

<pre><code>$ tree kubernetes/
kubernetes/
└── coreservices
    ├── rabbitmq_pod.yml
    └── rabbitmq_service.yml
</code></pre>

<pre><code>$ cat kubernetes/coreservices/rabbitmq_pod.yml
---
apiVersion: v1
kind: Pod
metadata:
  name: rabbitmq-pod
  labels:
    app: rabbitmq
spec:
  containers:
    - name: rabbitmq-pod
      image: rabbitmq:management
      ports:
        - containerPort: 5672
          name: amqp
        - containerPort: 15672
          name: http
      env:
        - name: RABBITMQ_DEFAULT_VHOST
          value: storage-collector-dev
        - name: RABBITMQ_DEFAULT_USER
          value: dev
        - name: RABBITMQ_DEFAULT_PASS
          value: dev
...
</code></pre>

<pre><code>$ cat kubernetes/coreservices/rabbitmq_service.yml
---
apiVersion: v1
kind: Service
metadata:
  name: rabbitmq
spec:
  type: NodePort
  selector:
    app: rabbitmq
  ports:
    - port: 5672
      targetPort: 5672
      name: amqp
    - port: 15672
      targetPort: 15672
      nodePort: 31672
      name: http
...
</code></pre>

<p>Then I apply these files </p>

<pre><code>$ kubectl apply -f kubernetes/coreservices/
pod/rabbitmq-pod created
service/rabbitmq created
</code></pre>

<p>It creates services and pods. I get the IP for <code>minikube</code> to access the management UI for the rabbitmq.</p>

<pre><code>$ minikube IP
127.0.0.1
</code></pre>

<p>When I try to access using <code>http://127.0.0.1:31672</code>, it gives no page found an error.</p>

Nilesh
<p>You need to run the command <code>minikube service rabbitmq</code>, and then for getting the URL <code>minikube service rabbitmq --url</code></p>
