[bitnami/rabbitmq] Add support for defining cluster name (#21621)

This commit is contained in:
Juan Ariza Toledano
2023-12-19 10:20:56 +01:00
committed by GitHub
parent 632993671a
commit c50a384e40
4 changed files with 13 additions and 8 deletions

View File

@@ -30,4 +30,4 @@ maintainers:
name: rabbitmq
sources:
- https://github.com/bitnami/charts/tree/main/bitnami/rabbitmq
version: 12.5.7
version: 12.6.0

View File

@@ -126,6 +126,7 @@ The command removes all the Kubernetes components associated with the chart and
| `communityPlugins` | List of Community plugins (URLs) to be downloaded during container initialization | `""` |
| `extraPlugins` | Extra plugins to enable (single string containing a space-separated list) | `rabbitmq_auth_backend_ldap` |
| `clustering.enabled` | Enable RabbitMQ clustering | `true` |
| `clustering.name` | RabbitMQ cluster name | `""` |
| `clustering.addressType` | Switch clustering mode. Either `ip` or `hostname` | `hostname` |
| `clustering.rebalance` | Rebalance master for queues in cluster when new replica is created | `false` |
| `clustering.forceBoot` | Force boot of an unexpectedly shut down cluster (in an unexpected order). | `false` |

View File

@@ -172,10 +172,7 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: K8S_SERVICE_NAME
value: {{ printf "%s-%s" (include "common.names.fullname" .) (default "headless" .Values.servicenameOverride) }}
- name: K8S_ADDRESS_TYPE
value: {{ .Values.clustering.addressType }}
{{- $svcName := printf "%s-%s" (include "common.names.fullname" .) (default "headless" .Values.servicenameOverride) }}
{{- if .Values.featureFlags }}
- name: RABBITMQ_FEATURE_FLAGS
value: {{ .Values.featureFlags }}
@@ -184,9 +181,7 @@ spec:
value: {{ ternary "yes" "no" .Values.clustering.forceBoot | quote }}
{{- if (eq "hostname" .Values.clustering.addressType) }}
- name: RABBITMQ_NODE_NAME
value: "rabbit@$(MY_POD_NAME).$(K8S_SERVICE_NAME).$(MY_POD_NAMESPACE).svc.{{ .Values.clusterDomain }}"
- name: K8S_HOSTNAME_SUFFIX
value: ".$(K8S_SERVICE_NAME).$(MY_POD_NAMESPACE).svc.{{ .Values.clusterDomain }}"
value: "rabbit@$(MY_POD_NAME).{{ $svcName }}.$(MY_POD_NAMESPACE).svc.{{ .Values.clusterDomain }}"
{{- else }}
- name: RABBITMQ_NODE_NAME
value: "rabbit@$(MY_POD_NAME)"

View File

@@ -253,6 +253,10 @@ clustering:
## @param clustering.enabled Enable RabbitMQ clustering
##
enabled: true
## @param clustering.name RabbitMQ cluster name
## If not set, a name is generated using the common.names.fullname template
##
name: ""
## @param clustering.addressType Switch clustering mode. Either `ip` or `hostname`
##
addressType: hostname
@@ -390,8 +394,13 @@ configuration: |-
{{- if .Values.clustering.enabled }}
## Clustering
##
cluster_name = {{ default (include "common.names.fullname" .) .Values.clustering.name }}
cluster_formation.peer_discovery_backend = rabbit_peer_discovery_k8s
cluster_formation.k8s.host = kubernetes.default
cluster_formation.k8s.address_type = {{ .Values.clustering.addressType }}
{{- $svcName := printf "%s-%s" (include "common.names.fullname" .) (default "headless" .Values.servicenameOverride) }}
cluster_formation.k8s.service_name = {{ $svcName }}
cluster_formation.k8s.hostname_suffix = .{{ $svcName }}.{{ include "common.names.namespace" . }}.svc.{{ .Values.clusterDomain }}
cluster_formation.node_cleanup.interval = 10
cluster_formation.node_cleanup.only_log_warning = true
cluster_partition_handling = {{ .Values.clustering.partitionHandling }}