rabbitmq

by kfirfer

Helm chartv0.7.21App 3.12.10

A Helm chart for a RabbitMQ cluster on Kubernetes

About this chart

RabbitMQ

A Helm chart for a RabbitMQ HA-cluster on Kubernetes

Changelog

see RELEASENOTES.md

⚠️ Please make sure all feature flags are enabled before upgrading to RabbitMQ 3.12.x

TL;DR

helm repo add groundhog2k https://groundhog2k.github.io/helm-charts/
helm install my-release groundhog2k/rabbitmq

Introduction

This chart uses the original RabbitMQ image from Docker Hub to deploy a stateful RabbitMQ cluster in Kubernetes.

It fully supports deployment of the multi-architecture docker image.

Prerequisites

  • Kubernetes 1.12+
  • Helm 3.x
  • PV provisioner support in the underlying infrastructure

Installing the Chart

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

helm install my-release groundhog2k/rabbitmq

Uninstalling the Chart

To uninstall/delete the my-release deployment:

helm uninstall my-release

Common parameters

KeyTypeDefaultDescription
fullnameOverridestring""Fully override the deployment name
nameOverridestring""Partially override the deployment name

Deployment parameters

KeyTypeDefaultDescription
image.pullPolicystring"IfNotPresent"Image pull policy
image.registrystring"docker.io"Image registry
image.repositorystring"rabbitmq"Image name
image.tagstring""Image tag
initImage.pullPolicystring"IfNotPresent"Init image pull policy
initImage.registrystring"docker.io"Image registry
initImage.repositorystring"busybox"Init image name
initImage.tagstring"latest"Init image tag
imagePullSecretslist[]Image pull secrets
extraInitContainerslist[]Extra init containers
extaContainerslist[]Extra containers for usage as sidecars
startupProbeobjectsee values.yamlStartup probe configuration
livenessProbeobjectsee values.yamlLiveness probe configuration
readinessProbeobjectsee values.yamlReadiness probe configuration
customStartupProbeobject{}Custom startup probe (overwrites default startup probe configuration)
customLivenessProbeobject{}Custom liveness probe (overwrites default liveness probe configuration)
customReadinessProbeobject{}Custom readiness probe (overwrites default readiness probe configuration)
initResourcesobject{}Resource limits and requests for the default init container
resourcesobject{}Resource limits and requests
nodeSelectorobject{}Deployment node selector
podAnnotationsobject{}Additional pod annotations
podSecurityContextobjectsee values.yamlPod security context
securityContextobjectsee values.yamlContainer security context
envlist[]Additional container environmment variables
argslist[]Additional container command arguments
terminationGracePeriodSecondsint60Container termination grace period in seconds
rbac.createbooltrueEnable creation of RBAC
serviceAccount.annotationsobject{}Additional service account annotations
serviceAccount.createbooltrueEnable service account creation
serviceAccount.namestring""Optional name of the service account
affinityobject{}Affinity for pod assignment
tolerationslist[]Tolerations for pod assignment
podManagementPolicystring"OrderedReady"Pod management policy
updateStrategyTypestring"RollingUpdate"Pod update strategy
replicaCountint1Number of replicas
revisionHistoryLimitintnilMaximum number of revisions maintained in revision history
podDisruptionBudgetobject{}Pod disruption budget
podDisruptionBudget.minAvailableintnilMinimum number of pods that must be available after eviction
podDisruptionBudget.maxUnavailableintnilMaximum number of pods that can be unavailable after eviction

Service parameters

KeyTypeDefaultDescription
service.typestring"ClusterIP"Service type
service.clusterIPstringnilThe cluster ip address (only relevant for type LoadBalancer or NodePort)
service.loadBalancerIPstringnilThe load balancer ip address (only relevant for type LoadBalancer)
service.amqp.portint5672AMQP service port
service.amqp.nodePortintnilService node port (only relevant for type LoadBalancer or NodePort)
service.amqps.portint5671Secure AMQP service port
service.amqps.nodePortintnilService node port (only relevant for type LoadBalancer or NodePort)
service.mgmt.portint15672Management UI service port
service.mgmt.nodePortintnilService node port (only relevant for type LoadBalancer or NodePort)
service.prometheus.portint15692Prometheus service port
service.prometheus.nodePortintnilService node port (only relevant for type LoadBalancer or NodePort)
service.annotationsobject{}Additional service annotations

Extra services parameters

Section to define custom services

KeyTypeDefaultDescription
extraServices[].namestringnilUnique name of the input service
extraServices[].typestringnilService type (ClusterIP / NodePort / LoadBalancer)
extraServices[].protocolstringnilProtocol type (TCP / UDP)
extraServices[].containerPortintnilContainer port
extraServices[].portintnilService port
extraServices[].nodePortintnilThe node port (only relevant for type LoadBalancer or NodePort)
extraServices[].clusterIPstringnilThe cluster ip address (only relevant for type LoadBalancer or NodePort)
extraServices[].loadBalancerIPstringnilThe load balancer ip address (only relevant for type LoadBalancer)
extraServices[].annotationsobject{}Additional service annotations

Service monitor parameters

KeyTypeDefaultDescription
serviceMonitor.enabledboolfalseEnable service monitor
serviceMonitor.additionalLabelsobject{}Additional labels for the service monitor object
serviceMonitor.annotationsobject{}Annotations for the service monitor object
serviceMonitor.intervalDurationnilScrape interval for prometheus
serviceMonitor.scrapeTimeoutDurationnilScrape timeout value
serviceMonitor.extraEndpointParametersobjectnilExtra parameters rendered to the service monitor endpoint
serviceMonitor.extraParametersobjectnilExtra parameters rendered to the service monitor object

Storage parameters

KeyTypeDefaultDescription
storage.accessModes[0]string"ReadWriteOnce"Storage access mode
storage.persistentVolumeClaimNamestringnilPVC name when existing storage volume should be used
storage.requestedSizestringnilSize for new PVC, when no existing PVC is used
storage.classNamestringnilStorage class name

Ingress parameters

KeyTypeDefaultDescription
ingress.enabledboolfalseEnable ingress for the Management UI service
ingress.annotationsstringnilAdditional annotations for ingress
ingress.hosts[0].host:string""Hostname for the ingress endpoint
ingress.hosts[0].host.paths[0]string"/"Path for the RabbitMQ Management UI
ingress.tlslist[]Ingress TLS parameters

Network policies

Allows to define optional network policies for ingress and egress The policyTypes will be automatically set

KeyTypeDefaultDescription
networkPolicy.ingressobject{}Ingress network policies
networkPolicy.egressobject{}Egress network policies

RabbitMQ base parameters

KeyTypeDefaultDescription
clusterDomainstring"cluster.local"Kubernetes cluster domain (DNS) suffix
pluginslist[]List of additional RabbitMQ plugins that should be activated (see: RabbitMQ plugins)
authentication.userstringnilInitial user name (guest) (Alternative: Set environment variable RABBITMQ_DEFAULT_USER)
authentication.passwordstringnilInitial password (guest) (Alternative: set environment variable RABBITMQ_DEFAULT_PASS)
authentication.erlangCookiestringnilErlang cookie (MANDATORY) (Alternative: Set the environment variable ERLANG_COOKIE)
clustering.rebalanceboolfalseEnable rebalance queues with master when new replica is created
clustering.forceBootboolfalseForce boot in case cluster peers are not available
clustering.useLongNamebooltrueUse FQDN for RabbitMQ node names

RabbitMQ memory parameters

KeyTypeDefaultDescription
options.memoryHighWatermark.enabledboolfalseEnables high memory watermark configuration
options.memoryHighWatermark.typestring"relative"Type of watermark value (relative or absolute)
options.memoryHighWatermark.valuefloat0.4Watermark value (default: 40%)
options.memoryHighWatermark.pagingRatiofloatnilPaging threshold when RabbitMQ starts paging queue content before high memory watermark is reached
options.memory.totalAvailableOverrideValueintnilOverwrites the value that is automatically calculated from resource.limits.memory
options.memory.calculationStrategystringnilStrategy for memory usage report (rss or allocated)

RabbitMQ communication and SSL parameters

KeyTypeDefaultDescription
options.tcp.portint5672AMQP tcp port
options.ssl.enabledboolfalseEnable secure AMQP (amqps) (see values.yaml for more details)
options.ssl.portint5671AMQPS tcp port
options.ssl.verifyboolfalseEnables or disables peer verification
options.ssl.failIfNoPeerCertboolfalseReject TLS connection when client fails to provide a certificate
options.ssl.depthintnilClient certificate verification depth
options.ssl.certPathsobject{}Pathes of the certificate files
options.ssl.certPaths.cacertstringnilPath to the CA certificate(s) file
options.ssl.certPaths.certstringnilPath to the server certificate file
options.ssl.certPaths.keystringnilPath to the private key file (Hint: ssl_options.password configuration needs to be provided as extraSecretConfig:)

RabbitMQ plugin base parameters

KeyTypeDefaultDescription
managementPlugin.enabledbooltrueEnable management UI plugin with default configuration
managementPlugin.tcp.portint15672Management UI port
prometheusPlugin.enabledbooltrueEnable prometheus monitoring plugin with default configuration
prometheusPlugin.tcp.portint15692Prometheus plugin TCP port
k8sPeerDiscoveryPlugin.enabledbooltrueEnable K8s peer discovery plugin for a RabbitMQ HA-cluster with default configuration
k8sPeerDiscoveryPlugin.addressTypestring"hostname"K8s peer discovery plugin address type (hostname or ip)

RabbitMQ custom configuration parameters

KeyTypeDefaultDescription
customConfigstringnilCustom inline configuration entries for rabbitmq.conf (see RabbitMQ config)
extraSecretConfigsstringnilAn existing secret with files that will be added to the rabbitmq.conf
customAdvancedConfigstringnilCustom inline advanced configuration entries for advanced.config (see RabbitMQ advanced config)
extraSecretAdvancedConfigsstringnilAn existing secret with files that will be added to the advanced.conf
extraEnvSecretslist[]A list of existing secrets that will be mounted into the container as environment variables
extraSecretslist[]A list of additional existing secrets that will be mounted into the container
extraSecrets[].namestringnilName of the existing Kubernetes secret
extraSecrets[].mountPathstringnilMount path where the secret should be mounted into the container (f.e. /mysecretfolder)

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.7.21 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