Skip to content

Commit

Permalink
immich: use templates to reduce boilerplate
Browse files Browse the repository at this point in the history
  • Loading branch information
stavros-k committed Nov 2, 2023
1 parent eed3290 commit 24f252d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 41 deletions.
34 changes: 4 additions & 30 deletions library/ix-dev/community/immich/templates/_persistence.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 -}}
13 changes: 2 additions & 11 deletions library/ix-dev/community/immich/templates/_service.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 -}}

0 comments on commit 24f252d

Please sign in to comment.