From 73a2d132514667641dfa91ac43972450ad6b8393 Mon Sep 17 00:00:00 2001 From: Tommy Skaug <104122981+tommy-skaug@users.noreply.github.com> Date: Sat, 6 Apr 2024 17:59:09 +0200 Subject: [PATCH] feat: create db-init.yaml for paperless-ngx --- charts/paperless-ngx/templates/db-init.yaml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 charts/paperless-ngx/templates/db-init.yaml 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