Added helm hook for rabbitmq job cluster wait

Job wait cluster was failing due to the field immutability which was
resulting in the manual delete of the job for every helm upgrade to be
successful. Reason being job being upgraded before the other manifest
that are required been updated. It can be avoided by using helm-hook
post-install and post-upgrade which will force the job manifest to be
applied only after all other manifest are applied. Hook annotation is
provided "5" so that the if other jobs are annotated, exporter job will
be last to created in case hooks are added to the other jobs in chart.
Also helm3_hook value is used for condition.

Change-Id: Ib83f1d4bef6300c2b76aa54f08927b74346184c7
This commit is contained in:
xuxant02@gmail.com 2021-06-25 15:03:28 +05:45
parent 62f5cab770
commit 812aba01b8
4 changed files with 11 additions and 1 deletions

View File

@ -15,6 +15,6 @@ apiVersion: v1
appVersion: v3.7.26
description: OpenStack-Helm RabbitMQ
name: rabbitmq
version: 0.1.11
version: 0.1.12
home: https://github.com/rabbitmq/rabbitmq-server
...

View File

@ -31,6 +31,11 @@ metadata:
{{ tuple $envAll "rabbitmq" "cluster-wait" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
annotations:
{{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }}
{{- if .Values.helm3_hook }}
"helm.sh/hook": "post-install,post-upgrade"
"helm.sh/hook-weight": "5"
"helm.sh/hook-delete-policy": before-hook-creation
{{- end }}
spec:
template:
metadata:

View File

@ -366,6 +366,10 @@ volume:
class_name: general
size: 256Mi
# Hook break for helm2.
# Set helm3_hook to false while using helm2
helm3_hook: true
manifests:
certificates: false
configmap_bin: true

View File

@ -11,4 +11,5 @@ rabbitmq:
- 0.1.9 Use full image ref for docker official images
- 0.1.10 Set separate for HTTPS
- 0.1.11 Add TLS support for helm test
- 0.1.12 Added helm hook post-install and post-upgrade for rabbitmq wait cluster job
...