As with my previous blogs, we use a local docker desktop kubernetes set up and helm to install the capability.

Use helm to install rabbitmq onto K8s.

helm install — name rab — set auth.username=admin,auth.password=admin,metrics.enabled=true stable/rabbitmq

Fix the password to this (note: rabbitmq does not like short passwords, it will accept them in this setting but you won’t be able to login).

helm upgrade — set auth.username=admin,auth.password=secretpassword,metrics.enabled=true rab bitnami/rabbitmq

Otherwise the default username is user and the password can beobtained as follows:

echo “Password : $(kubectl get secret rab-rabbitmq -o jsonpath=”{.data.rabbitmq-password}” | base64 — decode)”

RabbitMQ can be accessed within the cluster on

rab-rabbitmq.default.svc.cluster.local

To access from outside the cluster, perform the following steps:

To access the RabbitMQ AMQP port:

kubectl port-forward svc/rab-rabbitmq 5672:5672

echo “URL : amqp://127.0.0.1:5672/”

To access the RabbitMQ management interface:

kubectl port-forward svc/rab-rabbitmq 15672:15672

http://127.0.0.1:15672/#/

Image for post

#kubernetes #spring-boot #rabbitmq

SpringBoot AMQP with RabbitMQ in Kubernetes
10.15 GEEK