Skip to content
A Kubernetes Operator for RabbitMQ
Branch: master
Clone or download
bfink13 Merge pull request #34 from indeedeng/issue-33
Fixes #33 Pull Docker operations into a shell script
Latest commit 08252c5 Apr 24, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs #18 Mention default value in documentation. Apr 8, 2019
examples Merge pull request #24 from indeedeng/issue-11 Apr 9, 2019
gradle/wrapper Initial commit Mar 26, 2019
rabbitmq-operator-model Fix typo. Apr 15, 2019
rabbitmq-operator #33 Pull Docker operations into a shell script Apr 23, 2019
scripts #10 Refactor user management into the cluster custom resource. Refact… Apr 5, 2019
.gitignore Initial commit Mar 26, 2019
.travis.yml Add encrypted docker creds to travis file. Push to docker when a tag … Apr 1, 2019
CODE_OF_CONDUCT.md Fix code of conduct contact email Mar 27, 2019
CONTRIBUTING.md Verify functionality with default storage class and update docs accor… Apr 4, 2019
LICENSE Add CODE_OF_CONDUCT.md and link it in the README along with LICENSE Mar 27, 2019
OSSMETADATA
README.md
gradle.properties #25 Changes to enable internal publication of model module to Maven C… Apr 8, 2019
gradlew Initial commit Mar 26, 2019
gradlew.bat Initial commit Mar 26, 2019
release.sh #25 Remove extra whitespace that snuck in. Apr 9, 2019
settings.gradle #25 Build operator as well. Apr 8, 2019

README.md

Operator for RabbitMQ

Overview

Status: Pre-alpha! Not for production use! Breaking changes can appear at anytime without notice!

Build Status NetflixOSS Lifecycle

Provision and manage RabbitMQ clusters on Kubernetes! This operator currently has the following features:

  • Deploy N-node RabbitMQ clusters, utilizing auto-discovery for automatic clustering
  • Scale cluster replicas, storage, and CPU
  • Specify persistent volume storage class
  • Expose clusters to external clients using a LoadBalancer
  • Datadog auto-discovery annotations
  • Safely resolve network partitions without dropping messages (experimental, requires manual custom resource creation)

Getting Started

Prerequisites

You must have a Kubernetes cluster. Standard Pod and Service networking must work.

The example assumes you have Rook-managed storage deployed. You can read about Rook at https://rook.io/.

Deploying the operator

Apply the operator configuration yaml. You should see a rabbitmq-operator pod spin up in the rabbitmqs namespace.

kubectl apply -f examples/rabbitmq_operator.yaml

Deploying a cluster

Apply the example RabbitMQCustomResource. By default, this deploys a cluster with 3 instances in the rabbitmqs namespace.

kubectl apply -f examples/rabbitmq_instance.yaml

Connecting to the cluster

For each cluster, a service called <cluster name>-svc will be created. This is a standard (non-headless) service. Nodes will be added to the relevant Endpoints as soon as their healthcheck returns ok. A cluster named myrabbitmq in namespace rabbitmqs can be internally accessed at myrabbitmq.rabbitmqs.svc.cluster.local. Standard RabbitMQ ports are exposed.

To access a RabbitMQ cluster from outside the Kubernetes cluster, you need to either expose the Rabbit cluster using a NodePort or set createLoadBalancer to true. This will provision a LoadBalancer service with name <cluster-name>-svc-lb (assuming your environment supports it). You can then access your cluster using the LoadBalancer IP and standard RabbitMQ ports.

For more information on Service DNS and routing, see https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/.

Custom Resource Schema

RabbitMQCustomResource spec - example

Field Type Description
rabbitMQImage string Name of RabbitMQ image
initContainerImage string Name of initContainer image
createLoadBalancer boolean Whether to create a LoadBalancer service
preserveOrphanPVCs boolean When scaling down a cluster, whether to preserve "orphaned" PVCs; this field is optional and defaults to false
replicas number Number of cluster nodes
compute.cpuRequest string CPU request per node, ex: "500m"
compute.memory string Memory request per node, ex: "512Mi"
storage.storageClassName string Storage class to use for persistent storage (immutable)
storage.limit string PersistentVolume size per cluster node (immutable)
clusterSpec.highWatermarkFraction string RabbitMQ high watermark, ex: 0.4

Note: Scaling replicas down is a dangerous operation. The operator does not currently make any safety guarantees when scaling down replicas.

Roadmap

This operator is very much a work-in-progress. Features that we want to implement in the near future include:

  • Shovel configuration
  • Policy configuration
  • Improvements to user management

Code of Conduct

Operator for RabbitMQ is governed by the Contributor Covenant v 1.4.1.

License

Operator for RabbitMQ is licensed under the Apache 2 License.

You can’t perform that action at this time.