1 {{- if (and (.Values.runMigrations) (not (eq .Values.env.database "off"))) }}
5 name: {{ template "kong.fullname" . }}-init-migrations
7 {{- include "kong.metaLabels" . | nindent 4 }}
8 app.kubernetes.io/component: init-migrations
12 name: {{ template "kong.name" . }}-init-migrations
14 {{- include "kong.metaLabels" . | nindent 8 }}
15 app.kubernetes.io/component: init-migrations
17 {{- if .Values.podSecurityPolicy.enabled }}
18 serviceAccountName: {{ template "kong.serviceAccountName" . }}
20 {{- if .Values.image.pullSecrets }}
22 {{- range .Values.image.pullSecrets }}
27 {{- if (eq .Values.env.database "postgres") }}
28 {{- include "kong.wait-for-postgres" . | nindent 6 }}
31 - name: {{ template "kong.name" . }}-migrations
32 image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
33 imagePullPolicy: {{ .Values.image.pullPolicy }}
35 {{- include "kong.final_env" . | nindent 8 }}
36 command: [ "/bin/sh", "-c", "kong migrations bootstrap" ]
38 {{- include "kong.volumeMounts" . | nindent 8 }}
40 {{- include "kong.podsecuritycontext" . | nindent 8 }}
41 restartPolicy: OnFailure
43 {{- include "kong.volumes" . | nindent 6 -}}