From 3c93f5ee8d0fc8a370caf9b363bc810ea2773eac Mon Sep 17 00:00:00 2001 From: Stavros kois Date: Mon, 6 Nov 2023 19:51:56 +0200 Subject: [PATCH] n8n - replace boilerplate with template --- .../community/n8n/templates/_persistence.tpl | 36 ++++--------------- .../community/n8n/templates/_service.tpl | 13 ++----- 2 files changed, 8 insertions(+), 41 deletions(-) diff --git a/library/ix-dev/community/n8n/templates/_persistence.tpl b/library/ix-dev/community/n8n/templates/_persistence.tpl index 4d6c577235..ce7c046feb 100644 --- a/library/ix-dev/community/n8n/templates/_persistence.tpl +++ b/library/ix-dev/community/n8n/templates/_persistence.tpl @@ -45,36 +45,12 @@ persistence: 01-permissions: mountPath: /mnt/directories{{ $storage.mountPath }} {{- end }} - # Postgres - postgresdata: - enabled: true - type: {{ .Values.n8nStorage.pgData.type }} - datasetName: {{ .Values.n8nStorage.pgData.datasetName | default "" }} - hostPath: {{ .Values.n8nStorage.pgData.hostPath | default "" }} - targetSelector: - # Postgres pod - postgres: - # Postgres container - postgres: - mountPath: /var/lib/postgresql/data - # Permissions container - permissions: - mountPath: /mnt/directories/postgres_data - # Postgres backup - postgresbackup: - enabled: true - type: {{ .Values.n8nStorage.pgBackup.type }} - datasetName: {{ .Values.n8nStorage.pgBackup.datasetName | default "" }} - hostPath: {{ .Values.n8nStorage.pgBackup.hostPath | default "" }} - targetSelector: - # Postgres backup pod - postgresbackup: - # Postgres backup container - postgresbackup: - mountPath: /postgres_backup - # Permissions container - permissions: - mountPath: /mnt/directories/postgres_backup + + {{- include "ix.v1.common.app.postgresPersistence" + (dict "pgData" .Values.n8nStorage.pgData + "pgBackup" .Values.n8nStorage.pgBackup + ) | nindent 2 }} + {{- if .Values.n8nNetwork.certificateID }} cert: enabled: true diff --git a/library/ix-dev/community/n8n/templates/_service.tpl b/library/ix-dev/community/n8n/templates/_service.tpl index 13232cd107..0b32c9a5f6 100644 --- a/library/ix-dev/community/n8n/templates/_service.tpl +++ b/library/ix-dev/community/n8n/templates/_service.tpl @@ -24,15 +24,6 @@ service: port: 6379 targetPort: 6379 targetSelector: redis - # Postgres - postgres: - enabled: true - type: ClusterIP - targetSelector: postgres - ports: - postgres: - enabled: true - primary: true - port: 5432 - targetSelector: postgres + {{- include "ix.v1.common.app.postgresService" $ | nindent 2 }} + {{- end -}}