Skip to content

Commit

Permalink
🐛 Add init container openklant
Browse files Browse the repository at this point in the history
  • Loading branch information
SilviaAmAm committed Dec 20, 2024
1 parent 2ee7701 commit a13ed4b
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 3 deletions.
2 changes: 1 addition & 1 deletion charts/openklant/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: openklant
description: Project dat de Klanten API | https://klanten-api.vng.cloud en Contactmomenten API | https://contactmomenten-api.vng.cloud/ in een enkel component combineert.

type: application
version: 1.4.0-beta.3
version: 1.4.0-beta.4
appVersion: latest

dependencies:
Expand Down
41 changes: 39 additions & 2 deletions charts/openklant/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,45 @@ spec:
serviceAccountName: {{ include "openklant.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
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 "openklant.fullname" .) }}
- secretRef:
name: {{ include "openklant.fullname" . }}-config-secrets
- configMapRef:
name: {{ include "openklant.fullname" . }}
env:
{{- if .Values.extraEnvVars }}
{{- include "openklant.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 "openklant/private_media" }}
- name: media
mountPath: /app/media
subPath: {{ .Values.persistence.mediaMountSubpath | default "openklant/media" }}
- name: configuration
mountPath: /app/configuration/
readOnly: true
{{- if .Values.extraVolumeMounts }}
{{- include "openklant.tplvalues.render" ( dict "value" .Values.extraVolumeMounts "context" $ ) | nindent 12 }}
{{- end }}
{{- end }}
containers:
- name: {{ .Chart.Name }}
securityContext:
Expand All @@ -41,8 +80,6 @@ spec:
envFrom:
- secretRef:
name: {{ .Values.existingSecret | default (include "openklant.fullname" .) }}
- secretRef:
name: {{ include "openklant.fullname" . }}-config-secrets
- configMapRef:
name: {{ include "openklant.fullname" . }}
env:
Expand Down

0 comments on commit a13ed4b

Please sign in to comment.