Browse Source

lingding - replace boilerplate with template

Stavros kois 1 năm trước cách đây
mục cha
commit
a55582d3eb

+ 1 - 1
library/ix-dev/community/linkding/Chart.yaml

@@ -3,7 +3,7 @@ description: Linkding is a bookmark manager that you can host yourself.
 annotations:
   title: Linkding
 type: application
-version: 1.1.3
+version: 1.1.4
 apiVersion: v2
 appVersion: 1.22.3
 kubeVersion: '>=1.16.0-0'

+ 4 - 31
library/ix-dev/community/linkding/templates/_persistence.tpl

@@ -56,35 +56,8 @@ persistence:
           mountPath: /mnt/directories{{ $storage.mountPath }}
   {{- end }}
 
-  {{/* Database */}}
-  postgresdata:
-    enabled: true
-    type: {{ .Values.linkdingStorage.pgData.type }}
-    datasetName: {{ .Values.linkdingStorage.pgData.datasetName | default "" }}
-    hostPath: {{ .Values.linkdingStorage.pgData.hostPath | default "" }}
-    targetSelector:
-      # Postgres pod
-      postgres:
-        # Postgres container
-        postgres:
-          mountPath: /var/lib/postgresql/data
-        # Postgres - Permissions container
-        # Different than the 01-permissions
-        permissions:
-          mountPath: /mnt/directories/postgres_data
-  postgresbackup:
-    enabled: true
-    type: {{ .Values.linkdingStorage.pgBackup.type }}
-    datasetName: {{ .Values.linkdingStorage.pgBackup.datasetName | default "" }}
-    hostPath: {{ .Values.linkdingStorage.pgBackup.hostPath | default "" }}
-    targetSelector:
-      # Postgres backup pod
-      postgresbackup:
-        # Postgres backup container
-        postgresbackup:
-          mountPath: /postgres_backup
-        # Postgres - Permissions container
-        # Different than the 01-permissions
-        permissions:
-          mountPath: /mnt/directories/postgres_backup
+  {{- include "ix.v1.common.app.postgresPersistence"
+      (dict "pgData" .Values.linkdingStorage.pgData
+            "pgBackup" .Values.linkdingStorage.pgBackup
+      ) | nindent 2 }}
 {{- end -}}

+ 1 - 11
library/ix-dev/community/linkding/templates/_service.tpl

@@ -12,15 +12,5 @@ service:
         port: {{ .Values.linkdingNetwork.webPort }}
         nodePort: {{ .Values.linkdingNetwork.webPort }}
         targetSelector: linkding
-  postgres:
-    enabled: true
-    type: ClusterIP
-    targetSelector: postgres
-    ports:
-      postgres:
-        enabled: true
-        primary: true
-        port: 5432
-        targetPort: 5432
-        targetSelector: postgres
+  {{- include "ix.v1.common.app.postgresService" $ | nindent 2 }}
 {{- end -}}