diff --git a/charts/paperless-ngx/templates/db-init.yaml b/charts/paperless-ngx/templates/db-init.yaml new file mode 100644 index 0000000..2499b62 --- /dev/null +++ b/charts/paperless-ngx/templates/db-init.yaml @@ -0,0 +1,21 @@ +apiVersion: batch/v1 +kind: Job +metadata: + name: {{ include "paperless-ngx.fullname" . }}-db-init + labels: + {{- include "paperless-ngx.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": pre-install + "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded +spec: + template: + spec: + restartPolicy: Never + containers: + - name: general-db-init + image: "{{ .Values.initContainers.dbInit.image.repository }}:{{ .Values.initContainers.dbInit.image.tag }}" + envFrom: + - secretRef: + name: {{ .Values.postgres.secretName }} + # Tolerate a few failures, adjust the number as needed + backoffLimit: 3