-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #58 from regulaforensics/sp-20484-database-initial…
…ization-improvements SP-20484 database init improvements
- Loading branch information
Showing
5 changed files
with
88 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
{{- if or .Values.config.service.sessionApi.enabled .Values.config.sdk.rfid.chipVerification.enabled }} | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: {{ include "docreader.migration" . }} | ||
labels: {{- include "docreader.labels" . | nindent 4 }} | ||
annotations: | ||
"helm.sh/hook": pre-upgrade | ||
spec: | ||
backoffLimit: 1 | ||
template: | ||
metadata: | ||
annotations: | ||
{{- if .Values.podAnnotations }} | ||
{{- toYaml .Values.podAnnotations | nindent 8 }} | ||
{{- end }} | ||
labels: {{- include "docreader.selectorLabels" . | nindent 8 }} | ||
spec: | ||
serviceAccountName: {{ include "docreader.serviceAccount" . }} | ||
{{- with .Values.nodeSelector }} | ||
nodeSelector: {{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- if .Values.priorityClassName }} | ||
priorityClassName: {{ .Values.priorityClassName }} | ||
{{- end }} | ||
{{- with .Values.terminationGracePeriodSeconds }} | ||
terminationGracePeriodSeconds: {{ . }} | ||
{{- end }} | ||
{{- with .Values.affinity }} | ||
affinity: {{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.tolerations }} | ||
tolerations: {{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.topologySpreadConstraints }} | ||
topologySpreadConstraints: {{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.imagePullSecrets }} | ||
imagePullSecrets: {{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} | ||
restartPolicy: Never | ||
containers: | ||
- name: {{ include "docreader.migration" . }} | ||
securityContext: {{- toYaml .Values.securityContext | nindent 12 }} | ||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" | ||
imagePullPolicy: {{ .Values.image.pullPolicy }} | ||
command: | ||
- pipenv | ||
- run | ||
- python | ||
- src/main.py | ||
- migrate | ||
env: | ||
{{- include "docreader.envs" . | indent 10 }} | ||
{{- if and (not .Values.postgresql.enabled) .Values.config.service.database.connectionStringSecretName }} | ||
- name: SQL_CONNECTION_STRING | ||
valueFrom: | ||
secretKeyRef: | ||
name: {{ template "docreader.db.credentials.secret" . }} | ||
key: SQL_CONNECTION_STRING | ||
{{- end }} | ||
volumeMounts: | ||
- name: docreader-config | ||
mountPath: /app/config.yaml | ||
subPath: config.yaml | ||
readOnly: true | ||
volumes: | ||
- name: docreader-config | ||
configMap: | ||
name: {{ include "docreader.config.name" . }} | ||
{{- end }} |