Initial commit
This commit is contained in:
51
helm/tline/templates/job-migrate.yaml.tpl
Normal file
51
helm/tline/templates/job-migrate.yaml.tpl
Normal file
@@ -0,0 +1,51 @@
|
||||
{{- if .Values.jobs.migrate.enabled -}}
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
name: {{ include "tline.componentName" (dict "Values" .Values "Chart" .Chart "Release" .Release "component" "migrate") }}
|
||||
labels:
|
||||
{{ include "tline.labels" . | indent 4 }}
|
||||
app.kubernetes.io/component: migrate
|
||||
annotations:
|
||||
"helm.sh/hook": pre-install,pre-upgrade
|
||||
"helm.sh/hook-weight": "-10"
|
||||
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
|
||||
spec:
|
||||
backoffLimit: 3
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
{{ include "tline.selectorLabels" . | indent 8 }}
|
||||
app.kubernetes.io/component: migrate
|
||||
spec:
|
||||
restartPolicy: Never
|
||||
{{ include "tline.imagePullSecrets" . | indent 6 }}
|
||||
{{- $aff := include "tline.affinity" (dict "Values" .Values "schedulingClass" .Values.postgres.schedulingClass) }}
|
||||
{{- if $aff }}
|
||||
affinity:
|
||||
{{ $aff | indent 8 }}
|
||||
{{- end }}
|
||||
{{- $tols := include "tline.tolerations" (dict "Values" .Values "schedulingClass" .Values.postgres.schedulingClass) }}
|
||||
{{- if $tols }}
|
||||
tolerations:
|
||||
{{ $tols | indent 8 }}
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: migrate
|
||||
{{- $img := fromYaml (include "tline.migrateImage" .) }}
|
||||
image: {{ $img.image | quote }}
|
||||
imagePullPolicy: {{ $img.pullPolicy }}
|
||||
command:
|
||||
- bun
|
||||
- run
|
||||
- packages/db/src/migrate.ts
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: {{ include "tline.componentName" (dict "Values" .Values "Chart" .Chart "Release" .Release "component" "config") }}
|
||||
env:
|
||||
- name: POSTGRES_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ include "tline.secretName" . }}
|
||||
key: POSTGRES_PASSWORD
|
||||
{{- end }}
|
||||
Reference in New Issue
Block a user