2023-05-17 05:26:11 +09:00
|
|
|
apiVersion: batch/v1
|
|
|
|
kind: Job
|
|
|
|
metadata:
|
2023-08-21 23:14:53 +09:00
|
|
|
name: {{ include "iceshrimp.fullname" . }}-db-migrate
|
2023-05-17 05:26:11 +09:00
|
|
|
labels:
|
2023-08-21 23:14:53 +09:00
|
|
|
{{- include "iceshrimp.labels" . | nindent 4 }}
|
2023-05-17 05:26:11 +09: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:
|
2023-08-21 23:14:53 +09:00
|
|
|
name: {{ include "iceshrimp.fullname" . }}-db-migrate
|
2023-05-17 05:26:11 +09:00
|
|
|
{{- with .Values.podAnnotations }}
|
|
|
|
annotations:
|
|
|
|
{{- toYaml . | nindent 8 }}
|
|
|
|
{{- end }}
|
|
|
|
spec:
|
|
|
|
restartPolicy: Never
|
|
|
|
{{- with .Values.imagePullSecrets }}
|
|
|
|
imagePullSecrets:
|
|
|
|
{{- toYaml . | nindent 8 }}
|
|
|
|
{{- end }}
|
2023-08-21 23:14:53 +09:00
|
|
|
serviceAccountName: {{ include "iceshrimp.serviceAccountName" . }}
|
2023-05-17 05:26:11 +09:00
|
|
|
securityContext:
|
|
|
|
{{- toYaml .Values.podSecurityContext | nindent 8 }}
|
|
|
|
volumes:
|
|
|
|
- name: config-volume
|
|
|
|
secret:
|
2023-08-21 23:14:53 +09:00
|
|
|
secretName: {{ template "iceshrimp.fullname" . }}-config
|
2023-05-17 05:26:11 +09: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:
|
|
|
|
- pnpm
|
|
|
|
- run
|
|
|
|
- migrate
|
|
|
|
env:
|
|
|
|
- name: "NODE_ENV"
|
|
|
|
value: "production"
|
|
|
|
volumeMounts:
|
|
|
|
- name: config-volume
|
2023-08-21 23:14:53 +09:00
|
|
|
mountPath: /iceshrimp/.config
|
2023-05-17 05:26:11 +09: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 }}
|