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 1/4] 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 From b9b35cb77d08a933a34fbf7b7b0f02c5008c3271 Mon Sep 17 00:00:00 2001 From: Tommy Skaug <104122981+tommy-skaug@users.noreply.github.com> Date: Sat, 6 Apr 2024 18:01:17 +0200 Subject: [PATCH 2/4] Update values.yaml --- charts/paperless-ngx/values.yaml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/charts/paperless-ngx/values.yaml b/charts/paperless-ngx/values.yaml index db0651f..df6cff7 100644 --- a/charts/paperless-ngx/values.yaml +++ b/charts/paperless-ngx/values.yaml @@ -7,6 +7,20 @@ config: persistence: existingClaim: paperless-ngx-server +initContainers: + dbInit: + image: + repository: ghcr.io/onedr0p/postgres-init + tag: "16" + envFrom: + - secretRef: + name: paperless-ngx-secret + +envFromSecret: paperless-ngx-secret + image: repository: ghcr.io/paperless-ngx/paperless-ngx - tag: v2.7.0 \ No newline at end of file + tag: v2.7.0 + +postgres: + secretName: paperless-ngx-secret From aca3d1f45de742baba9ae9900535f27d7d7875e0 Mon Sep 17 00:00:00 2001 From: Tommy Skaug <104122981+tommy-skaug@users.noreply.github.com> Date: Sat, 6 Apr 2024 18:02:23 +0200 Subject: [PATCH 3/4] feat: add envFromSecret --- charts/paperless-ngx/templates/deployment-server.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/charts/paperless-ngx/templates/deployment-server.yaml b/charts/paperless-ngx/templates/deployment-server.yaml index 32bd441..6df0744 100644 --- a/charts/paperless-ngx/templates/deployment-server.yaml +++ b/charts/paperless-ngx/templates/deployment-server.yaml @@ -31,6 +31,9 @@ metadata: value: /PATHPREFIX - name: PAPERLESS_STATIC_URL value: /PATHPREFIX/static/ + envFrom: &envFrom + - secretRef: + name: {{ .Values.envFromSecret }} resources: limits: memory: "128Mi" @@ -45,4 +48,4 @@ metadata: volumes: - name: {{ include "paperless-ngx.fullname" . }}-server persistentVolumeClaim: - claimName: {{ .Values.persistence.existingClaim }} \ No newline at end of file + claimName: {{ .Values.persistence.existingClaim }} From c1cced3dc57037a6f0dc94e010a498d19ce8325c Mon Sep 17 00:00:00 2001 From: Tommy Skaug <104122981+tommy-skaug@users.noreply.github.com> Date: Sat, 6 Apr 2024 18:02:54 +0200 Subject: [PATCH 4/4] chore: bump chart version for paperless --- charts/paperless-ngx/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/paperless-ngx/Chart.yaml b/charts/paperless-ngx/Chart.yaml index 32e0956..801a4b4 100644 --- a/charts/paperless-ngx/Chart.yaml +++ b/charts/paperless-ngx/Chart.yaml @@ -4,7 +4,7 @@ description: | document management system that transforms your physical documents into a searchable online archive appVersion: v2.7.0 type: application -version: 0.1.0 +version: 0.1.1 maintainers: - name: Tommy Skaug email: tommy@skaug.me