diff --git a/stable/rabbitmq/Chart.yaml b/stable/rabbitmq/Chart.yaml index 1177796c06..4365b090c0 100644 --- a/stable/rabbitmq/Chart.yaml +++ b/stable/rabbitmq/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: rabbitmq -version: 6.16.3 +version: 6.16.4 appVersion: 3.8.2 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 23e0bd026a..d36dfae042 100644 --- a/stable/rabbitmq/README.md +++ b/stable/rabbitmq/README.md @@ -70,6 +70,7 @@ The following table lists the configurable parameters of the RabbitMQ chart and | `rabbitmq.extraPlugins` | Extra plugings to enable | `nil` | | `rabbitmq.clustering.address_type` | Switch clustering mode | `ip` or `hostname` | | `rabbitmq.clustering.k8s_domain` | Customize internal k8s cluster domain | `cluster.local` | +| `rabbitmq.clustering.rebalance` | Rebalance master for queues in cluster when new replica is created | `false` | | `rabbitmq.logs` | Value for the RABBITMQ_LOGS environment variable | `-` | | `rabbitmq.setUlimitNofiles` | Specify if max file descriptor limit should be set | `true` | | `rabbitmq.ulimitNofiles` | Max File Descriptor limit | `65536` | @@ -164,6 +165,7 @@ The following table lists the configurable parameters of the RabbitMQ chart and | `metrics.serviceMonitor.relabellings` | Specify Metric Relabellings to add to the scrape endpoint | `nil` | | `metrics.serviceMonitor.honorLabels` | honorLabels chooses the metric's labels on collisions with target labels. | `false` | | `metrics.serviceMonitor.additionalLabels` | Used to pass Labels that are required by the Installed Prometheus Operator | `{}` | +| `metrics.serviceMonitor.release` | Used to pass Labels release that sometimes should be custom for Prometheus Operator | `nil` | | `metrics.port ` | Prometheus metrics exporter port | `9419` | | `metrics.env` | Exporter [configuration environment variables](https://github.com/kbudde/rabbitmq_exporter#configuration) | `{}` | | `metrics.resources` | Exporter resource requests/limit | `nil` | diff --git a/stable/rabbitmq/templates/servicemonitor.yaml b/stable/rabbitmq/templates/servicemonitor.yaml index 8ec0d2ef3c..0b556f6e96 100644 --- a/stable/rabbitmq/templates/servicemonitor.yaml +++ b/stable/rabbitmq/templates/servicemonitor.yaml @@ -10,7 +10,7 @@ metadata: app: {{ template "rabbitmq.name" . }} chart: {{ template "rabbitmq.chart" . }} heritage: "{{ .Release.Service }}" - release: "{{ .Release.Name }}" + release: {{ if .Values.metrics.serviceMonitor.release }}"{{ .Values.metrics.serviceMonitor.release }}"{{ else }}"{{ .Release.Name }}"{{ end }} {{- if .Values.metrics.serviceMonitor.additionalLabels }} {{ toYaml .Values.metrics.serviceMonitor.additionalLabels | indent 4 }} {{- end }} diff --git a/stable/rabbitmq/templates/statefulset.yaml b/stable/rabbitmq/templates/statefulset.yaml index 64725b65be..af907d9f88 100644 --- a/stable/rabbitmq/templates/statefulset.yaml +++ b/stable/rabbitmq/templates/statefulset.yaml @@ -167,6 +167,16 @@ spec: failureThreshold: {{ .Values.readinessProbe.failureThreshold }} successThreshold: {{ .Values.readinessProbe.successThreshold }} {{- end }} + {{- if and (gt .Values.replicas 1.0) ( eq .Values.rabbitmq.clustering.rebalance true) }} + lifecycle: + postStart: + exec: + command: + - /bin/sh + - -c + - until rabbitmqctl cluster_status >/dev/null; do echo Waiting for + cluster readiness...; sleep 5 ; done; rabbitmq-queues rebalance "all" + {{- end }} env: - name: BITNAMI_DEBUG value: {{ ternary "true" "false" .Values.image.debug | quote }} diff --git a/stable/rabbitmq/values-production.yaml b/stable/rabbitmq/values-production.yaml index ab6ce42ba8..3936b436bb 100644 --- a/stable/rabbitmq/values-production.yaml +++ b/stable/rabbitmq/values-production.yaml @@ -114,6 +114,9 @@ rabbitmq: clustering: address_type: hostname k8s_domain: cluster.local + ## Rebalance master for queues in cluster when new replica is created + ## ref: https://www.rabbitmq.com/rabbitmq-queues.8.html#rebalance + rebalance: false loadDefinition: enabled: false @@ -453,6 +456,8 @@ metrics: # relabellings: ## Specify honorLabels parameter to add the scrape endpoint honorLabels: false + ## Specify the release for ServiceMonitor. Sometimes it should be custom for prometheus operator to work + # release: "" ## Used to pass Labels that are used by the Prometheus installed in your cluster to select Service Monitors to work with ## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#prometheusspec additionalLabels: {} diff --git a/stable/rabbitmq/values.yaml b/stable/rabbitmq/values.yaml index ff2f45f081..b660134272 100644 --- a/stable/rabbitmq/values.yaml +++ b/stable/rabbitmq/values.yaml @@ -114,6 +114,9 @@ rabbitmq: clustering: address_type: hostname k8s_domain: cluster.local + ## Rebalance master for queues in cluster when new replica is created + ## ref: https://www.rabbitmq.com/rabbitmq-queues.8.html#rebalance + rebalance: false loadDefinition: enabled: false @@ -434,6 +437,8 @@ metrics: # relabellings: ## Specify honorLabels parameter to add the scrape endpoint honorLabels: false + ## Specify the release for ServiceMonitor. Sometimes it should be custom for prometheus operator to work + # release: "" ## Used to pass Labels that are used by the Prometheus installed in your cluster to select Service Monitors to work with ## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#prometheusspec additionalLabels: {}