From 6d2732c029065d7b4c56437849ed45b4cf23cc3a Mon Sep 17 00:00:00 2001 From: aggarwalakshun Date: Thu, 1 May 2025 12:16:23 +0530 Subject: [PATCH] use nvidia for ml and use smb for pictures storage --- cluster/apps/immich/immich-pv.yml | 27 +++++++++++++++++++++++++++ cluster/apps/immich/immich-pvc.yml | 15 +++++++++++++++ cluster/apps/immich/immich.yml | 24 +++++++++++++++++------- 3 files changed, 59 insertions(+), 7 deletions(-) create mode 100644 cluster/apps/immich/immich-pv.yml diff --git a/cluster/apps/immich/immich-pv.yml b/cluster/apps/immich/immich-pv.yml new file mode 100644 index 0000000..7fd577e --- /dev/null +++ b/cluster/apps/immich/immich-pv.yml @@ -0,0 +1,27 @@ +--- +apiVersion: v1 +kind: PersistentVolume +metadata: + annotations: + pv.kubernetes.io/provisioned-by: smb.csi.k8s.io + name: immich-pictures-pv + namespace: default +spec: + capacity: + storage: 100Gi + accessModes: + - ReadWriteMany + persistentVolumeReclaimPolicy: Retain + storageClassName: immich-pictures-pv + mountOptions: + - dir_mode=0777 + - file_mode=0777 + csi: + driver: smb.csi.k8s.io + volumeHandle: 10.0.0.123#pictures#immich + volumeAttributes: + source: //10.0.0.123/pictures + nodeStageSecretRef: + name: smb-creds + namespace: default + diff --git a/cluster/apps/immich/immich-pvc.yml b/cluster/apps/immich/immich-pvc.yml index daf1e43..97aa91d 100644 --- a/cluster/apps/immich/immich-pvc.yml +++ b/cluster/apps/immich/immich-pvc.yml @@ -11,3 +11,18 @@ spec: resources: requests: storage: 10Gi + +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: immich-pictures-pvc + namespace: default +spec: + storageClassName: immich-pictures-pv + accessModes: + - ReadWriteMany + resources: + requests: + storage: 10Gi + diff --git a/cluster/apps/immich/immich.yml b/cluster/apps/immich/immich.yml index 8afe293..26f9c9c 100644 --- a/cluster/apps/immich/immich.yml +++ b/cluster/apps/immich/immich.yml @@ -14,6 +14,9 @@ spec: labels: app: immich-app spec: + runtimeClassName: nvidia + nodeSelector: + hardware-type: nvidia initContainers: - name: wait-for-redis image: busybox @@ -37,7 +40,7 @@ spec: done containers: - name: immich-server - image: ghcr.io/immich-app/immich-server:v1.131.3 + image: ghcr.io/immich-app/immich-server:v1.132.3 ports: - containerPort: 2283 env: @@ -60,20 +63,27 @@ spec: - mountPath: /usr/src/app/upload name: pictures - name: immich-machine-learning - image: ghcr.io/immich-app/immich-machine-learning:v1.131.2 + image: ghcr.io/immich-app/immich-machine-learning:v1.132.3-cuda ports: - containerPort: 3003 env: - name: REDIS_HOSTNAME value: "immich-redis-service" + - name: NVIDIA_VISIBLE_DEVICES + value: "all" + - name: MACHINE_LEARNING_DEVICE_IDS + value: "0" volumeMounts: - - mountPath: /cache - name: model-cache + - name: model-cache + mountPath: /cache + resources: + limits: + nvidia.com/gpu: 1 volumes: - name: pictures - nfs: - server: 10.0.0.123 - path: /pictures + persistentVolumeClaim: + claimName: immich-pictures-pvc - name: model-cache persistentVolumeClaim: claimName: longhorn-immich-cache +