From 62e8b0f2097817bb7181620d1ce9b0737009eb2d Mon Sep 17 00:00:00 2001 From: Martin Gruner Date: Tue, 21 Nov 2023 15:26:29 +0100 Subject: [PATCH] Fixes: #234 - customInit: Can't find config setting --- zammad/Chart.yaml | 2 +- zammad/templates/configmap-init.yaml | 2 +- zammad/templates/statefulset.yaml | 38 ++++++++++++++++------------ 3 files changed, 24 insertions(+), 18 deletions(-) diff --git a/zammad/Chart.yaml b/zammad/Chart.yaml index 79d1cc43..f700b04b 100644 --- a/zammad/Chart.yaml +++ b/zammad/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: zammad -version: 10.1.0 +version: 10.1.1 appVersion: 6.1.0-24 description: Zammad is a web based open source helpdesk/customer support system with many features to manage customer communication via several channels like telephone, facebook, twitter, chat and e-mails. home: https://zammad.org diff --git a/zammad/templates/configmap-init.yaml b/zammad/templates/configmap-init.yaml index 9bf9e7df..4d286768 100644 --- a/zammad/templates/configmap-init.yaml +++ b/zammad/templates/configmap-init.yaml @@ -37,6 +37,6 @@ data: echo "${AUTOWIZARD_JSON}" | base64 -d > /opt/zammad/var/auto_wizard.json fi {{- with .Values.zammadConfig.initContainers.zammad.customInit }} - {{- toYaml . | nindent 4 }} + {{- . | nindent 4 }} {{- end }} echo "zammad init complete :)" diff --git a/zammad/templates/statefulset.yaml b/zammad/templates/statefulset.yaml index 3e16a696..0d8fdb03 100644 --- a/zammad/templates/statefulset.yaml +++ b/zammad/templates/statefulset.yaml @@ -66,7 +66,7 @@ spec: - name: {{ template "zammad.fullname" . }}-var mountPath: /opt/zammad/var {{- end }} - - name: zammad-init + - name: postgresql-init image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} env: @@ -81,21 +81,21 @@ spec: value: "{{ if .Values.zammadConfig.memcached.enabled }}{{ .Release.Name }}-memcached{{ else }}{{ .Values.zammadConfig.memcached.host }}{{ end }}:{{ .Values.zammadConfig.memcached.port }}" - name: REDIS_URL value: "redis://:$(REDIS_PASSWORD)@{{ if .Values.zammadConfig.redis.enabled }}{{ .Release.Name }}-redis-master{{ else }}{{ .Values.zammadConfig.redis.host }}{{ end }}:{{ .Values.zammadConfig.redis.port }}" - {{- if .Values.autoWizard.enabled }} - - name: AUTOWIZARD_JSON + - name: POSTGRESQL_PASS valueFrom: secretKeyRef: - name: {{ template "zammad.autowizardSecretName" . }} - key: {{ .Values.secrets.autowizard.secretKey }} - {{- end }} + name: {{ template "zammad.postgresqlSecretName" . }} + key: {{ .Values.secrets.postgresql.secretKey }} + - name: DATABASE_URL + value: "postgres://{{ .Values.zammadConfig.postgresql.user }}:$(POSTGRESQL_PASS)@{{ if .Values.zammadConfig.postgresql.enabled }}{{ .Release.Name }}-postgresql{{ else }}{{ .Values.zammadConfig.postgresql.host }}{{ end }}:{{ .Values.zammadConfig.postgresql.port }}/{{ .Values.zammadConfig.postgresql.db }}" {{- if .Values.extraEnv }} - {{- toYaml .Values.extraEnv | nindent 12 }} + {{- toYaml .Values.extraEnv | nindent 12 }} {{- end }} - {{- with .Values.zammadConfig.initContainers.zammad.resources }} + {{- with .Values.zammadConfig.initContainers.postgresql.resources }} resources: {{- toYaml . | nindent 12 }} {{- end }} - {{- with .Values.zammadConfig.initContainers.zammad.securityContext }} + {{- with .Values.zammadConfig.initContainers.postgresql.securityContext }} securityContext: {{- toYaml . | nindent 12 }} {{- end }} @@ -103,14 +103,14 @@ spec: - name: {{ template "zammad.fullname" . }}-init mountPath: /docker-entrypoint.sh readOnly: true - subPath: zammad-init + subPath: postgresql-init - name: {{ template "zammad.fullname" . }}-tmp mountPath: /opt/zammad/tmp - name: {{ template "zammad.fullname" . }}-var mountPath: /opt/zammad/storage - name: {{ template "zammad.fullname" . }}-var mountPath: /opt/zammad/var - - name: postgresql-init + - name: zammad-init image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} env: @@ -131,15 +131,21 @@ spec: name: {{ template "zammad.postgresqlSecretName" . }} key: {{ .Values.secrets.postgresql.secretKey }} - name: DATABASE_URL - value: "postgres://{{ .Values.zammadConfig.postgresql.user }}:$(POSTGRESQL_PASS)@{{ if .Values.zammadConfig.postgresql.enabled }}{{ .Release.Name }}-postgresql{{ else }}{{ .Values.zammadConfig.postgresql.host }}{{ end }}:{{ .Values.zammadConfig.postgresql.port }}/{{ .Values.zammadConfig.postgresql.db }}" + value: "postgres://{{ .Values.zammadConfig.postgresql.user }}:$(POSTGRESQL_PASS)@{{ if .Values.zammadConfig.postgresql.enabled }}{{ .Release.Name }}-postgresql{{ else }}{{ .Values.zammadConfig.postgresql.host }}{{ end }}:{{ .Values.zammadConfig.postgresql.port }}/{{ .Values.zammadConfig.postgresql.db }}" {{- if .Values.autoWizard.enabled }} + - name: AUTOWIZARD_JSON + valueFrom: + secretKeyRef: + name: {{ template "zammad.autowizardSecretName" . }} + key: {{ .Values.secrets.autowizard.secretKey }} + {{- end }} {{- if .Values.extraEnv }} - {{- toYaml .Values.extraEnv | nindent 12 }} + {{- toYaml .Values.extraEnv | nindent 12 }} {{- end }} - {{- with .Values.zammadConfig.initContainers.postgresql.resources }} + {{- with .Values.zammadConfig.initContainers.zammad.resources }} resources: {{- toYaml . | nindent 12 }} {{- end }} - {{- with .Values.zammadConfig.initContainers.postgresql.securityContext }} + {{- with .Values.zammadConfig.initContainers.zammad.securityContext }} securityContext: {{- toYaml . | nindent 12 }} {{- end }} @@ -147,7 +153,7 @@ spec: - name: {{ template "zammad.fullname" . }}-init mountPath: /docker-entrypoint.sh readOnly: true - subPath: postgresql-init + subPath: zammad-init - name: {{ template "zammad.fullname" . }}-tmp mountPath: /opt/zammad/tmp - name: {{ template "zammad.fullname" . }}-var