Skip to content

Commit

Permalink
Merge pull request #153 from maykinmedia/feature/openforms-setup-conf…
Browse files Browse the repository at this point in the history
…iguration

1.6.0-beta.1 openforms
  • Loading branch information
sjoerdie authored Dec 4, 2024
2 parents ceb50e1 + 9184371 commit a877e67
Show file tree
Hide file tree
Showing 5 changed files with 142 additions and 3 deletions.
4 changes: 2 additions & 2 deletions charts/openforms/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
12 changes: 12 additions & 0 deletions charts/openforms/templates/configuration-data.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
42 changes: 42 additions & 0 deletions charts/openforms/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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 }}
Expand Down
3 changes: 3 additions & 0 deletions charts/openforms/templates/secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
84 changes: 83 additions & 1 deletion charts/openforms/values.yaml
Original file line number Diff line number Diff line change
@@ -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

Expand Down

0 comments on commit a877e67

Please sign in to comment.