From c81eb7273f31b694808cf429b9b3a299fe2a7918 Mon Sep 17 00:00:00 2001 From: Alex Lebens Date: Tue, 18 Feb 2025 22:57:10 -0600 Subject: [PATCH] add photoview --- .../cl01tl/applications/photoview/Chart.yaml | 28 +++++ .../photoview/templates/external-secrets.yaml | 30 +++++ .../templates/persistent-volume-claim.yaml | 19 +++ .../templates/persistent-volume.yaml | 25 ++++ .../cl01tl/applications/photoview/values.yaml | 115 ++++++++++++++++++ 5 files changed, 217 insertions(+) create mode 100644 clusters/cl01tl/applications/photoview/Chart.yaml create mode 100644 clusters/cl01tl/applications/photoview/templates/external-secrets.yaml create mode 100644 clusters/cl01tl/applications/photoview/templates/persistent-volume-claim.yaml create mode 100644 clusters/cl01tl/applications/photoview/templates/persistent-volume.yaml create mode 100644 clusters/cl01tl/applications/photoview/values.yaml diff --git a/clusters/cl01tl/applications/photoview/Chart.yaml b/clusters/cl01tl/applications/photoview/Chart.yaml new file mode 100644 index 000000000..26a69c9e8 --- /dev/null +++ b/clusters/cl01tl/applications/photoview/Chart.yaml @@ -0,0 +1,28 @@ +apiVersion: v2 +name: photoview +version: 1.0.0 +description: Photoview +keywords: + - photoview + - pictures +home: https://wiki.alexlebens.dev/doc/photoview-WSRscnhpwv +sources: + - https://github.com/immich-app/immich + - https://github.com/valkey-io/valkey + - https://github.com/cloudnative-pg/cloudnative-pg + - https://github.com/bjw-s/helm-charts/tree/main/charts/other/app-template + - https://github.com/bitnami/charts/tree/main/bitnami/valkey + - https://github.com/alexlebens/helm-charts/charts/postgres-cluster +maintainers: + - name: alexlebens +dependencies: + - name: app-template + alias: photoview + repository: https://bjw-s.github.io/helm-charts/ + version: 3.6.1 + - name: postgres-cluster + alias: postgres-17-cluster + version: 4.1.4 + repository: http://alexlebens.github.io/helm-charts +icon: https://cdn.jsdelivr.net/gh/selfhst/icons/png/photoview.png +appVersion: 2.4.0 diff --git a/clusters/cl01tl/applications/photoview/templates/external-secrets.yaml b/clusters/cl01tl/applications/photoview/templates/external-secrets.yaml new file mode 100644 index 000000000..6fac32ec5 --- /dev/null +++ b/clusters/cl01tl/applications/photoview/templates/external-secrets.yaml @@ -0,0 +1,30 @@ +apiVersion: external-secrets.io/v1beta1 +kind: ExternalSecret +metadata: + name: photoview-postgresql-17-cluster-backup-secret + namespace: {{ .Release.Namespace }} + labels: + app.kubernetes.io/name: photoview-postgresql-17-cluster-backup-secret + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/version: {{ .Chart.AppVersion }} + app.kubernetes.io/component: database + app.kubernetes.io/part-of: {{ .Release.Name }} +spec: + secretStoreRef: + kind: ClusterSecretStore + name: vault + data: + - secretKey: ACCESS_KEY_ID + remoteRef: + conversionStrategy: Default + decodingStrategy: None + key: /digital-ocean/home-infra/postgres-backups + metadataPolicy: None + property: access + - secretKey: ACCESS_SECRET_KEY + remoteRef: + conversionStrategy: Default + decodingStrategy: None + key: /digital-ocean/home-infra/postgres-backups + metadataPolicy: None + property: secret diff --git a/clusters/cl01tl/applications/photoview/templates/persistent-volume-claim.yaml b/clusters/cl01tl/applications/photoview/templates/persistent-volume-claim.yaml new file mode 100644 index 000000000..191161483 --- /dev/null +++ b/clusters/cl01tl/applications/photoview/templates/persistent-volume-claim.yaml @@ -0,0 +1,19 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: photoview-nfs-storage + namespace: {{ .Release.Namespace }} + labels: + app.kubernetes.io/name: photoview-nfs-storage + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/version: {{ .Chart.AppVersion }} + app.kubernetes.io/component: storage + app.kubernetes.io/part-of: {{ .Release.Name }} +spec: + volumeName: photoview-nfs-storage + storageClassName: nfs-client + accessModes: + - ReadWriteMany + resources: + requests: + storage: 1Gi diff --git a/clusters/cl01tl/applications/photoview/templates/persistent-volume.yaml b/clusters/cl01tl/applications/photoview/templates/persistent-volume.yaml new file mode 100644 index 000000000..bcf22883d --- /dev/null +++ b/clusters/cl01tl/applications/photoview/templates/persistent-volume.yaml @@ -0,0 +1,25 @@ +apiVersion: v1 +kind: PersistentVolume +metadata: + name: photoview-nfs-storage + namespace: {{ .Release.Namespace }} + labels: + app.kubernetes.io/name: photoview-nfs-storage + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/version: {{ .Chart.AppVersion }} + app.kubernetes.io/component: storage + app.kubernetes.io/part-of: {{ .Release.Name }} +spec: + persistentVolumeReclaimPolicy: Retain + storageClassName: nfs-client + capacity: + storage: 1Gi + accessModes: + - ReadWriteMany + nfs: + path: /volume2/Storage/Pictures + server: synologybond.alexlebens.net + mountOptions: + - vers=4 + - minorversion=1 + - noac diff --git a/clusters/cl01tl/applications/photoview/values.yaml b/clusters/cl01tl/applications/photoview/values.yaml new file mode 100644 index 000000000..3cb75f70c --- /dev/null +++ b/clusters/cl01tl/applications/photoview/values.yaml @@ -0,0 +1,115 @@ +photoview: + controllers: + main: + type: deployment + replicas: 1 + strategy: Recreate + revisionHistoryLimit: 3 + initContainers: + init-chmod-data: + securityContext: + runAsUser: 0 + image: + repository: busybox + tag: 1.37.0 + pullPolicy: IfNotPresent + command: + - /bin/sh + - -ec + - | + /bin/chown -R 999:999 /app/cache + resources: + requests: + cpu: 100m + memory: 128Mi + containers: + main: + image: + repository: photoview/photoview + tag: 2.4.0 + pullPolicy: IfNotPresent + env: + - name: PHOTOVIEW_DATABASE_DRIVER + value: postgres + - name: PHOTOVIEW_POSTGRES_URL + valueFrom: + secretKeyRef: + name: photoview-postgresql-17-cluster-app + key: uri + - name: PHOTOVIEW_MEDIA_CACHE + value: /app/cache + - name: PHOTOVIEW_VIDEO_HARDWARE_ACCELERATION + value: qsv + resources: + requests: + gpu.intel.com/i915: 1 + cpu: 10m + memory: 512Mi + limits: + gpu.intel.com/i915: 1 + serviceAccount: + create: true + service: + main: + controller: main + ports: + http: + port: 80 + targetPort: 80 + protocol: HTTP + ingress: + main: + enabled: true + className: tailscale + hosts: + - host: photoview-cl01tl + paths: + - path: / + pathType: Prefix + service: + name: photoview + port: 80 + tls: + - hosts: + - photoview-cl01tl + persistence: + media: + existingClaim: photoview-nfs-storage + advancedMounts: + main: + main: + - path: /photos + readOnly: true + cache: + storageClass: ceph-block + accessMode: ReadWriteOnce + size: 10Gi + retain: false + advancedMounts: + main: + init-chmod-data: + - path: /app/cache + readOnly: false + main: + - path: /app/cache + readOnly: false +postgres-17-cluster: + mode: recovery + cluster: + walStorage: + storageClass: local-path + storage: + storageClass: local-path + monitoring: + enabled: true + recovery: + endpointURL: https://nyc3.digitaloceanspaces.com + destinationPath: s3://postgres-backups-ce540ddf106d186bbddca68a/cl01tl/photoview/photoview-postgresql-17-cluster + endpointCredentials: photoview-postgresql-17-cluster-backup-secret + backup: + enabled: false + endpointURL: https://nyc3.digitaloceanspaces.com + destinationPath: s3://postgres-backups-ce540ddf106d186bbddca68a/cl01tl/photoview/photoview-postgresql-17-cluster + endpointCredentials: photoview-postgresql-17-cluster-backup-secret + backupIndex: 1 + retentionPolicy: "7d"