From 5c1709d5bd86728d7f5453c68a251d4946cb6989 Mon Sep 17 00:00:00 2001 From: Ruslan Aliev Date: Wed, 1 May 2024 18:35:01 -0500 Subject: [PATCH] Add configurable probes to rabbitmq Currently rabbitmq probes are hardcoded with no ability to customize via values. Signed-off-by: Ruslan Aliev Change-Id: Ibbe84e68542296f3279c2e59986b9835fe301089 --- rabbitmq/Chart.yaml | 4 ++-- rabbitmq/templates/statefulset.yaml | 25 +++++++++++++------------ rabbitmq/values.yaml | 18 ++++++++++++++++++ releasenotes/notes/rabbitmq.yaml | 1 + 4 files changed, 34 insertions(+), 14 deletions(-) diff --git a/rabbitmq/Chart.yaml b/rabbitmq/Chart.yaml index 24a53c1da..6baa4866e 100644 --- a/rabbitmq/Chart.yaml +++ b/rabbitmq/Chart.yaml @@ -12,9 +12,9 @@ --- apiVersion: v1 -appVersion: v3.9.0 +appVersion: v3.12.0 description: OpenStack-Helm RabbitMQ name: rabbitmq -version: 0.1.34 +version: 0.1.35 home: https://github.com/rabbitmq/rabbitmq-server ... diff --git a/rabbitmq/templates/statefulset.yaml b/rabbitmq/templates/statefulset.yaml index a931750a1..8a4c8b735 100644 --- a/rabbitmq/templates/statefulset.yaml +++ b/rabbitmq/templates/statefulset.yaml @@ -18,6 +18,17 @@ limitations under the License. {{- $_ := set . "deployment_name" .Release.Name }} {{- end }} +{{- define "rabbitmqReadinessProbeTemplate" }} +exec: + command: + - /tmp/rabbitmq-readiness.sh +{{- end }} +{{- define "rabbitmqLivenessProbeTemplate" }} +exec: + command: + - /tmp/rabbitmq-liveness.sh +{{- end }} + {{/* (aostapenko) rounds cpu limit in any permissible format to integer value (min 1) "100m" -> 1 @@ -237,18 +248,8 @@ spec: - name: RABBITMQ_FEATURE_FLAGS value: "{{ .Values.conf.feature_flags }}" {{- end }} - readinessProbe: - initialDelaySeconds: 10 - timeoutSeconds: 10 - exec: - command: - - /tmp/rabbitmq-readiness.sh - livenessProbe: - initialDelaySeconds: 60 - timeoutSeconds: 10 - exec: - command: - - /tmp/rabbitmq-liveness.sh +{{ dict "envAll" $envAll "component" "rabbitmq" "container" "rabbitmq" "type" "readiness" "probeTemplate" (include "rabbitmqReadinessProbeTemplate" $envAll | fromYaml) | include "helm-toolkit.snippets.kubernetes_probe" | trim | indent 10 }} +{{ dict "envAll" $envAll "component" "rabbitmq" "container" "rabbitmq" "type" "liveness" "probeTemplate" (include "rabbitmqLivenessProbeTemplate" $envAll | fromYaml) | include "helm-toolkit.snippets.kubernetes_probe" | trim | indent 10 }} lifecycle: preStop: exec: diff --git a/rabbitmq/values.yaml b/rabbitmq/values.yaml index 9db515909..fd0fdf6b4 100644 --- a/rabbitmq/values.yaml +++ b/rabbitmq/values.yaml @@ -68,6 +68,24 @@ pod: initialDelaySeconds: 120 periodSeconds: 90 timeoutSeconds: 5 + rabbitmq: + rabbitmq: + readiness: + enabled: true + params: + initialDelaySeconds: 10 + periodSeconds: 10 + timeoutSeconds: 10 + successThreshold: 1 + failureThreshold: 3 + liveness: + enabled: true + params: + initialDelaySeconds: 60 + periodSeconds: 10 + timeoutSeconds: 10 + successThreshold: 1 + failureThreshold: 5 security_context: exporter: pod: diff --git a/releasenotes/notes/rabbitmq.yaml b/releasenotes/notes/rabbitmq.yaml index 2a8fdbf1d..e436d49da 100644 --- a/releasenotes/notes/rabbitmq.yaml +++ b/releasenotes/notes/rabbitmq.yaml @@ -34,4 +34,5 @@ rabbitmq: - 0.1.32 Enable addition of default consumer prefetch count - 0.1.33 Bump RabbitMQ image version to 3.13.0 - 0.1.34 Add 2024.1 overrides + - 0.1.35 Add configurable probes to rabbitmq container ...