diff --git a/charts/rabbitmq/README.md b/charts/rabbitmq/README.md index 130c109d87d55f25868fb1a619d4d78d6f886fb9..12ff0ac0e1a76e64f94b5fb30f6cd2579c75755d 100644 --- a/charts/rabbitmq/README.md +++ b/charts/rabbitmq/README.md @@ -1,6 +1,6 @@ # RabbitMQ -   +   ## Changelog @@ -153,6 +153,7 @@ Section to define custom services | authentication.password | string | `"guest"` | Initial password | | authentication.erlangCookie | string | `nil` | Erlang cookie (MANDATORY) (Alternative: Set the environment variable ERLANG_COOKIE) | | clustering.rebalance | bool | `false` | Enable rebalance queues with master when new replica is created | +| clustering.forceBoot | bool | `false` | Force boot in case cluster peers are not available | | clustering.useLongName | bool | `true` | Use FQDN for RabbitMQ node names | ## RabbitMQ memory parameters diff --git a/charts/rabbitmq/RELEASENOTES.md b/charts/rabbitmq/RELEASENOTES.md index 9208a217df9441cdf7484ca15690ce99a79d71ff..e2ab20a23f0565476f203a36774d9c595d84e856 100644 --- a/charts/rabbitmq/RELEASENOTES.md +++ b/charts/rabbitmq/RELEASENOTES.md @@ -29,4 +29,5 @@ | 0.5.2 | 3.10.2 | Upgraded to RabbitMQ 3.10.2 | | 0.5.3 | 3.10.4 | Upgraded to RabbitMQ 3.10.4 | | 0.5.4 | 3.10.5 | Upgraded to RabbitMQ 3.10.5 | +| 0.5.5 | 3.10.5 | Added force_boot option during cluster redeployment | | | | | diff --git a/charts/rabbitmq/templates/scripts.yaml b/charts/rabbitmq/templates/scripts.yaml index 42f2984ca5d11d5e4b61ec12c4f1a7b9de5465a4..241eb1e9cde67182e588af112cb2e92bf60d4688 100644 --- a/charts/rabbitmq/templates/scripts.yaml +++ b/charts/rabbitmq/templates/scripts.yaml @@ -34,12 +34,18 @@ data: chmod 600 /var/lib/rabbitmq/.erlang.cookie echo "Finished." startup.sh: | + {{- if .Values.clustering.forceBoot }} + echo "Forcing boot of cluster instance" >/proc/1/fd/1 + rabbitmqctl force_boot + {{- end }} + {{- if .Values.clustering.rebalance }} until rabbitmqctl cluster_status >/dev/null; do echo "PostStart: Waiting for cluster readiness..." >/proc/1/fd/1 sleep 5 done echo "PostStart: Rebalancing all queues.." >/proc/1/fd/1 rabbitmq-queues rebalance "all" >/proc/1/fd/1 + {{- end }} shutdown.sh: | {{- if and (.Values.terminationGracePeriodSeconds) (gt (int .Values.terminationGracePeriodSeconds) 10) }} if rabbitmqctl cluster_status; then diff --git a/charts/rabbitmq/templates/statefulset.yaml b/charts/rabbitmq/templates/statefulset.yaml index d65e7725b6b4a5071eecfd317c6378013dd20dd6..bdd289e8a45fe337a3974cee0e122c90b75ee3fa 100644 --- a/charts/rabbitmq/templates/statefulset.yaml +++ b/charts/rabbitmq/templates/statefulset.yaml @@ -174,7 +174,7 @@ spec: {{- toYaml . | nindent 12 }} {{- end }} lifecycle: - {{- if and .Values.clustering.rebalance (gt (.Values.replicaCount | int) 1) }} + {{- if gt (.Values.replicaCount | int) 1 }} postStart: exec: command: diff --git a/charts/rabbitmq/values.yaml b/charts/rabbitmq/values.yaml index 3916bbbd9d25fef129c5982018681a62d0845870..b71a91aa9cfc1b7d6614696691f86d860702cf5f 100644 --- a/charts/rabbitmq/values.yaml +++ b/charts/rabbitmq/values.yaml @@ -330,6 +330,8 @@ extraSecretAdvancedConfigs: clustering: ## Rebalance queues with master when new replica is created rebalance: false + ## Force boot in case cluster peers are not available + forceBoot: false ## Use FQDN for RabbitMQ node names useLongName: true