浏览代码

immich: use templates to reduce boilerplate

Stavros kois 1 年之前
父节点
当前提交
cdb18d2162

+ 4 - 30
library/ix-dev/community/immich/templates/_persistence.tpl

@@ -117,34 +117,8 @@ persistence:
           mountPath: /tmp
 
   {{/* Database */}}
-  postgresdata:
-    enabled: true
-    type: {{ .Values.immichStorage.pgData.type }}
-    datasetName: {{ .Values.immichStorage.pgData.datasetName | default "" }}
-    hostPath: {{ .Values.immichStorage.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.immichStorage.pgBackup.type }}
-    datasetName: {{ .Values.immichStorage.pgBackup.datasetName | default "" }}
-    hostPath: {{ .Values.immichStorage.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.immichStorage.pgData
+            "pgBackup" .Values.immichStorage.pgBackup
+      ) | nindent 2 }}
 {{- end -}}

+ 2 - 11
library/ix-dev/community/immich/templates/_service.tpl

@@ -91,15 +91,6 @@ service:
         targetPort: 6379
         targetSelector: redis
 
-  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 -}}