aboutsummaryrefslogtreecommitdiff
path: root/roles/photos/files/postgres
diff options
context:
space:
mode:
authorAaditya Dhruv <[email protected]>2025-04-22 17:29:46 -0500
committerAaditya Dhruv <[email protected]>2025-05-01 20:19:51 -0500
commit55298a51cb0cc5e68c5a43869f2f32b899d3a622 (patch)
tree50d271288502bcff6f0a5133ce0839d883ee8ef7 /roles/photos/files/postgres
init
Diffstat (limited to 'roles/photos/files/postgres')
-rw-r--r--roles/photos/files/postgres/Chart.yaml6
-rw-r--r--roles/photos/files/postgres/templates/database.yaml37
-rw-r--r--roles/photos/files/postgres/templates/pv.yaml16
-rw-r--r--roles/photos/files/postgres/templates/pvc.yaml14
-rw-r--r--roles/photos/files/postgres/templates/service.yaml12
5 files changed, 85 insertions, 0 deletions
diff --git a/roles/photos/files/postgres/Chart.yaml b/roles/photos/files/postgres/Chart.yaml
new file mode 100644
index 0000000..f64d74d
--- /dev/null
+++ b/roles/photos/files/postgres/Chart.yaml
@@ -0,0 +1,6 @@
+apiVersion: v2
+name: pgvectors
+description: Postgres chart with pgvector extension
+type: application
+
+version: 0.1.0
diff --git a/roles/photos/files/postgres/templates/database.yaml b/roles/photos/files/postgres/templates/database.yaml
new file mode 100644
index 0000000..098a410
--- /dev/null
+++ b/roles/photos/files/postgres/templates/database.yaml
@@ -0,0 +1,37 @@
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: "immich-postgres-deployment"
+ labels:
+ app: "immich-db"
+spec:
+ replicas: 1
+ selector:
+ matchLabels:
+ app: "immich-db"
+ template:
+ metadata:
+ labels:
+ app: "immich-db"
+ spec:
+ containers:
+ - name: immich-db
+ image: "{{ .Values.image }}:{{ .Values.version }}"
+ env:
+ - name: POSTGRES_USER
+ value: {{ .Values.user }}
+ - name: POSTGRES_DB
+ value: immich
+ - name: POSTGRES_PASSWORD
+ value: {{ .Values.password }}
+ - name: PGDATA
+ value: /var/lib/postgresql/data/_data
+ ports:
+ - containerPort: 5432
+ volumeMounts:
+ - mountPath: "/var/lib/postgresql/data"
+ name: "immich-database-volume"
+ volumes:
+ - name: "immich-database-volume"
+ persistentVolumeClaim:
+ claimName: "immich-db-pvc"
diff --git a/roles/photos/files/postgres/templates/pv.yaml b/roles/photos/files/postgres/templates/pv.yaml
new file mode 100644
index 0000000..14b5aa2
--- /dev/null
+++ b/roles/photos/files/postgres/templates/pv.yaml
@@ -0,0 +1,16 @@
+apiVersion: v1
+kind: PersistentVolume
+metadata:
+ name: "immich-db-pv"
+ labels:
+ app: "immich-db-pv"
+spec:
+ storageClassName: nfs
+ capacity:
+ storage: 10Gi
+ accessModes:
+ - ReadWriteMany
+ nfs:
+ server: {{ .Values.nfs.server }}
+ path: {{ .Values.nfs.path }}
+ readOnly: false
diff --git a/roles/photos/files/postgres/templates/pvc.yaml b/roles/photos/files/postgres/templates/pvc.yaml
new file mode 100644
index 0000000..4b3aca7
--- /dev/null
+++ b/roles/photos/files/postgres/templates/pvc.yaml
@@ -0,0 +1,14 @@
+apiVersion: v1
+kind: PersistentVolumeClaim
+metadata:
+ name: immich-db-pvc
+spec:
+ storageClassName: nfs
+ accessModes:
+ - ReadWriteMany
+ resources:
+ requests:
+ storage: 10Gi
+ selector:
+ matchLabels:
+ app: "immich-db-pv"
diff --git a/roles/photos/files/postgres/templates/service.yaml b/roles/photos/files/postgres/templates/service.yaml
new file mode 100644
index 0000000..8fb9a49
--- /dev/null
+++ b/roles/photos/files/postgres/templates/service.yaml
@@ -0,0 +1,12 @@
+apiVersion: v1
+kind: Service
+metadata:
+ name: immich-db-service
+spec:
+ type: ClusterIP
+ selector:
+ app: immich-db
+ ports:
+ - protocol: TCP
+ port: 5432
+ targetPort: 5432