rabbitmq

by CloudPirates

Helm chartv0.21.34App 4.4.0Verified publisher

A messaging broker that implements the Advanced Message Queuing Protocol (AMQP)

About this chart

RabbitMQ

A Helm chart for RabbitMQ - A messaging broker that implements the Advanced Message Queuing Protocol (AMQP). RabbitMQ is a reliable, feature-rich message broker that supports multiple messaging patterns and is widely used for building distributed systems, microservices communication, and event-driven architectures.

Prerequisites

  • Kubernetes 1.24+
  • Helm 3.2.0+
  • PV provisioner support in the underlying infrastructure (if persistence is enabled)

Installing the Chart

To install the chart with the release name my-rabbitmq:

$ helm install my-rabbitmq oci://registry-1.docker.io/cloudpirates/rabbitmq

Or install directly from the local chart:

$ helm install my-rabbitmq ./charts/rabbitmq

The command deploys RabbitMQ on the Kubernetes cluster in the default configuration. The Configuration section lists the parameters that can be configured during installation.

Upgrading the Chart

For HA setups the erlang-cookie is used to join nodes to the cluster. If no erlang-cookie is set, a random one is generated with each chart update and restarted pods wont be able to rejoin the cluster with the new erlang-cookie.

For existing installations this can be fixed after an update by getting the current erlang-cookie from the ENV-Vars, inside the still running old pods and replacing the newly generated erlang-cookie in the k8s secret with the old one.

Uninstalling the Chart

To uninstall/delete the my-rabbitmq deployment:

$ helm uninstall my-rabbitmq

The command removes all the Kubernetes components associated with the chart and deletes the release.

Important: By default, PersistentVolumeClaims (PVCs) are NOT deleted when you uninstall the chart. This is intentional to prevent accidental data loss. If you reinstall the chart with different passwords or Erlang cookies, you may encounter authentication issues because the old data persists.

Cleaning up PersistentVolumeClaims

To manually delete the PVCs after uninstalling:

$ kubectl delete pvc -l app.kubernetes.io/instance=my-rabbitmq

Alternatively, you can enable automatic PVC deletion by configuring the persistentVolumeClaimRetentionPolicy before installation:

persistentVolumeClaimRetentionPolicy:
  enabled: true
  whenDeleted: Delete  # Automatically delete PVCs when StatefulSet is deleted
  whenScaled: Delete   # Automatically delete PVCs when scaling down

See the Persistent Volume Claim Retention Policy section for more details.

Security & Signature Verification

This Helm chart is cryptographically signed with Cosign to ensure authenticity and prevent tampering.

Public Key:

-----BEGIN PUBLIC KEY-----
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE5U+rM2d3hDjgP5T3cLShuuQIU9vR
Z4/G+Nug6q5vRa+C3qUA1wXjbaJFAfcIrv5VjmYAYOj13shnPpp3Zh4fnQ==
-----END PUBLIC KEY-----

To verify the helm chart before installation, copy the public key to the file cosign.pub and run cosign:

cosign verify --key cosign.pub registry-1.docker.io/cloudpirates/rabbitmq:<version>

Configuration

The following table lists the configurable parameters of the RabbitMQ chart and their default values.

Global parameters

ParameterDescriptionDefault
global.imageRegistryGlobal Docker image registry""
global.imagePullSecretsGlobal Docker registry secret names as an array[]

Common parameters

ParameterDescriptionDefault
nameOverrideString to partially override rabbitmq.fullname""
fullnameOverrideString to fully override rabbitmq.fullname""
namespaceOverrideString to override the namespace for all resources""
commonLabelsLabels to add to all deployed objects{}
commonAnnotationsAnnotations to add to all deployed objects{}
clusterDomainKubernetes cluster domaincluster.local

RabbitMQ image parameters

ParameterDescriptionDefault
image.registryRabbitMQ image registrydocker.io
image.repositoryRabbitMQ image repositoryrabbitmq
image.tagRabbitMQ image tag"4.2.0-management@sha256:23676732c0b7bb978c0837c150492222d5b23ff079fc2025b537f4ce5c013d98"
image.imagePullPolicyRabbitMQ image pull policyAlways

Deployment configuration

ParameterDescriptionDefault
replicaCountNumber of RabbitMQ replicas to deploy (clustering needs to be enabled to set more than 1 replicas)1
revisionHistoryLimitNumber of revisions to keep in history for rollback (set to 0 for unlimited)10
podManagementPolicyStatefulSet pod management policyOrderedReady
terminationGracePeriodSecondsTime for Kubernetes to wait for the pod to gracefully terminate30

StatefulSet & Pod metadata

ParameterDescriptionDefault
statefulsetLabelsLabels to attach to StatefulSet{}
podLabelsLabels to attach to pods{}
podAnnotationsAnnotations to attach to pods{}
statefulsetAnnotationsAnnotations for StatefulSet{}

RabbitMQ Definitions

ParameterDescriptionDefault
definitions.enabledEnable loading of RabbitMQ definitions on startup. When true, definitions will be loaded at container boot.false
definitions.existingConfigMapName of an existing ConfigMap containing RabbitMQ definitions (e.g., created via kubectl create configmap rmq-defs --from-file=defs.json).""
definitions.existingConfigMapKeyKey in the existing ConfigMap containing the RabbitMQ definitions JSON file.defs.json
defintions.existingSecretName of an existing Secret containing RabbitMQ definitions.""
definitions.existingSecretKeyKey in the existing Secret containing the RabbitMQ definitions JSON file.defs.json
definitions.usersArray of RabbitMQ users to create.[]
definitions.vhostsArray of RabbitMQ virtual hosts to create.[]
definitions.permissionsArray of RabbitMQ permissions to set per vhost.[]
definitions.queuesArray of RabbitMQ queues to create.[]
definitions.exchangesArray of RabbitMQ exchanges to create.[]
definitions.bindingsArray of RabbitMQ bindings to create.[]
definitions.parametersArray of RabbitMQ parameters to create.[]
definitions.global_parametersArray of RabbitMQ global parameters to create.[]
definitions.topic_permissionsArray of RabbitMQ topic permissions to create.[]
definitions.policiesArray of RabbitMQ policies to create.[]

Automatic Configuration Reloading

The chart supports automatic reloading of definitions when the ConfigMap or Secret changes, without requiring a pod restart or Helm upgrade.

ParameterDescriptionDefault
definitions.autoReload.enabledEnable sidecar container to watch for ConfigMap/Secret changesfalse
definitions.autoReload.image.registryContainer image registry for the config watcher sidecardocker.io
definitions.autoReload.image.repositoryContainer image repository for the config watcher sidecarcurlimages/curl
definitions.autoReload.image.tagContainer image tag for the config watcher sidecar8.11.1
definitions.autoReload.image.pullPolicyContainer image pull policy for the config watcher sidecarIfNotPresent
definitions.autoReload.resourcesResource limits and requests for the config watcher sidecar{}

How it works:

When enabled, a lightweight sidecar container runs alongside RabbitMQ and:

  1. Monitors the definitions file for changes (using checksum comparison)
  2. Automatically reloads definitions via RabbitMQ Management API when changes are detected
  3. Checks for changes every 10 seconds

Example:

definitions:
  enabled: true
  existingConfigMap: my-rabbitmq-definitions
  autoReload:
    enabled: true

After deployment, you can update your ConfigMap:

kubectl edit configmap my-rabbitmq-definitions -n <namespace>
# The sidecar will automatically detect and reload the new configuration

Service configuration

ParameterDescriptionDefault
service.typeKubernetes service typeClusterIP
service.amqpPortRabbitMQ AMQP service port5672
service.managementPortRabbitMQ management UI port15672
service.epmdPortRabbitMQ EPMD port4369
service.distPortRabbitMQ distribution port25672
service.annotationsKubernetes service annotations{}
service.annotationsHeadlessKubernetes service annotationsHeadless25672
service.trafficDistributionTraffic distribution policy for the service""
service.externalTrafficPolicyExternal Traffic Policy for the serviceCluster
service.allocateLoadBalancerNodePortsWhether to allocate NodePorts for service type LoadBalancertrue

RabbitMQ Authentication

ParameterDescriptionDefault
auth.enabledEnable RabbitMQ authe

Deploy rabbitmq with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has rabbitmq on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartrabbitmq is pinned at v0.21.34 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply