From 36029956c413509d7f8899936828c2c12d9cfca6 Mon Sep 17 00:00:00 2001 From: Emilien Devos Date: Tue, 19 Sep 2023 14:12:18 +0200 Subject: [PATCH 01/16] add rabbitmq support into helm chart --- Chart.lock | 9 +- Chart.yaml | 7 +- templates/_helpers-database.tpl | 45 ++++++++ templates/_helpers-envs.tpl | 51 +++++++++ templates/_helpers-ldap.tpl | 33 ++++++ templates/_helpers-rabbitmq.tpl | 38 +++++++ templates/_helpers.tpl | 132 ---------------------- templates/console/console-deployment.yaml | 1 + templates/gateway/gateway-deployment.yaml | 1 + templates/rabbitmq/rabbitmq-secret.yaml | 19 ++++ values.yaml | 9 ++ 11 files changed, 209 insertions(+), 136 deletions(-) create mode 100644 templates/_helpers-database.tpl create mode 100644 templates/_helpers-envs.tpl create mode 100644 templates/_helpers-ldap.tpl create mode 100644 templates/_helpers-rabbitmq.tpl create mode 100644 templates/rabbitmq/rabbitmq-secret.yaml diff --git a/Chart.lock b/Chart.lock index 4db0146..32c7cd6 100644 --- a/Chart.lock +++ b/Chart.lock @@ -1,6 +1,9 @@ dependencies: - name: postgresql repository: https://charts.bitnami.com/bitnami/ - version: 12.1.15 -digest: sha256:fafad9c35344a9fa85f52ea0764a2d5c40e247eef01220edbf6d21dcc7541426 -generated: "2023-02-16T17:52:10.601623147+01:00" + version: 12.11.2 +- name: rabbitmq + repository: https://charts.bitnami.com/bitnami/ + version: 12.1.4 +digest: sha256:d4a4c0c3ea33e653b9d89f03722b52687128d7532d9dc0e408f6ba4960439c1f +generated: "2023-09-19T14:06:17.738408641+02:00" diff --git a/Chart.yaml b/Chart.yaml index 0b2dd2c..c128beb 100644 --- a/Chart.yaml +++ b/Chart.yaml @@ -25,7 +25,12 @@ appVersion: "22.0" dependencies: - name: postgresql - version: ~12.1.14 + version: ~12.11.2 repository: "https://charts.bitnami.com/bitnami/" condition: database.builtin alias: database +- name: rabbitmq + version: ~12.1.4 + repository: "https://charts.bitnami.com/bitnami/" + condition: rabbitmq.builtin + alias: rabbitmq \ No newline at end of file diff --git a/templates/_helpers-database.tpl b/templates/_helpers-database.tpl new file mode 100644 index 0000000..002a305 --- /dev/null +++ b/templates/_helpers-database.tpl @@ -0,0 +1,45 @@ +{{/* +Insert database georchestra environment variables +*/}} +{{- define "georchestra.database-georchestra-envs" -}} +{{- $database := .Values.database -}} +{{- $database_secret_georchestra_name := printf "%s-database-georchestra-secret" (include "georchestra.fullname" .) -}} +{{- if $database.builtin }} +- name: PGHOST + value: "{{ .Release.Name }}-database" +{{- else }} +{{- if $database.auth.existingSecret }} +{{- $database_secret_georchestra_name = $database.auth.existingSecret -}} +{{- end }} +- name: PGHOST + valueFrom: + secretKeyRef: + name: {{ $database_secret_georchestra_name }} + key: host + optional: false +{{- end }} +- name: PGPORT + valueFrom: + secretKeyRef: + name: {{ $database_secret_georchestra_name }} + key: port + optional: false +- name: PGDATABASE + valueFrom: + secretKeyRef: + name: {{ $database_secret_georchestra_name }} + key: dbname + optional: false +- name: PGUSER + valueFrom: + secretKeyRef: + name: {{ $database_secret_georchestra_name }} + key: user + optional: false +- name: PGPASSWORD + valueFrom: + secretKeyRef: + name: {{ $database_secret_georchestra_name }} + key: password + optional: false +{{- end }} \ No newline at end of file diff --git a/templates/_helpers-envs.tpl b/templates/_helpers-envs.tpl new file mode 100644 index 0000000..1c90c41 --- /dev/null +++ b/templates/_helpers-envs.tpl @@ -0,0 +1,51 @@ +{{/* +Insert service host environment variables +*/}} +{{- define "georchestra.service-envs" -}} +- name: ANALYTICS_HOST + value: "{{ include "georchestra.fullname" . }}-analytics-svc" +- name: CAS_HOST + value: "{{ include "georchestra.fullname" . }}-cas-svc" +- name: CONSOLE_HOST + value: "{{ include "georchestra.fullname" . }}-console-svc" +- name: GEONETWORK_HOST + value: "{{ include "georchestra.fullname" . }}-geonetwork-svc" +- name: GEOSERVER_HOST + value: "{{ include "georchestra.fullname" . }}-geoserver-svc" +- name: HEADER_HOST + value: "{{ include "georchestra.fullname" . }}-header-svc" +- name: GEOWEBCACHE_HOST + value: "{{ include "georchestra.fullname" . }}-geowebcache-svc" +- name: MAPSTORE_HOST + value: "{{ include "georchestra.fullname" . }}-mapstore-svc" +- name: DATAFEEDER_HOST + value: "{{ include "georchestra.fullname" . }}-datafeeder-svc" +- name: IMPORT_HOST + value: "{{ include "georchestra.fullname" . }}-import-svc" +- name: DATAHUB_HOST + value: "datahub-datahub-svc" +- name: OGC_API_RECORDS_HOST + value: "{{ include "georchestra.fullname" . }}-gn4-ogc-api-records-svc" +- name: ES_HOST + value: "{{ include "georchestra.fullname" . }}-gn4-elasticsearch-svc" +- name: ES_PORT + value: "9200" +- name: KB_HOST + value: "{{ include "georchestra.fullname" . }}-gn4-kibana-svc" +- name: KB_PORT + value: "5601" +{{- end }} + +{{/* +Insert common environment variables +*/}} +{{- define "georchestra.common-envs" -}} +- name: FQDN + value: "{{ .Values.fqdn }}" +{{- if .Values.georchestra.smtp_smarthost.enabled }} +- name: SMTPHOST + value: "{{ include "georchestra.fullname" . }}-smtp-svc" +- name: SMTPPORT + value: "25" +{{- end }} +{{- end }} \ No newline at end of file diff --git a/templates/_helpers-ldap.tpl b/templates/_helpers-ldap.tpl new file mode 100644 index 0000000..4b4ef12 --- /dev/null +++ b/templates/_helpers-ldap.tpl @@ -0,0 +1,33 @@ +{{/* +Insert LDAP environment variables +*/}} +{{- define "georchestra.ldap-envs" -}} +{{- $ldap := .Values.ldap -}} +{{- if .Values.georchestra.webapps.openldap.enabled }} +- name: LDAPHOST + value: "{{ include "georchestra.fullname" . }}-ldap-svc" +{{- else }} +- name: LDAPHOST + value: "{{ $ldap.host }}" +{{- end }} +- name: LDAPPORT + value: "{{ $ldap.port }}" +- name: LDAPSCHEME + value: "{{ $ldap.scheme }}" +- name: LDAPBASEDN + value: "{{ $ldap.baseDn }}" +- name: LDAPADMINDN + value: "{{ $ldap.adminDn }}" +- name: LDAPADMINPASSWORD + valueFrom: + secretKeyRef: + name: {{ $ldap.existingSecret | default (printf "%s-ldap-passwords-secret" (include "georchestra.fullname" .)) }} + key: SLAPD_PASSWORD + optional: false +- name: LDAPUSERSRDN + value: "{{ $ldap.usersRdn }}" +- name: LDAPROLESRDN + value: "{{ $ldap.rolesRdn }}" +- name: LDAPORGSRDN + value: "{{ $ldap.orgsRdn }}" +{{- end }} \ No newline at end of file diff --git a/templates/_helpers-rabbitmq.tpl b/templates/_helpers-rabbitmq.tpl new file mode 100644 index 0000000..fd64dde --- /dev/null +++ b/templates/_helpers-rabbitmq.tpl @@ -0,0 +1,38 @@ +{{/* +Insert rabbitmq georchestra environment variables +*/}} +{{- define "georchestra.rabbitmq-georchestra-envs" -}} +{{- $rabbitmq := .Values.rabbitmq -}} +{{- $rabbitmq_secret_georchestra_name := "" -}} +{{- if $rabbitmq.builtin }} +{{- $rabbitmq_secret_georchestra_name = printf "%s-rabbitmq-georchestra-secret" (include "georchestra.fullname" .) -}} +- name: RABBITMQ_HOST + value: "{{ .Release.Name }}-rabbitmq" +{{- else }} +{{- $rabbitmq_secret_georchestra_name = .Values.rabbitmq.auth.existingSecret -}} +- name: RABBITMQ_HOST + valueFrom: + secretKeyRef: + name: {{ $rabbitmq_secret_georchestra_name }} + key: host + optional: false +{{- end }} +- name: RABBITMQ_PORT + valueFrom: + secretKeyRef: + name: {{ $rabbitmq_secret_georchestra_name }} + key: port + optional: false +- name: RABBITMQ_USERNAME + valueFrom: + secretKeyRef: + name: {{ $rabbitmq_secret_georchestra_name }} + key: user + optional: false +- name: RABBITMQ_PASSWORD + valueFrom: + secretKeyRef: + name: {{ $rabbitmq_secret_georchestra_name }} + key: password + optional: false +{{- end }} \ No newline at end of file diff --git a/templates/_helpers.tpl b/templates/_helpers.tpl index fb73ec0..d203a19 100644 --- a/templates/_helpers.tpl +++ b/templates/_helpers.tpl @@ -60,135 +60,3 @@ Create the name of the service account to use {{- default "default" .Values.serviceAccount.name }} {{- end }} {{- end }} - -{{/* -Insert database georchestra environment variables -*/}} -{{- define "georchestra.database-georchestra-envs" -}} -{{- $database := .Values.database -}} -{{- $database_secret_georchestra_name := printf "%s-database-georchestra-secret" (include "georchestra.fullname" .) -}} -{{- if $database.builtin }} -- name: PGHOST - value: "{{ .Release.Name }}-database" -{{- else }} -{{- if $database.auth.existingSecret }} -{{- $database_secret_georchestra_name = $database.auth.existingSecret -}} -{{- end }} -- name: PGHOST - valueFrom: - secretKeyRef: - name: {{ $database_secret_georchestra_name }} - key: host - optional: false -{{- end }} -- name: PGPORT - valueFrom: - secretKeyRef: - name: {{ $database_secret_georchestra_name }} - key: port - optional: false -- name: PGDATABASE - valueFrom: - secretKeyRef: - name: {{ $database_secret_georchestra_name }} - key: dbname - optional: false -- name: PGUSER - valueFrom: - secretKeyRef: - name: {{ $database_secret_georchestra_name }} - key: user - optional: false -- name: PGPASSWORD - valueFrom: - secretKeyRef: - name: {{ $database_secret_georchestra_name }} - key: password - optional: false -{{- end }} - -{{/* -Insert LDAP environment variables -*/}} -{{- define "georchestra.ldap-envs" -}} -{{- $ldap := .Values.ldap -}} -{{- if .Values.georchestra.webapps.openldap.enabled }} -- name: LDAPHOST - value: "{{ include "georchestra.fullname" . }}-ldap-svc" -{{- else }} -- name: LDAPHOST - value: "{{ $ldap.host }}" -{{- end }} -- name: LDAPPORT - value: "{{ $ldap.port }}" -- name: LDAPSCHEME - value: "{{ $ldap.scheme }}" -- name: LDAPBASEDN - value: "{{ $ldap.baseDn }}" -- name: LDAPADMINDN - value: "{{ $ldap.adminDn }}" -- name: LDAPADMINPASSWORD - valueFrom: - secretKeyRef: - name: {{ $ldap.existingSecret | default (printf "%s-ldap-passwords-secret" (include "georchestra.fullname" .)) }} - key: SLAPD_PASSWORD - optional: false -- name: LDAPUSERSRDN - value: "{{ $ldap.usersRdn }}" -- name: LDAPROLESRDN - value: "{{ $ldap.rolesRdn }}" -- name: LDAPORGSRDN - value: "{{ $ldap.orgsRdn }}" -{{- end }} - -{{/* -Insert service host environment variables -*/}} -{{- define "georchestra.service-envs" -}} -- name: ANALYTICS_HOST - value: "{{ include "georchestra.fullname" . }}-analytics-svc" -- name: CAS_HOST - value: "{{ include "georchestra.fullname" . }}-cas-svc" -- name: CONSOLE_HOST - value: "{{ include "georchestra.fullname" . }}-console-svc" -- name: GEONETWORK_HOST - value: "{{ include "georchestra.fullname" . }}-geonetwork-svc" -- name: GEOSERVER_HOST - value: "{{ include "georchestra.fullname" . }}-geoserver-svc" -- name: HEADER_HOST - value: "{{ include "georchestra.fullname" . }}-header-svc" -- name: GEOWEBCACHE_HOST - value: "{{ include "georchestra.fullname" . }}-geowebcache-svc" -- name: MAPSTORE_HOST - value: "{{ include "georchestra.fullname" . }}-mapstore-svc" -- name: DATAFEEDER_HOST - value: "{{ include "georchestra.fullname" . }}-datafeeder-svc" -- name: IMPORT_HOST - value: "{{ include "georchestra.fullname" . }}-import-svc" -- name: DATAHUB_HOST - value: "datahub-datahub-svc" -- name: OGC_API_RECORDS_HOST - value: "{{ include "georchestra.fullname" . }}-gn4-ogc-api-records-svc" -- name: ES_HOST - value: "{{ include "georchestra.fullname" . }}-gn4-elasticsearch-svc" -- name: ES_PORT - value: "9200" -- name: KB_HOST - value: "{{ include "georchestra.fullname" . }}-gn4-kibana-svc" -- name: KB_PORT - value: "5601" -{{- end }} - -{{/* -Insert common environment variables -*/}} -{{- define "georchestra.common-envs" -}} -- name: FQDN - value: "{{ .Values.fqdn }}" -{{- if .Values.georchestra.smtp_smarthost.enabled }} -- name: SMTPHOST - value: "{{ include "georchestra.fullname" . }}-smtp-svc" -- name: SMTPPORT - value: "25" -{{- end }} -{{- end }} diff --git a/templates/console/console-deployment.yaml b/templates/console/console-deployment.yaml index e28699b..6bb33a9 100644 --- a/templates/console/console-deployment.yaml +++ b/templates/console/console-deployment.yaml @@ -35,6 +35,7 @@ spec: {{- include "georchestra.common-envs" . | nindent 10 }} {{- include "georchestra.ldap-envs" . | nindent 10 }} {{- include "georchestra.database-georchestra-envs" . | nindent 10 }} + {{- include "georchestra.rabbitmq-georchestra-envs" . | nindent 10 }} {{- if $webapp.extra_environment }} {{- $webapp.extra_environment | toYaml | nindent 10 }} {{- end }} diff --git a/templates/gateway/gateway-deployment.yaml b/templates/gateway/gateway-deployment.yaml index d2b7764..60c1f28 100644 --- a/templates/gateway/gateway-deployment.yaml +++ b/templates/gateway/gateway-deployment.yaml @@ -38,6 +38,7 @@ spec: {{- include "georchestra.common-envs" . | nindent 10 }} {{- include "georchestra.ldap-envs" . | nindent 10 }} {{- include "georchestra.database-georchestra-envs" . | nindent 10 }} + {{- include "georchestra.rabbitmq-georchestra-envs" . | nindent 10 }} {{- if $webapp.extra_environment }} {{- $webapp.extra_environment | toYaml | nindent 10 }} {{- end }} diff --git a/templates/rabbitmq/rabbitmq-secret.yaml b/templates/rabbitmq/rabbitmq-secret.yaml new file mode 100644 index 0000000..f40b8f2 --- /dev/null +++ b/templates/rabbitmq/rabbitmq-secret.yaml @@ -0,0 +1,19 @@ +{{- $rabbitmq := .Values.rabbitmq -}} +{{- if not $rabbitmq.auth.existingSecret -}} +apiVersion: v1 +kind: Secret +metadata: + name: {{ include "georchestra.fullname" . }}-rabbitmq-georchestra-secret + labels: + {{- include "georchestra.labels" . | nindent 4 }} +type: Opaque +data: + {{- if $rabbitmq.builtin }} + host: {{ printf "%s-rabbitmq" .Release.Name | b64enc | quote }} + {{- else }} + host: {{ $rabbitmq.auth.host | b64enc | quote }} + {{- end }} + password: {{ $rabbitmq.auth.password | b64enc | quote }} + port: {{ $rabbitmq.auth.port | b64enc | quote }} + user: {{ $rabbitmq.auth.username | b64enc | quote }} +{{- end }} diff --git a/values.yaml b/values.yaml index 7923703..74426b5 100644 --- a/values.yaml +++ b/values.yaml @@ -282,3 +282,12 @@ database: ssl: false password: datafeeder username: datafeeder + +rabbitmq: + builtin: true + auth: + username: georchestra + password: georchestra +# host: rabbitmq + port: "5672" +# existingSecret: mysecret \ No newline at end of file From 9d4374f7e58fbc2d7f66344e8b12233fd537673b Mon Sep 17 00:00:00 2001 From: Emilien Devos Date: Tue, 19 Sep 2023 17:35:13 +0200 Subject: [PATCH 02/16] add ability to specify pv for automatic PVC creation --- templates/rabbitmq/rabbitmq-pvc.yaml | 18 ++++++++++++++++++ values.yaml | 7 ++++++- 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 templates/rabbitmq/rabbitmq-pvc.yaml diff --git a/templates/rabbitmq/rabbitmq-pvc.yaml b/templates/rabbitmq/rabbitmq-pvc.yaml new file mode 100644 index 0000000..bec5440 --- /dev/null +++ b/templates/rabbitmq/rabbitmq-pvc.yaml @@ -0,0 +1,18 @@ +{{- if .Values.rabbitmq.storage.pv_name -}} +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ include "georchestra.fullname" . }}-rabbitmq + labels: + {{- include "georchestra.labels" . | nindent 4 }} + app.kubernetes.io/component: {{ include "georchestra.fullname" . }}-rabbitmq +spec: + accessModes: + - ReadWriteOnce + {{- if .Values.rabbitmq.storage.storage_class_name }} + storageClassName: {{ .Values.rabbitmq.storage.storage_class_name }} + {{- end }} + {{- if .Values.rabbitmq.storage.pv_name }} + volumeName: {{ .Values.rabbitmq.storage.pv_name }} + {{- end }} +{{- end }} \ No newline at end of file diff --git a/values.yaml b/values.yaml index 74426b5..8be2118 100644 --- a/values.yaml +++ b/values.yaml @@ -290,4 +290,9 @@ rabbitmq: password: georchestra # host: rabbitmq port: "5672" -# existingSecret: mysecret \ No newline at end of file +# existingSecret: mysecret + # if you want to attach any existing PV - don't use this parameter + # if you just automatically want storage, consult the bitnam helm chart doc +# storage: +# pv_name: rabbitmq-data +# storage_class_name: default \ No newline at end of file From 8e10dc6024aaf806f023f4be4fb4f41e46b74eb6 Mon Sep 17 00:00:00 2001 From: Emilien Devos Date: Tue, 19 Sep 2023 17:44:12 +0200 Subject: [PATCH 03/16] add required size for a PVC + fix if case --- templates/rabbitmq/rabbitmq-pvc.yaml | 5 ++++- values.yaml | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/templates/rabbitmq/rabbitmq-pvc.yaml b/templates/rabbitmq/rabbitmq-pvc.yaml index bec5440..d6ed137 100644 --- a/templates/rabbitmq/rabbitmq-pvc.yaml +++ b/templates/rabbitmq/rabbitmq-pvc.yaml @@ -1,4 +1,4 @@ -{{- if .Values.rabbitmq.storage.pv_name -}} +{{- if .Values.rabbitmq.storage -}} apiVersion: v1 kind: PersistentVolumeClaim metadata: @@ -15,4 +15,7 @@ spec: {{- if .Values.rabbitmq.storage.pv_name }} volumeName: {{ .Values.rabbitmq.storage.pv_name }} {{- end }} + resources: + requests: + storage: {{ .Values.rabbitmq.storage.size }} {{- end }} \ No newline at end of file diff --git a/values.yaml b/values.yaml index 8be2118..0c3b4d4 100644 --- a/values.yaml +++ b/values.yaml @@ -295,4 +295,5 @@ rabbitmq: # if you just automatically want storage, consult the bitnam helm chart doc # storage: # pv_name: rabbitmq-data -# storage_class_name: default \ No newline at end of file +# storage_class_name: default +# size: 1Gi \ No newline at end of file From 31338355215b1288ede9bc5abe72a6508bd4c2f8 Mon Sep 17 00:00:00 2001 From: Emilien Devos Date: Wed, 11 Oct 2023 15:55:42 +0200 Subject: [PATCH 04/16] fix no new line end of the file --- Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Chart.yaml b/Chart.yaml index c128beb..9eb285f 100644 --- a/Chart.yaml +++ b/Chart.yaml @@ -33,4 +33,4 @@ dependencies: version: ~12.1.4 repository: "https://charts.bitnami.com/bitnami/" condition: rabbitmq.builtin - alias: rabbitmq \ No newline at end of file + alias: rabbitmq From 02826a14257ed05b6146b937faa8ea810ca7da3f Mon Sep 17 00:00:00 2001 From: Emilien Devos Date: Thu, 2 Nov 2023 16:31:16 +0100 Subject: [PATCH 05/16] add ability to enable and disable rabbitmq --- Chart.yaml | 2 +- templates/rabbitmq/rabbitmq-pvc.yaml | 2 +- templates/rabbitmq/rabbitmq-secret.yaml | 2 ++ values.yaml | 1 + 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Chart.yaml b/Chart.yaml index 9eb285f..058f830 100644 --- a/Chart.yaml +++ b/Chart.yaml @@ -32,5 +32,5 @@ dependencies: - name: rabbitmq version: ~12.1.4 repository: "https://charts.bitnami.com/bitnami/" - condition: rabbitmq.builtin + condition: rabbitmq.builtin, rabbitmq.enabled alias: rabbitmq diff --git a/templates/rabbitmq/rabbitmq-pvc.yaml b/templates/rabbitmq/rabbitmq-pvc.yaml index d6ed137..76297fb 100644 --- a/templates/rabbitmq/rabbitmq-pvc.yaml +++ b/templates/rabbitmq/rabbitmq-pvc.yaml @@ -1,4 +1,4 @@ -{{- if .Values.rabbitmq.storage -}} +{{- if .Values.rabbitmq.enabled and .Values.rabbitmq.storage -}} apiVersion: v1 kind: PersistentVolumeClaim metadata: diff --git a/templates/rabbitmq/rabbitmq-secret.yaml b/templates/rabbitmq/rabbitmq-secret.yaml index f40b8f2..b1f38a4 100644 --- a/templates/rabbitmq/rabbitmq-secret.yaml +++ b/templates/rabbitmq/rabbitmq-secret.yaml @@ -1,3 +1,4 @@ +{{ .Values.rabbitmq.enabled }} {{- $rabbitmq := .Values.rabbitmq -}} {{- if not $rabbitmq.auth.existingSecret -}} apiVersion: v1 @@ -17,3 +18,4 @@ data: port: {{ $rabbitmq.auth.port | b64enc | quote }} user: {{ $rabbitmq.auth.username | b64enc | quote }} {{- end }} +{{- end }} \ No newline at end of file diff --git a/values.yaml b/values.yaml index 0c3b4d4..9feca55 100644 --- a/values.yaml +++ b/values.yaml @@ -284,6 +284,7 @@ database: username: datafeeder rabbitmq: + enabled: false builtin: true auth: username: georchestra From 613a52e09c7da6e091fea012cc258fe8af4b1d0c Mon Sep 17 00:00:00 2001 From: Emilien Devos Date: Thu, 2 Nov 2023 16:37:05 +0100 Subject: [PATCH 06/16] update chart.lock --- Chart.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Chart.lock b/Chart.lock index 32c7cd6..dbf65c3 100644 --- a/Chart.lock +++ b/Chart.lock @@ -4,6 +4,6 @@ dependencies: version: 12.11.2 - name: rabbitmq repository: https://charts.bitnami.com/bitnami/ - version: 12.1.4 -digest: sha256:d4a4c0c3ea33e653b9d89f03722b52687128d7532d9dc0e408f6ba4960439c1f -generated: "2023-09-19T14:06:17.738408641+02:00" + version: 12.1.7 +digest: sha256:632c05795534e4ea9a7af2ccddb6ca88968d49eb85c3ccd479ba2509dffb6f97 +generated: "2023-11-02T16:36:51.587369906+01:00" From d2ce70e983cbbab7edd327fe9aea0ba9329e7dd5 Mon Sep 17 00:00:00 2001 From: Emilien Devos Date: Thu, 2 Nov 2023 16:41:17 +0100 Subject: [PATCH 07/16] better if case for rabbitmq secret --- templates/rabbitmq/rabbitmq-secret.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/templates/rabbitmq/rabbitmq-secret.yaml b/templates/rabbitmq/rabbitmq-secret.yaml index b1f38a4..848eb74 100644 --- a/templates/rabbitmq/rabbitmq-secret.yaml +++ b/templates/rabbitmq/rabbitmq-secret.yaml @@ -1,6 +1,5 @@ -{{ .Values.rabbitmq.enabled }} {{- $rabbitmq := .Values.rabbitmq -}} -{{- if not $rabbitmq.auth.existingSecret -}} +{{- if .Values.rabbitmq.enabled and not $rabbitmq.auth.existingSecret -}} apiVersion: v1 kind: Secret metadata: @@ -17,5 +16,4 @@ data: password: {{ $rabbitmq.auth.password | b64enc | quote }} port: {{ $rabbitmq.auth.port | b64enc | quote }} user: {{ $rabbitmq.auth.username | b64enc | quote }} -{{- end }} {{- end }} \ No newline at end of file From 0abcb9711212ed7c6431b1c8cd527f456071bb7b Mon Sep 17 00:00:00 2001 From: Emilien Devos Date: Thu, 2 Nov 2023 16:48:44 +0100 Subject: [PATCH 08/16] fix if and case and improve helm templating --- templates/rabbitmq/rabbitmq-pvc.yaml | 13 +++++++------ templates/rabbitmq/rabbitmq-secret.yaml | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/templates/rabbitmq/rabbitmq-pvc.yaml b/templates/rabbitmq/rabbitmq-pvc.yaml index 76297fb..46408a5 100644 --- a/templates/rabbitmq/rabbitmq-pvc.yaml +++ b/templates/rabbitmq/rabbitmq-pvc.yaml @@ -1,4 +1,5 @@ -{{- if .Values.rabbitmq.enabled and .Values.rabbitmq.storage -}} +{{- $rabbitmq := .Values.rabbitmq -}} +{{- if and $rabbitmq.enabled $rabbitmq.storage -}} apiVersion: v1 kind: PersistentVolumeClaim metadata: @@ -9,13 +10,13 @@ metadata: spec: accessModes: - ReadWriteOnce - {{- if .Values.rabbitmq.storage.storage_class_name }} - storageClassName: {{ .Values.rabbitmq.storage.storage_class_name }} + {{- if $rabbitmq.storage.storage_class_name }} + storageClassName: {{ $rabbitmq.storage.storage_class_name }} {{- end }} - {{- if .Values.rabbitmq.storage.pv_name }} - volumeName: {{ .Values.rabbitmq.storage.pv_name }} + {{- if $rabbitmq.storage.pv_name }} + volumeName: {{ $rabbitmq.storage.pv_name }} {{- end }} resources: requests: - storage: {{ .Values.rabbitmq.storage.size }} + storage: {{ $rabbitmq.storage.size }} {{- end }} \ No newline at end of file diff --git a/templates/rabbitmq/rabbitmq-secret.yaml b/templates/rabbitmq/rabbitmq-secret.yaml index 848eb74..571d19b 100644 --- a/templates/rabbitmq/rabbitmq-secret.yaml +++ b/templates/rabbitmq/rabbitmq-secret.yaml @@ -1,5 +1,5 @@ {{- $rabbitmq := .Values.rabbitmq -}} -{{- if .Values.rabbitmq.enabled and not $rabbitmq.auth.existingSecret -}} +{{- if and $rabbitmq.enabled not $rabbitmq.auth.existingSecret -}} apiVersion: v1 kind: Secret metadata: From acdcd86d62964bcb16e284745adc8e38ecf9fb79 Mon Sep 17 00:00:00 2001 From: Emilien Devos Date: Thu, 2 Nov 2023 16:52:47 +0100 Subject: [PATCH 09/16] fix if and not case --- templates/rabbitmq/rabbitmq-secret.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/templates/rabbitmq/rabbitmq-secret.yaml b/templates/rabbitmq/rabbitmq-secret.yaml index 571d19b..5e96404 100644 --- a/templates/rabbitmq/rabbitmq-secret.yaml +++ b/templates/rabbitmq/rabbitmq-secret.yaml @@ -1,5 +1,6 @@ {{- $rabbitmq := .Values.rabbitmq -}} -{{- if and $rabbitmq.enabled not $rabbitmq.auth.existingSecret -}} +{{- if $rabbitmq.enabled -}} +{{- if not $rabbitmq.auth.existingSecret -}} apiVersion: v1 kind: Secret metadata: @@ -16,4 +17,5 @@ data: password: {{ $rabbitmq.auth.password | b64enc | quote }} port: {{ $rabbitmq.auth.port | b64enc | quote }} user: {{ $rabbitmq.auth.username | b64enc | quote }} +{{- end }} {{- end }} \ No newline at end of file From 5a564bb4e4b16788709d39e61829972bb4346dc1 Mon Sep 17 00:00:00 2001 From: Emilien Devos Date: Thu, 2 Nov 2023 17:01:46 +0100 Subject: [PATCH 10/16] add new line end of the files --- templates/rabbitmq/rabbitmq-pvc.yaml | 2 +- templates/rabbitmq/rabbitmq-secret.yaml | 2 +- values.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/rabbitmq/rabbitmq-pvc.yaml b/templates/rabbitmq/rabbitmq-pvc.yaml index 46408a5..4c37aa3 100644 --- a/templates/rabbitmq/rabbitmq-pvc.yaml +++ b/templates/rabbitmq/rabbitmq-pvc.yaml @@ -19,4 +19,4 @@ spec: resources: requests: storage: {{ $rabbitmq.storage.size }} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/templates/rabbitmq/rabbitmq-secret.yaml b/templates/rabbitmq/rabbitmq-secret.yaml index 5e96404..c90862f 100644 --- a/templates/rabbitmq/rabbitmq-secret.yaml +++ b/templates/rabbitmq/rabbitmq-secret.yaml @@ -18,4 +18,4 @@ data: port: {{ $rabbitmq.auth.port | b64enc | quote }} user: {{ $rabbitmq.auth.username | b64enc | quote }} {{- end }} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/values.yaml b/values.yaml index 9feca55..694be98 100644 --- a/values.yaml +++ b/values.yaml @@ -297,4 +297,4 @@ rabbitmq: # storage: # pv_name: rabbitmq-data # storage_class_name: default -# size: 1Gi \ No newline at end of file +# size: 1Gi From e6c2707b386d9b2c4ad4ec5a2c26a7218613bf98 Mon Sep 17 00:00:00 2001 From: Emilien Devos Date: Thu, 2 Nov 2023 17:03:40 +0100 Subject: [PATCH 11/16] new line at the end of the files --- templates/_helpers-database.tpl | 2 +- templates/_helpers-envs.tpl | 2 +- templates/_helpers-ldap.tpl | 2 +- templates/_helpers-rabbitmq.tpl | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/_helpers-database.tpl b/templates/_helpers-database.tpl index 002a305..c1b3a5d 100644 --- a/templates/_helpers-database.tpl +++ b/templates/_helpers-database.tpl @@ -42,4 +42,4 @@ Insert database georchestra environment variables name: {{ $database_secret_georchestra_name }} key: password optional: false -{{- end }} \ No newline at end of file +{{- end }} diff --git a/templates/_helpers-envs.tpl b/templates/_helpers-envs.tpl index 1c90c41..15982ab 100644 --- a/templates/_helpers-envs.tpl +++ b/templates/_helpers-envs.tpl @@ -48,4 +48,4 @@ Insert common environment variables - name: SMTPPORT value: "25" {{- end }} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/templates/_helpers-ldap.tpl b/templates/_helpers-ldap.tpl index 4b4ef12..325b078 100644 --- a/templates/_helpers-ldap.tpl +++ b/templates/_helpers-ldap.tpl @@ -30,4 +30,4 @@ Insert LDAP environment variables value: "{{ $ldap.rolesRdn }}" - name: LDAPORGSRDN value: "{{ $ldap.orgsRdn }}" -{{- end }} \ No newline at end of file +{{- end }} diff --git a/templates/_helpers-rabbitmq.tpl b/templates/_helpers-rabbitmq.tpl index fd64dde..197422e 100644 --- a/templates/_helpers-rabbitmq.tpl +++ b/templates/_helpers-rabbitmq.tpl @@ -35,4 +35,4 @@ Insert rabbitmq georchestra environment variables name: {{ $rabbitmq_secret_georchestra_name }} key: password optional: false -{{- end }} \ No newline at end of file +{{- end }} From bf93a8d8b332df98df4ba932de538542cb1cabcb Mon Sep 17 00:00:00 2001 From: Emilien Devos Date: Mon, 6 Nov 2023 11:48:15 +0100 Subject: [PATCH 12/16] only inject rabbitmq envs when rabbit is enabled --- templates/console/console-deployment.yaml | 2 ++ templates/gateway/gateway-deployment.yaml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/templates/console/console-deployment.yaml b/templates/console/console-deployment.yaml index 6bb33a9..c80958e 100644 --- a/templates/console/console-deployment.yaml +++ b/templates/console/console-deployment.yaml @@ -35,7 +35,9 @@ spec: {{- include "georchestra.common-envs" . | nindent 10 }} {{- include "georchestra.ldap-envs" . | nindent 10 }} {{- include "georchestra.database-georchestra-envs" . | nindent 10 }} + {{- if $rabbitmq.enabled -}} {{- include "georchestra.rabbitmq-georchestra-envs" . | nindent 10 }} + {{- end }} {{- if $webapp.extra_environment }} {{- $webapp.extra_environment | toYaml | nindent 10 }} {{- end }} diff --git a/templates/gateway/gateway-deployment.yaml b/templates/gateway/gateway-deployment.yaml index 60c1f28..6fc6f32 100644 --- a/templates/gateway/gateway-deployment.yaml +++ b/templates/gateway/gateway-deployment.yaml @@ -38,7 +38,9 @@ spec: {{- include "georchestra.common-envs" . | nindent 10 }} {{- include "georchestra.ldap-envs" . | nindent 10 }} {{- include "georchestra.database-georchestra-envs" . | nindent 10 }} + {{- if $rabbitmq.enabled -}} {{- include "georchestra.rabbitmq-georchestra-envs" . | nindent 10 }} + {{- end }} {{- if $webapp.extra_environment }} {{- $webapp.extra_environment | toYaml | nindent 10 }} {{- end }} From ab81bc8fdab63a2e26021a530961154652742240 Mon Sep 17 00:00:00 2001 From: Emilien Devos Date: Mon, 6 Nov 2023 14:41:39 +0100 Subject: [PATCH 13/16] correctly disable by default all the things that are based on rabbitmq --- Chart.yaml | 2 +- templates/console/console-deployment.yaml | 2 +- templates/gateway/gateway-deployment.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Chart.yaml b/Chart.yaml index 058f830..d5ae5ec 100644 --- a/Chart.yaml +++ b/Chart.yaml @@ -32,5 +32,5 @@ dependencies: - name: rabbitmq version: ~12.1.4 repository: "https://charts.bitnami.com/bitnami/" - condition: rabbitmq.builtin, rabbitmq.enabled + condition: rabbitmq.enabled, rabbitmq.builtin alias: rabbitmq diff --git a/templates/console/console-deployment.yaml b/templates/console/console-deployment.yaml index c80958e..1e2413e 100644 --- a/templates/console/console-deployment.yaml +++ b/templates/console/console-deployment.yaml @@ -35,7 +35,7 @@ spec: {{- include "georchestra.common-envs" . | nindent 10 }} {{- include "georchestra.ldap-envs" . | nindent 10 }} {{- include "georchestra.database-georchestra-envs" . | nindent 10 }} - {{- if $rabbitmq.enabled -}} + {{- if .Values.rabbitmq.enabled -}} {{- include "georchestra.rabbitmq-georchestra-envs" . | nindent 10 }} {{- end }} {{- if $webapp.extra_environment }} diff --git a/templates/gateway/gateway-deployment.yaml b/templates/gateway/gateway-deployment.yaml index 6fc6f32..073fc94 100644 --- a/templates/gateway/gateway-deployment.yaml +++ b/templates/gateway/gateway-deployment.yaml @@ -38,7 +38,7 @@ spec: {{- include "georchestra.common-envs" . | nindent 10 }} {{- include "georchestra.ldap-envs" . | nindent 10 }} {{- include "georchestra.database-georchestra-envs" . | nindent 10 }} - {{- if $rabbitmq.enabled -}} + {{- if .Values.rabbitmq.enabled -}} {{- include "georchestra.rabbitmq-georchestra-envs" . | nindent 10 }} {{- end }} {{- if $webapp.extra_environment }} From 8d4f08d6206542cab9d8b607ea47cdb4887f1fb6 Mon Sep 17 00:00:00 2001 From: Emilien Devos Date: Mon, 6 Nov 2023 14:57:59 +0100 Subject: [PATCH 14/16] update chart.lock --- Chart.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Chart.lock b/Chart.lock index dbf65c3..dba515f 100644 --- a/Chart.lock +++ b/Chart.lock @@ -5,5 +5,5 @@ dependencies: - name: rabbitmq repository: https://charts.bitnami.com/bitnami/ version: 12.1.7 -digest: sha256:632c05795534e4ea9a7af2ccddb6ca88968d49eb85c3ccd479ba2509dffb6f97 -generated: "2023-11-02T16:36:51.587369906+01:00" +digest: sha256:be61e7484f2581cd0d28933a0e101ef044932abc76696bd8f240b4e226828960 +generated: "2023-11-06T14:57:29.583497777+01:00" From aae415f7f255e689e52269edaab97ea09e035a40 Mon Sep 17 00:00:00 2001 From: Emilien Devos Date: Mon, 6 Nov 2023 18:17:29 +0100 Subject: [PATCH 15/16] force erlangCookie for helm upgrade --- values.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/values.yaml b/values.yaml index 694be98..caf5e36 100644 --- a/values.yaml +++ b/values.yaml @@ -289,6 +289,7 @@ rabbitmq: auth: username: georchestra password: georchestra + erlangCookie: georchestra # needed only for builtin rabbitmq # host: rabbitmq port: "5672" # existingSecret: mysecret From cc8235b6edccabd471c898faa76aeb6b4cf9b997 Mon Sep 17 00:00:00 2001 From: Emilien Devos Date: Tue, 7 Nov 2023 11:31:29 +0100 Subject: [PATCH 16/16] fix [comments] too few spaces before comment --- values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/values.yaml b/values.yaml index caf5e36..dab962e 100644 --- a/values.yaml +++ b/values.yaml @@ -289,7 +289,7 @@ rabbitmq: auth: username: georchestra password: georchestra - erlangCookie: georchestra # needed only for builtin rabbitmq + erlangCookie: georchestra # needed only for builtin rabbitmq # host: rabbitmq port: "5672" # existingSecret: mysecret