Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: mount separate external library volume for previews #358

Merged
merged 3 commits into from
Jan 23, 2025

Conversation

bo0tzz
Copy link
Member

@bo0tzz bo0tzz commented Jan 23, 2025

No description provided.

Copy link

github-actions bot commented Jan 23, 2025

--- kubernetes/apps/preview/immich-release/app Kustomization: flux-system/preview-immich-release PersistentVolumeClaim: preview/preview-immich-release-library

+++ kubernetes/apps/preview/immich-release/app Kustomization: flux-system/preview-immich-release PersistentVolumeClaim: preview/preview-immich-release-library

@@ -1,18 +0,0 @@

----
-apiVersion: v1
-kind: PersistentVolumeClaim
-metadata:
-  labels:
-    app.kubernetes.io/name: preview-immich-release
-    kustomize.toolkit.fluxcd.io/name: preview-immich-release
-    kustomize.toolkit.fluxcd.io/namespace: flux-system
-  name: preview-immich-release-library
-  namespace: preview
-spec:
-  accessModes:
-  - ReadWriteOnce
-  resources:
-    requests:
-      storage: 100Gi
-  storageClassName: zfs
-
--- kubernetes/apps/preview/immich-release/app Kustomization: flux-system/preview-immich-release Cluster: preview/preview-immich-release

+++ kubernetes/apps/preview/immich-release/app Kustomization: flux-system/preview-immich-release Cluster: preview/preview-immich-release

@@ -1,24 +0,0 @@

----
-apiVersion: postgresql.cnpg.io/v1
-kind: Cluster
-metadata:
-  labels:
-    app.kubernetes.io/name: preview-immich-release
-    kustomize.toolkit.fluxcd.io/name: preview-immich-release
-    kustomize.toolkit.fluxcd.io/namespace: flux-system
-  name: preview-immich-release
-  namespace: preview
-spec:
-  backup:
-    volumeSnapshot:
-      className: zfs
-  enableSuperuserAccess: true
-  imageName: ghcr.io/tensorchord/cloudnative-pgvecto.rs:14.12-v0.3.0
-  instances: 1
-  postgresql:
-    shared_preload_libraries:
-    - vectors.so
-  storage:
-    size: 10Gi
-    storageClass: zfs
-
--- kubernetes/apps/preview/immich-release/app Kustomization: flux-system/preview-immich-release HelmRelease: preview/preview-immich-release

+++ kubernetes/apps/preview/immich-release/app Kustomization: flux-system/preview-immich-release HelmRelease: preview/preview-immich-release

@@ -1,80 +0,0 @@

----
-apiVersion: helm.toolkit.fluxcd.io/v2
-kind: HelmRelease
-metadata:
-  labels:
-    app.kubernetes.io/name: preview-immich-release
-    kustomize.toolkit.fluxcd.io/name: preview-immich-release
-    kustomize.toolkit.fluxcd.io/namespace: flux-system
-  name: preview-immich-release
-  namespace: preview
-spec:
-  chart:
-    spec:
-      chart: immich
-      interval: 1m
-      sourceRef:
-        kind: HelmRepository
-        name: immich-charts
-        namespace: flux-system
-      version: 0.9.0
-  interval: 5m
-  upgrade:
-    remediation:
-      retries: 3
-  values:
-    env:
-      DB_DATABASE_NAME:
-        valueFrom:
-          secretKeyRef:
-            key: dbname
-            name: preview-immich-release-app
-      DB_HOSTNAME:
-        valueFrom:
-          secretKeyRef:
-            key: host
-            name: preview-immich-release-superuser
-      DB_PASSWORD:
-        valueFrom:
-          secretKeyRef:
-            key: password
-            name: preview-immich-release-superuser
-      DB_USERNAME:
-        valueFrom:
-          secretKeyRef:
-            key: user
-            name: preview-immich-release-superuser
-      LOG_LEVEL: verbose
-    image:
-      tag: v1.124.2
-    immich:
-      persistence:
-        library:
-          existingClaim: preview-immich-release-library
-    machine-learning:
-      image:
-        pullPolicy: Always
-    postgres:
-      enabled: false
-    redis:
-      enabled: true
-    server:
-      image:
-        pullPolicy: Always
-      ingress:
-        main:
-          annotations:
-            cert-manager.io/cluster-issuer: letsencrypt-production
-            nginx.ingress.kubernetes.io/proxy-body-size: '0'
-          className: nginx
-          enabled: true
-          hosts:
-          - host: release-preview.internal.immich.cloud
-            paths:
-            - path: /
-              pathType: Prefix
-          tls:
-          - hosts:
-            - release-preview.internal.immich.cloud
-            secretName: preview-immich-release-tls
-
--- kubernetes/apps Kustomization: flux-system/cluster-apps Kustomization: flux-system/preview-immich-release

+++ kubernetes/apps Kustomization: flux-system/cluster-apps Kustomization: flux-system/preview-immich-release

@@ -9,13 +9,13 @@

   namespace: flux-system
 spec:
   commonMetadata:
     labels:
       app.kubernetes.io/name: preview-immich-release
   interval: 30m
-  path: ./kubernetes/apps/preview/immich-release/app
+  path: ./templates/kubernetes/immich-preview
   postBuild:
     substitute:
       HOST: release-preview.internal.immich.cloud
       NAME: preview-immich-release
       TAG: v1.124.2
   prune: true
--- templates/kubernetes/immich-preview Kustomization: flux-system/preview-immich-release PersistentVolumeClaim: preview/preview-immich-release-library

+++ templates/kubernetes/immich-preview Kustomization: flux-system/preview-immich-release PersistentVolumeClaim: preview/preview-immich-release-library

@@ -0,0 +1,18 @@

+---
+apiVersion: v1
+kind: PersistentVolumeClaim
+metadata:
+  labels:
+    app.kubernetes.io/name: preview-immich-release
+    kustomize.toolkit.fluxcd.io/name: preview-immich-release
+    kustomize.toolkit.fluxcd.io/namespace: flux-system
+  name: preview-immich-release-library
+  namespace: preview
+spec:
+  accessModes:
+  - ReadWriteOnce
+  resources:
+    requests:
+      storage: 100Gi
+  storageClassName: zfs
+
--- templates/kubernetes/immich-preview Kustomization: flux-system/preview-immich-release PersistentVolumeClaim: preview/preview-immich-release-external

+++ templates/kubernetes/immich-preview Kustomization: flux-system/preview-immich-release PersistentVolumeClaim: preview/preview-immich-release-external

@@ -0,0 +1,18 @@

+---
+apiVersion: v1
+kind: PersistentVolumeClaim
+metadata:
+  labels:
+    app.kubernetes.io/name: preview-immich-release
+    kustomize.toolkit.fluxcd.io/name: preview-immich-release
+    kustomize.toolkit.fluxcd.io/namespace: flux-system
+  name: preview-immich-release-external
+  namespace: preview
+spec:
+  accessModes:
+  - ReadWriteOnce
+  resources:
+    requests:
+      storage: 100Gi
+  storageClassName: zfs
+
--- templates/kubernetes/immich-preview Kustomization: flux-system/preview-immich-release Cluster: preview/preview-immich-release

+++ templates/kubernetes/immich-preview Kustomization: flux-system/preview-immich-release Cluster: preview/preview-immich-release

@@ -0,0 +1,24 @@

+---
+apiVersion: postgresql.cnpg.io/v1
+kind: Cluster
+metadata:
+  labels:
+    app.kubernetes.io/name: preview-immich-release
+    kustomize.toolkit.fluxcd.io/name: preview-immich-release
+    kustomize.toolkit.fluxcd.io/namespace: flux-system
+  name: preview-immich-release
+  namespace: preview
+spec:
+  backup:
+    volumeSnapshot:
+      className: zfs
+  enableSuperuserAccess: true
+  imageName: ghcr.io/tensorchord/cloudnative-pgvecto.rs:14.12-v0.3.0
+  instances: 1
+  postgresql:
+    shared_preload_libraries:
+    - vectors.so
+  storage:
+    size: 10Gi
+    storageClass: zfs
+
--- templates/kubernetes/immich-preview Kustomization: flux-system/preview-immich-release HelmRelease: preview/preview-immich-release

+++ templates/kubernetes/immich-preview Kustomization: flux-system/preview-immich-release HelmRelease: preview/preview-immich-release

@@ -0,0 +1,85 @@

+---
+apiVersion: helm.toolkit.fluxcd.io/v2
+kind: HelmRelease
+metadata:
+  labels:
+    app.kubernetes.io/name: preview-immich-release
+    kustomize.toolkit.fluxcd.io/name: preview-immich-release
+    kustomize.toolkit.fluxcd.io/namespace: flux-system
+  name: preview-immich-release
+  namespace: preview
+spec:
+  chart:
+    spec:
+      chart: immich
+      interval: 1m
+      sourceRef:
+        kind: HelmRepository
+        name: immich-charts
+        namespace: flux-system
+      version: 0.9.0
+  interval: 5m
+  upgrade:
+    remediation:
+      retries: 3
+  values:
+    env:
+      DB_DATABASE_NAME:
+        valueFrom:
+          secretKeyRef:
+            key: dbname
+            name: preview-immich-release-app
+      DB_HOSTNAME:
+        valueFrom:
+          secretKeyRef:
+            key: host
+            name: preview-immich-release-superuser
+      DB_PASSWORD:
+        valueFrom:
+          secretKeyRef:
+            key: password
+            name: preview-immich-release-superuser
+      DB_USERNAME:
+        valueFrom:
+          secretKeyRef:
+            key: user
+            name: preview-immich-release-superuser
+      LOG_LEVEL: verbose
+    image:
+      tag: v1.124.2
+    immich:
+      persistence:
+        library:
+          existingClaim: preview-immich-release-library
+    machine-learning:
+      image:
+        pullPolicy: Always
+    postgres:
+      enabled: false
+    redis:
+      enabled: true
+    server:
+      image:
+        pullPolicy: Always
+      ingress:
+        main:
+          annotations:
+            cert-manager.io/cluster-issuer: letsencrypt-production
+            nginx.ingress.kubernetes.io/proxy-body-size: '0'
+          className: nginx
+          enabled: true
+          hosts:
+          - host: release-preview.internal.immich.cloud
+            paths:
+            - path: /
+              pathType: Prefix
+          tls:
+          - hosts:
+            - release-preview.internal.immich.cloud
+            secretName: preview-immich-release-tls
+      persistence:
+        external:
+          enabled: true
+          existingClaim: preview-immich-release-external
+          mountPath: /external
+

Copy link

--- HelmRelease: preview/preview-immich-release Deployment: preview/preview-immich-release-server

+++ HelmRelease: preview/preview-immich-release Deployment: preview/preview-immich-release-server

@@ -59,12 +59,14 @@

           value: preview-immich-release-redis-master
         ports:
         - name: http
           containerPort: 2283
           protocol: TCP
         volumeMounts:
+        - name: external
+          mountPath: /external
         - name: library
           mountPath: /usr/src/app/upload
         livenessProbe:
           failureThreshold: 3
           httpGet:
             path: /api/server/ping
@@ -86,10 +88,13 @@

             path: /api/server/ping
             port: http
           initialDelaySeconds: 0
           periodSeconds: 10
           timeoutSeconds: 1
       volumes:
+      - name: external
+        persistentVolumeClaim:
+          claimName: preview-immich-release-external
       - name: library
         persistentVolumeClaim:
           claimName: preview-immich-release-library
 

@bo0tzz bo0tzz enabled auto-merge (squash) January 23, 2025 14:40
@bo0tzz bo0tzz merged commit 325b044 into main Jan 23, 2025
2 checks passed
@bo0tzz bo0tzz deleted the chore/previews-library-volume branch January 23, 2025 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants