Skip to content

Commit

Permalink
Add migrateOnInit to chart (#184)
Browse files Browse the repository at this point in the history
Signed-off-by: Tyler Auerbeck <tylerauerbeck@users.noreply.github.com>
Co-authored-by: Tyler Auerbeck <tylerauerbeck@users.noreply.github.com>
  • Loading branch information
tylerauerbeck and tylerauerbeck authored Jun 26, 2023
1 parent de8cec3 commit ea5359d
Showing 2 changed files with 21 additions and 0 deletions.
20 changes: 20 additions & 0 deletions chart/load-balancer-api/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -37,6 +37,26 @@ spec:
securityContext:
{{- toYaml .Values.api.podSecurityContext | nindent 8 }}
{{- end }}
{{- if .Values.api.migrateOnInit }}
initContainers:
- name: {{ .Chart.Name }}-migrate
envFrom:
- secretRef:
name: {{ .Values.api.db.uriSecret }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
args:
- migrate
- up
volumeMounts:
{{- if .Values.api.db.certSecret }}
- name: dbcerts
mountPath: "/dbcerts"
readOnly: true
{{- end }}
resources:
{{- toYaml .Values.api.resources | nindent 12 }}
{{- end }}
containers:
- name: {{ .Chart.Name }}
{{- if .Values.api.extraEnvVars }}
1 change: 1 addition & 0 deletions chart/load-balancer-api/values.yaml
Original file line number Diff line number Diff line change
@@ -49,6 +49,7 @@ api:
db:
uriSecret: ""
certSecret: ""
migrateOnInit: false

oidc:
enabled: false

0 comments on commit ea5359d

Please sign in to comment.