-
Notifications
You must be signed in to change notification settings - Fork 2
/
job.yaml
40 lines (40 loc) · 1.25 KB
/
job.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
apiVersion: batch/v1
kind: Job
metadata:
name: {{ template "hook" . }}
labels:
{{- include "labels" . | nindent 4 }}
annotations:
# This is what defines this resource as a hook. Without this line, the
# job is considered part of the release.
"helm.sh/hook": "post-install,post-upgrade"
"helm.sh/hook-delete-policy": "before-hook-creation,hook-succeeded"
"helm.sh/hook-weight": "0"
spec:
# Because if we use internal database, in first time install chart database need time to boot up for that reason job may be fail,
# we should give it retry more time.
backoffLimit: 5
template:
metadata:
labels:
{{- include "labels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
restartPolicy: Never
containers:
- name: job
image: "{{ .Values.php.image.repository }}:{{ .Values.php.image.tag }}"
command:
- docker-entrypoint
args:
- "./yii"
- "migrate/up"
- "--interactive 0"
envFrom:
- configMapRef:
name: {{ template "php" . }}
- secretRef:
name: {{ template "php" . }}