From 325b0444c66e55e34b464120bd86005a578fa3af Mon Sep 17 00:00:00 2001 From: bo0tzz Date: Thu, 23 Jan 2025 15:46:22 +0100 Subject: [PATCH] chore: mount separate external library volume for previews (#358) --- .../{immich-release/ks.yaml => immich-release.yaml} | 2 +- .../preview/immich-release/app/kustomization.yaml | 5 ----- kubernetes/apps/preview/kustomization.yaml | 2 +- .../kubernetes/immich-preview/external-volume.yaml | 11 +++++++++++ templates/kubernetes/immich-preview/helmrelease.yaml | 5 +++++ .../kubernetes/immich-preview/kustomization.yaml | 1 + 6 files changed, 19 insertions(+), 7 deletions(-) rename kubernetes/apps/preview/{immich-release/ks.yaml => immich-release.yaml} (92%) delete mode 100644 kubernetes/apps/preview/immich-release/app/kustomization.yaml create mode 100644 templates/kubernetes/immich-preview/external-volume.yaml diff --git a/kubernetes/apps/preview/immich-release/ks.yaml b/kubernetes/apps/preview/immich-release.yaml similarity index 92% rename from kubernetes/apps/preview/immich-release/ks.yaml rename to kubernetes/apps/preview/immich-release.yaml index 44a759b..2a223bf 100644 --- a/kubernetes/apps/preview/immich-release/ks.yaml +++ b/kubernetes/apps/preview/immich-release.yaml @@ -10,7 +10,7 @@ spec: commonMetadata: labels: app.kubernetes.io/name: *app - path: ./kubernetes/apps/preview/immich-release/app + path: ./templates/kubernetes/immich-preview prune: true sourceRef: kind: GitRepository diff --git a/kubernetes/apps/preview/immich-release/app/kustomization.yaml b/kubernetes/apps/preview/immich-release/app/kustomization.yaml deleted file mode 100644 index b6cfbbf..0000000 --- a/kubernetes/apps/preview/immich-release/app/kustomization.yaml +++ /dev/null @@ -1,5 +0,0 @@ ---- -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization -resources: - - ../../../../../templates/kubernetes/immich-preview diff --git a/kubernetes/apps/preview/kustomization.yaml b/kubernetes/apps/preview/kustomization.yaml index f78edcb..3a2a109 100644 --- a/kubernetes/apps/preview/kustomization.yaml +++ b/kubernetes/apps/preview/kustomization.yaml @@ -3,4 +3,4 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - ./namespace.yaml - - ./immich-release/ks.yaml + - ./immich-release.yaml diff --git a/templates/kubernetes/immich-preview/external-volume.yaml b/templates/kubernetes/immich-preview/external-volume.yaml new file mode 100644 index 0000000..e72b2d2 --- /dev/null +++ b/templates/kubernetes/immich-preview/external-volume.yaml @@ -0,0 +1,11 @@ +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: ${NAME}-external +spec: + storageClassName: zfs + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 100Gi diff --git a/templates/kubernetes/immich-preview/helmrelease.yaml b/templates/kubernetes/immich-preview/helmrelease.yaml index 169f7fb..059d88e 100644 --- a/templates/kubernetes/immich-preview/helmrelease.yaml +++ b/templates/kubernetes/immich-preview/helmrelease.yaml @@ -57,6 +57,11 @@ spec: server: image: pullPolicy: Always + persistence: + external: + enabled: true + mountPath: /external + existingClaim: ${NAME}-external ingress: main: enabled: true diff --git a/templates/kubernetes/immich-preview/kustomization.yaml b/templates/kubernetes/immich-preview/kustomization.yaml index fc3a0b2..72ce360 100644 --- a/templates/kubernetes/immich-preview/kustomization.yaml +++ b/templates/kubernetes/immich-preview/kustomization.yaml @@ -3,5 +3,6 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - ./library-volume.yaml + - ./external-volume.yaml - ./database.yaml - ./helmrelease.yaml