<p>I need to setup a basic rabbit mq instance (no cluster setup) without persistence or security requirements on a kubernetes cluster.</p>

<p>What I need:</p>

<p>Single rabbit mq pod running as stateful set with replicas = 1, and 
reach it from inside and outside of cluster via specific url (amgp port and mangement interface port)</p>

<p>What I don't need:</p>

<ul>
<li>persistence</li>
<li>security</li>
<li>cluster setup</li>
</ul>

<p>The helm charts I found so far are all adressing production setups with clustering, persistence and so on, but I don't need this stuff as I will use instance only for testing</p>

<p>This is what I have so far:</p>

<pre><code>apiVersion: v1
kind: Service
metadata:
  name: rs-rmq-mgt
spec:
  selector:
    app: rs-rmq
  ports:
  - protocol: TCP
    port: 1337
    targetPort: 15672
  type: NodePort
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: rs-rmq
spec:
  selector:
    matchLabels:
      app: rs-rmq
  serviceName: "rs-rmq"
  replicas: 1
  template:
    metadata:
      labels:
        app: rs-rmq
    spec:
      containers:
      - name: rs-rmq
        image: rabbitmq:management
        ports:
        - containerPort: 25672
        - containerPort: 5672
        - containerPort: 4369
        - containerPort: 15672
</code></pre>

<p>If you don't need more than a replica and persistent. You can go with a simple pod deployment rather than sts. <a href="https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/" rel="noreferrer">Please refer sts doc</a></p>

<pre><code>kubectl run rabbitmq --image=rabbitmq:management --expose --port=15672 --restart=Never
--dry-run -o yaml &gt; rabbitmq.yml
</code></pre>

<p>Edit the relevant container ports and create the pod.</p>

<pre><code>kubectl create -f rabbitmq.yml
</code></pre>

<p>Expose the service as NodePort. </p>

<pre><code>kubectl expose po rabbitmq --port 15672
</code></pre>

<p>Now, you can access it externally via </p>

<blockquote>
  <p>NodesIP:NodePort</p>
</blockquote>

<p>and internally by using,</p>

<blockquote>
  <p>[svc].[namespace].svc</p>
</blockquote>
