trashposs/chart/templates/job-db-migrate.yaml

60 lines
1.8 KiB
YAML
Raw Normal View History

2023-05-16 22:26:11 +02:00
apiVersion: batch/v1
kind: Job
metadata:
2024-04-06 23:55:59 +02:00
name: {{ include "trashposs.fullname" . }}-db-migrate
2023-05-16 22:26:11 +02:00
labels:
2024-04-06 23:55:59 +02:00
{{- include "trashposs.labels" . | nindent 4 }}
2023-05-16 22:26:11 +02:00
annotations:
"helm.sh/hook": post-install,pre-upgrade
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
"helm.sh/hook-weight": "-2"
spec:
template:
metadata:
2024-04-06 23:55:59 +02:00
name: {{ include "trashposs.fullname" . }}-db-migrate
2023-05-16 22:26:11 +02:00
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
restartPolicy: Never
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
2024-04-06 23:55:59 +02:00
serviceAccountName: {{ include "trashposs.serviceAccountName" . }}
2023-05-16 22:26:11 +02:00
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
volumes:
- name: config-volume
secret:
2024-04-06 23:55:59 +02:00
secretName: {{ template "trashposs.fullname" . }}-config
2023-05-16 22:26:11 +02:00
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
command:
2024-01-07 13:51:12 +01:00
- yarn
2023-05-16 22:26:11 +02:00
- run
2024-01-14 20:36:37 +01:00
- migrate
2023-05-16 22:26:11 +02:00
env:
- name: "NODE_ENV"
value: "production"
volumeMounts:
- name: config-volume
2024-04-06 23:55:59 +02:00
mountPath: /trashposs/.config
2023-05-16 22:26:11 +02:00
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}