RabbitMQ cluster on kubernetes with StatefulSets
UPDATE 3/18/2017: Improved the
postStart command based on further testing and refinement.
Since I couldn’t find a blog post showing how to do this, I told myself I should write one up once I figured it out. So here it is.
Kubernetes has a relatively new feature called StatefulSets that is designed to make it easier to run containerized services that are inherently stateful. And RabbitMQ is nothing if not inherently stateful. RabbitMQ clusters double down on the whole statefulness thing. After a few years of experience trying to force RabbitMQ clusters into stateless container infrastructure, I was curious to try embracing the statefulness instead. Paint with the grain and all that.
The first step is you need a kubernetes (k8s) cluster. If you don’t already have one, minikube is a good option to get started on your local dev machine.
Once you have a working k8s cluster and can talk to
Continue reading →