RabbitMq on Kubernetes Cluster using Helm

Install using helm

kubectl create namespace rabbitmq
helm repo add bitnami https://charts.bitnami.com/bitnami
helm install myrmq bitnami/rabbitmq --namespace rabbitmq

Credentials

RabbitMQ can be accessed within the cluster on port `5672` at `myrmq-rabbitmq.rabbitmq.svc`.

Username : user

Password : kubectl get secret --namespace rabbitmq myrmq-rabbitmq -o jsonpath="{.data.rabbitmq-password}" | base64 --decode

ErLang Cookie : kubectl get secret --namespace rabbitmq myrmq-rabbitmq -o jsonpath="{.data.rabbitmq-erlang-cookie}" | base64 --decode

Test

# Run a debug pod
kubectl run -i --tty --rm debug --image=python:3.10-slim-bullseye --restart=Never -- bash
pip3 install pika# Type python for replpython

# Inside the repl
import pika
credentials = pika.PlainCredentials('user', '<password from credentials above>')
parameters = pika.ConnectionParameters('myrmq-rabbitmq.rabbitmq.svc',5672,'/',credentials)
connection = pika.BlockingConnection(parameters)
channel = connection.channel()
hello_q = channel.queue_declare(queue='hello')
hello_q.method.message_count
channel.basic_publish(exchange='',
routing_key='hello',
body='Hello W0rld!')
hello_q.method.message_count
connection.close()

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store