diff --git a/charts/openforms/Chart.yaml b/charts/openforms/Chart.yaml index ff53965..c7747fa 100644 --- a/charts/openforms/Chart.yaml +++ b/charts/openforms/Chart.yaml @@ -3,8 +3,8 @@ name: openforms description: Snel en eenvoudig slimme formulieren bouwen en publiceren type: application -version: 1.5.0 -appVersion: 2.8.1 +version: 1.6.0-beta.1 +appVersion: setup-configuration icon: https://open-forms.readthedocs.io/en/stable/_static/logo.svg dependencies: diff --git a/charts/openforms/templates/configuration-data.yaml b/charts/openforms/templates/configuration-data.yaml new file mode 100644 index 0000000..338b4cf --- /dev/null +++ b/charts/openforms/templates/configuration-data.yaml @@ -0,0 +1,12 @@ +{{ if and .Values.global.configuration.enabled .Values.configuration.enabled -}} +apiVersion: v1 +kind: ConfigMap +metadata: +metadata: + name: {{ include "openforms.fullname" . }}-configuration + labels: + {{- include "openforms.labels" . | nindent 4 }} +data: + configuration.yaml: |- + {{- include "common.tplvalues.render" (dict "value" .Values.configuration.data "context" $) | nindent 4 }} +{{- end }} \ No newline at end of file diff --git a/charts/openforms/templates/deployment.yaml b/charts/openforms/templates/deployment.yaml index d0f9737..83a6c19 100644 --- a/charts/openforms/templates/deployment.yaml +++ b/charts/openforms/templates/deployment.yaml @@ -32,6 +32,44 @@ spec: serviceAccountName: {{ include "openforms.serviceAccountName" . }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} + {{- if and .Values.global.configuration.enabled .Values.configuration.enabled .Values.configuration.initContainer.enabled }} + initContainers: + - name: {{ .Chart.Name }}-config + securityContext: + {{- toYaml .Values.securityContext | nindent 16 }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + envFrom: + - secretRef: + name: {{ .Values.existingSecret | default (include "openforms.fullname" .) }} + - configMapRef: + name: {{ include "openforms.fullname" . }} + env: + {{- if .Values.extraEnvVars }} + {{- include "openforms.tplvalues.render" (dict "value" .Values.extraEnvVars "context" $) | nindent 16 }} + {{- end }} + command: + - "/bin/bash" + - "-c" + args: + - | + /app/src/manage.py migrate && + /usr/bin/envsubst < /app/configuration/configuration.yaml > /tmp/configuration.yaml && + /app/src/manage.py setup_configuration --yaml-file /tmp/configuration.yaml + volumeMounts: + - name: media + mountPath: /app/private_media + subPath: {{ .Values.persistence.privateMediaMountSubpath | default "openforms/private_media" }} + - name: media + mountPath: /app/media + subPath: {{ .Values.persistence.mediaMountSubpath | default "openforms/media" }} + - name: configuration + mountPath: /app/configuration/ + readOnly: true + {{- if .Values.extraVolumeMounts }} + {{- include "openforms.tplvalues.render" ( dict "value" .Values.extraVolumeMounts "context" $ ) | nindent 12 }} + {{- end }} + {{- end }} containers: - name: {{ .Chart.Name }} securityContext: @@ -87,6 +125,10 @@ spec: {{- else }} emptyDir: { } {{- end }} + - name: configuration + configMap: + name: {{ include "openforms.fullname" . }}-configuration + defaultMode: 0755 {{- if .Values.extraVolumes }} {{- include "openforms.tplvalues.render" ( dict "value" .Values.extraVolumes "context" $ ) | nindent 8 }} {{- end }} diff --git a/charts/openforms/templates/secret.yaml b/charts/openforms/templates/secret.yaml index c097dd4..57a40c2 100644 --- a/charts/openforms/templates/secret.yaml +++ b/charts/openforms/templates/secret.yaml @@ -19,4 +19,7 @@ stringData: {{- if .Values.settings.email.password }} EMAIL_HOST_PASSWORD: {{ .Values.settings.email.password | toString | quote }} {{- end }} + {{ range .Values.extraSecrets }} + {{ .name }}: {{ .value | toString | quote }} + {{ end }} {{- end }} diff --git a/charts/openforms/values.yaml b/charts/openforms/values.yaml index 7fe4469..e2cab91 100644 --- a/charts/openforms/values.yaml +++ b/charts/openforms/values.yaml @@ -1,9 +1,91 @@ - global: + configuration: + enable: true + + settings: # -- Global databasehost, overrides setting.database.host databaseHost: "" +# extraSecrets Array with extra secrets +# e.g: +# extraSecrets: + # - name: objecttypen-test-token + # value: Token 171be5abaf41e7856b423ad513df1ef8f867ff48 + # - name: objecten-test-token + # value: Token 7657474c3d75f56ae0abd0d1bf7994b09964dca9 + # - name: documenten-test-secret + # value: doc-supersecret + # - name: catalogi-test-secret + # value: cat-supersecret + +extraSecrets: [] + +configuration: + enable: false + # data: {} + # e.g. + # data: |- + # zgw_consumers_config_enable: True + # zgw_consumers: + # services: + # - identifier: objecttypen-test + # label: Objecttypen API test + # api_root: http://objecttypes-web:8000/api/v2/ + # api_type: orc + # auth_type: api_key + # header_key: Authorization + # header_value: '${objecttypen-test-token}' + + # - identifier: objecten-test + # label: Objecten API test + # api_root: http://objects-web:8000/api/v2/ + # api_type: orc + # auth_type: api_key + # header_key: Authorization + # header_value: '${objecten-test-token}' + + # - identifier: documenten-test + # label: Documenten API test + # api_root: http://openzaak-web.local:8000/documenten/api/v1/ + # api_type: drc + # auth_type: zgw + # client_id: test_client_id + # secret: '${documenten-test-secret}' + + # - identifier: catalogi-test + # label: Catalogi API test + # api_root: http://openzaak-web.local:8000/catalogi/api/v1/ + # api_type: ztc + # auth_type: zgw + # client_id: test_client_id + # secret: '${catalogi-test-secret}' + + # objects_api_config_enable: True + # objects_api: + # groups: + # - name: Config 1 + # identifier: config-1 + # objects_service_identifier: objecten-test + # objecttypes_service_identifier: objecttypen-test + # drc_service_identifier: documenten-test + # catalogi_service_identifier: catalogi-test + # catalogue_domain: TEST + # catalogue_rsin: "000000000" + # organisatie_rsin: "000000000" + # iot_submission_report: PDF Informatieobjecttype + # iot_submission_csv: CSV Informatieobjecttype + # iot_attachment: Attachment Informatieobjecttype + # - name: Config 2 + # identifier: config-2 + # objects_service_identifier: objecten-test + # objecttypes_service_identifier: objecttypen-test + # drc_service_identifier: documenten-test + # catalogi_service_identifier: catalogi-test + # catalogue_domain: OTHER + # catalogue_rsin: "000000000" + # organisatie_rsin: "000000000" + tags: redis: true