From 6324adee03d19e683b3ccbcee488b56f826adb08 Mon Sep 17 00:00:00 2001 From: Jungsub Shin Date: Thu, 18 Apr 2019 18:20:09 +0900 Subject: [PATCH] [RabbitMQ] Add podManagementPolicy for cluster recovery. (#13027) 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 --- stable/rabbitmq/Chart.yaml | 2 +- stable/rabbitmq/README.md | 1 + stable/rabbitmq/templates/statefulset.yaml | 1 + stable/rabbitmq/values-production.yaml | 13 +++++++++++++ stable/rabbitmq/values.yaml | 12 ++++++++++++ 5 files changed, 28 insertions(+), 1 deletion(-) diff --git a/stable/rabbitmq/Chart.yaml b/stable/rabbitmq/Chart.yaml index bec5d747a821..8098a21c3b8f 100644 --- a/stable/rabbitmq/Chart.yaml +++ b/stable/rabbitmq/Chart.yaml @@ -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: diff --git a/stable/rabbitmq/README.md b/stable/rabbitmq/README.md index c53cd056630e..eaf05fdc671d 100644 --- a/stable/rabbitmq/README.md +++ b/stable/rabbitmq/README.md @@ -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 | diff --git a/stable/rabbitmq/templates/statefulset.yaml b/stable/rabbitmq/templates/statefulset.yaml index e6dde5809d54..ebb762c5c745 100644 --- a/stable/rabbitmq/templates/statefulset.yaml +++ b/stable/rabbitmq/templates/statefulset.yaml @@ -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 }} diff --git a/stable/rabbitmq/values-production.yaml b/stable/rabbitmq/values-production.yaml index 5b74ae83585d..6736dd0ea5c1 100644 --- a/stable/rabbitmq/values-production.yaml +++ b/stable/rabbitmq/values-production.yaml @@ -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 diff --git a/stable/rabbitmq/values.yaml b/stable/rabbitmq/values.yaml index 382d0d86079d..36221c6da0f9 100644 --- a/stable/rabbitmq/values.yaml +++ b/stable/rabbitmq/values.yaml @@ -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