Skip to content

Commit

Permalink
[RabbitMQ] Add podManagementPolicy for cluster recovery. (helm#13027)
Browse files Browse the repository at this point in the history
rabbitmq should be initialized one by one when building cluster for the first time.
Therefore, the default value of podManagementPolicy is 'OrderedReady'

Once the rabbitmq participates in the cluster, it waits for a response from another
rabbitMQ in the same cluster at reboot, except the last rabbitmq of the same cluster.
If the cluster exits gracefully, you do not need to change the podManagementPolicy
because the first rabbitmq of the statefulset always will be last of the cluster.
However if the last rabbitmq of the cluster is not the first rabbitmq due to a failure,
you must change podManagementPolicy to 'Parallel'.
Otherwide the first rabbitmq waits Infinitely.

Signed-off-by: Jungsub Shin <[email protected]>
  • Loading branch information
ssup2 authored and devnulled committed Apr 25, 2019
1 parent 4b3b885 commit 6324ade
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion stable/rabbitmq/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v1
name: rabbitmq
version: 5.4.1
version: 5.5.0
appVersion: 3.7.14
description: Open source message broker software that implements the Advanced Message Queuing Protocol (AMQP)
keywords:
Expand Down
1 change: 1 addition & 0 deletions stable/rabbitmq/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ The following table lists the configurable parameters of the RabbitMQ chart and
| `image.pullSecrets` | Specify docker-registry secret names as an array | `nil` |
| `image.debug` | Specify if debug values should be set | `false` |
| `rbacEnabled` | Specify if rbac is enabled in your cluster | `true` |
| `podManagementPolicy` | Pod management policy | `OrderedReady` |
| `rabbitmq.username` | RabbitMQ application username | `user` |
| `rabbitmq.password` | RabbitMQ application password | _random 10 character long alphanumeric string_ |
| `rabbitmq.existingPasswordSecret` | Existing secret with RabbitMQ credentials | nil |
Expand Down
1 change: 1 addition & 0 deletions stable/rabbitmq/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ metadata:
heritage: "{{ .Release.Service }}"
spec:
serviceName: {{ template "rabbitmq.fullname" . }}-headless
podManagementPolicy: {{ .Values.podManagementPolicy }}
replicas: {{ .Values.replicas }}
updateStrategy:
type: {{ .Values.updateStrategy.type }}
Expand Down
13 changes: 13 additions & 0 deletions stable/rabbitmq/values-production.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,19 @@ image:
## does your cluster have rbac enabled? assume yes by default
rbacEnabled: true


## RabbitMQ should be initialized one by one when building cluster for the first time.
## Therefore, the default value of podManagementPolicy is 'OrderedReady'
## Once the RabbitMQ participates in the cluster, it waits for a response from another
## RabbitMQ in the same cluster at reboot, except the last RabbitMQ of the same cluster.
## If the cluster exits gracefully, you do not need to change the podManagementPolicy
## because the first RabbitMQ of the statefulset always will be last of the cluster.
## However if the last RabbitMQ of the cluster is not the first RabbitMQ due to a failure,
## you must change podManagementPolicy to 'Parallel'.
## ref : https://www.rabbitmq.com/clustering.html#restarting
##
podManagementPolicy: OrderedReady

## section of specific values for rabbitmq
rabbitmq:
## RabbitMQ application username
Expand Down
12 changes: 12 additions & 0 deletions stable/rabbitmq/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,18 @@ image:
## does your cluster have rbac enabled? assume yes by default
rbacEnabled: true

## RabbitMQ should be initialized one by one when building cluster for the first time.
## Therefore, the default value of podManagementPolicy is 'OrderedReady'
## Once the RabbitMQ participates in the cluster, it waits for a response from another
## RabbitMQ in the same cluster at reboot, except the last RabbitMQ of the same cluster.
## If the cluster exits gracefully, you do not need to change the podManagementPolicy
## because the first RabbitMQ of the statefulset always will be last of the cluster.
## However if the last RabbitMQ of the cluster is not the first RabbitMQ due to a failure,
## you must change podManagementPolicy to 'Parallel'.
## ref : https://www.rabbitmq.com/clustering.html#restarting
##
podManagementPolicy: OrderedReady

## section of specific values for rabbitmq
rabbitmq:
## RabbitMQ application username
Expand Down

0 comments on commit 6324ade

Please sign in to comment.