diff --git a/stable/rabbitmq/Chart.yaml b/stable/rabbitmq/Chart.yaml index 43fba54673..f454347e96 100644 --- a/stable/rabbitmq/Chart.yaml +++ b/stable/rabbitmq/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: rabbitmq -version: 4.5.0 +version: 4.6.0 appVersion: 3.7.13 description: Open source message broker software that implements the Advanced Message Queuing Protocol (AMQP) keywords: diff --git a/stable/rabbitmq/README.md b/stable/rabbitmq/README.md index 437561f995..ed5fdd886c 100644 --- a/stable/rabbitmq/README.md +++ b/stable/rabbitmq/README.md @@ -130,6 +130,32 @@ $ helm install --name my-release -f values.yaml stable/rabbitmq > **Tip**: You can use the default [values.yaml](values.yaml) +### Load Definitions +It is possible to [load a RabbitMQ definitions file to configure RabbitMQ](http://www.rabbitmq.com/management.html#load-definitions). Because definitions may contain RabbitMQ credentials, [store the JSON as a Kubernetes secret](https://kubernetes.io/docs/concepts/configuration/secret/#using-secrets-as-files-from-a-pod). Within the secret's data, choose a key name that corresponds with the desired load definitions filename (i.e. `load_definition.json`) and use the JSON object as the value. For example: + +```yaml +apiVersion: v1 +kind: Secret +metadata: + name: rabbitmq-load-definition +type: Opaque +stringData: + load_definition.json: |- + { + "vhosts": [ + { + "name": "/" + } + ] + } +``` + +Then, specify the `management.load_definitions` property as an `extraConfiguration` pointing to the load definition file path within the container (i.e. `/app/load_definition.json`) and set `loadDefinition.enable` to `true`. + +Any load definitions specified will be available within in the container at `/app`. + +> Loading a definition will take precedence over any configuration done through [Helm values](#configuration). + ## Production configuration A standard configuration is provided by default that will run on most development environments. To operate this chart in a production environment, we recommend you use the alternative file values-production.yaml provided in this repository. diff --git a/stable/rabbitmq/templates/configuration.yaml b/stable/rabbitmq/templates/configuration.yaml index 24ded9399e..afc268a4d1 100644 --- a/stable/rabbitmq/templates/configuration.yaml +++ b/stable/rabbitmq/templates/configuration.yaml @@ -16,4 +16,3 @@ data: default_pass=CHANGEME {{ .Values.rabbitmq.configuration | indent 4 }} {{ .Values.rabbitmq.extraConfiguration | indent 4 }} - diff --git a/stable/rabbitmq/templates/statefulset.yaml b/stable/rabbitmq/templates/statefulset.yaml index 2cf8870149..042fc68a0d 100644 --- a/stable/rabbitmq/templates/statefulset.yaml +++ b/stable/rabbitmq/templates/statefulset.yaml @@ -82,6 +82,11 @@ spec: mountPath: /opt/bitnami/rabbitmq/conf - name: data mountPath: /opt/bitnami/rabbitmq/var/lib/rabbitmq/ + {{- if .Values.rabbitmq.loadDefinition.enabled }} + - name: load-definition-volume + mountPath: /app + readOnly: true + {{- end }} ports: - name: epmd containerPort: 4369 @@ -204,6 +209,11 @@ spec: path: rabbitmq.conf - key: enabled_plugins path: enabled_plugins + {{- if .Values.rabbitmq.loadDefinition.enabled }} + - name: load-definition-volume + secret: + secretName: {{ .Values.rabbitmq.loadDefinition.secretName | quote }} + {{- end }} {{- if not .Values.persistence.enabled }} - name: data emptyDir: {} diff --git a/stable/rabbitmq/values-production.yaml b/stable/rabbitmq/values-production.yaml index b925f31d98..88c98c3c38 100644 --- a/stable/rabbitmq/values-production.yaml +++ b/stable/rabbitmq/values-production.yaml @@ -74,6 +74,10 @@ rabbitmq: address_type: ip k8s_domain: cluster.local + loadDefinition: + enabled: false + secretName: load-definition + ## Configuration file content: required cluster configuration ## Do not override unless you know what you are doing. To add more configuration, use `extraConfiguration` instead configuration: |- @@ -92,6 +96,7 @@ rabbitmq: ## Use this instead of `configuration` to add more configuration extraConfiguration: |- #disk_free_limit.absolute = 50MB + #management.load_definitions = /app/load_definition.json ## Kubernetes service type service: diff --git a/stable/rabbitmq/values.yaml b/stable/rabbitmq/values.yaml index 1b993575ed..da0b6bd46d 100644 --- a/stable/rabbitmq/values.yaml +++ b/stable/rabbitmq/values.yaml @@ -74,6 +74,10 @@ rabbitmq: address_type: ip k8s_domain: cluster.local + loadDefinition: + enabled: false + secretName: load-definition + ## Configuration file content: required cluster configuration ## Do not override unless you know what you are doing. To add more configuration, use `extraConfiguration` instead configuration: |- @@ -92,6 +96,7 @@ rabbitmq: ## Use this instead of `configuration` to add more configuration extraConfiguration: |- #disk_free_limit.absolute = 50MB + #management.load_definitions = /app/load_definition.json ## Kubernetes service type service: