Update Kong ingress controller to version 1.4. It fixes the occasional 404 error.
[ric-plt/ric-dep.git] / helm / infrastructure / subcharts / kong / templates / migrations.yaml
1 {{- if (and (.Values.runMigrations) (not (eq .Values.env.database "off"))) }}
2 apiVersion: batch/v1
3 kind: Job
4 metadata:
5   name: {{ template "kong.fullname" . }}-init-migrations
6   labels:
7     {{- include "kong.metaLabels" . | nindent 4 }}
8     app.kubernetes.io/component: init-migrations
9 spec:
10   template:
11     metadata:
12       name: {{ template "kong.name" . }}-init-migrations
13       labels:
14         {{- include "kong.metaLabels" . | nindent 8 }}
15         app.kubernetes.io/component: init-migrations
16     spec:
17       {{- if .Values.podSecurityPolicy.enabled }}
18       serviceAccountName: {{ template "kong.serviceAccountName" . }}
19       {{- end }}
20       {{- if .Values.image.pullSecrets }}
21       imagePullSecrets:
22       {{- range .Values.image.pullSecrets }}
23         - name: {{ . }}
24       {{- end }}
25       {{- end }}
26       initContainers:
27       {{- if (eq .Values.env.database "postgres") }}
28       {{- include "kong.wait-for-postgres" . | nindent 6 }}
29       {{- end }}
30       containers:
31       - name: {{ template "kong.name" . }}-migrations
32         image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
33         imagePullPolicy: {{ .Values.image.pullPolicy }}
34         env:
35         {{- include "kong.final_env" . | nindent 8 }}
36         command: [ "/bin/sh", "-c", "kong migrations bootstrap" ]
37         volumeMounts:
38         {{- include "kong.volumeMounts" . | nindent 8 }}
39       securityContext:
40       {{- include "kong.podsecuritycontext" . | nindent 8 }}
41       restartPolicy: OnFailure
42       volumes:
43       {{- include "kong.volumes" . | nindent 6 -}}
44 {{- end }}