how to setup basic rabbitmq on kubernetes
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.
Introduction
The easiest way to get a basic RabbitMQ deployment running on Kubernetes is to use a maintained Helm chart. That gives you a working broker, a service, credentials, optional persistence, and a management UI without hand-writing every manifest from scratch.
What "Basic Setup" Should Include
Even a simple RabbitMQ deployment on Kubernetes should usually have:
- a dedicated namespace or clear release name
- a stable service for clients
- persistent storage if messages must survive pod restarts
- credentials managed as Kubernetes secrets
For a local experiment you can relax some of those, but for anything beyond a demo, persistence and secret management matter immediately.
Install With Helm
Start by adding the chart repository and installing RabbitMQ:
That creates the core Kubernetes objects and generates a default username and password stored in a secret.
Retrieve the Credentials
After installation, fetch the generated password:
The default username for this style of setup is often user, but always confirm with the chart output or values you provided.
Access the Management UI
For a quick test, use port forwarding to reach the management interface:
Then open:
This is fine for development. In production, expose the UI deliberately through ingress or a secure internal access path rather than leaving it casually reachable.
Add Persistence
If the broker restarts and you care about message durability, enable persistence with a values file.
Install or upgrade with that file:
This is a much better baseline than a purely ephemeral broker if your workloads are more than disposable tests.
Verify the Pod and Service
Check that the pod is running and the service exists:
You want the pod in Running state and the service exposing the AMQP port, typically 5672, plus the management port if enabled.
Test a Client Connection
Once the broker is reachable, connect with an AMQP client or a test program. A simple Python example with pika looks like this:
If you are running the client outside the cluster, combine this with kubectl port-forward or expose the service appropriately.
What to Improve After the First Deployment
A "basic" RabbitMQ on Kubernetes setup is usually just the start. Once the broker works, the next decisions are:
- whether to use a StatefulSet-based clustered setup
- how to expose clients inside and outside the cluster
- resource requests and limits
- backup and upgrade strategy
- policies for queues, TTL, and dead lettering
You do not need all of that to begin, but you do need to know that a single Helm install is not a full production architecture by itself.
Common Pitfalls
The biggest mistake is deploying RabbitMQ without persistence and then being surprised when messages disappear after a pod restart.
Another issue is exposing the broker or management UI too casually. Kubernetes makes port exposure easy, but it does not make it safe by default.
Developers also forget to retrieve the generated credentials and assume anonymous access will work. Most maintained charts do not leave the broker open.
Finally, do not confuse "pod is running" with "RabbitMQ is ready for your workload." Always verify connectivity through a real client connection.
Summary
- Helm is the fastest path to a basic RabbitMQ deployment on Kubernetes.
- Retrieve the generated credentials from the Kubernetes secret after install.
- Use port forwarding for quick local access to the management UI.
- Enable persistence if you care about durability across pod restarts.
- Treat the first working deployment as a baseline, not the end of production design.
Related reading
- How to setup kafka transactional producer
- How to setup multiple topics in a RabbitMQ Java config class using Spring Framework?
- How to shift back the offset of a topic within a stable Kafka consumer group?
- How to show continuous real time updates like facebook ticker, meetup.com home page does?
- How to setup Kubernetes NLB Load Balancer with target group IP based AWS?
- How to share a file from initContainer to base container in Kubernetes
- How to shutdown celery node
- How to skip corrupt (non-serializable) messages in Spring Kafka Consumer?

System Design Fundamentals
Build a strong foundation in designing scalable, reliable distributed systems.
View the courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.