Skip to content

Commit 1311456

Browse files
committed
up
1 parent f1c0746 commit 1311456

3 files changed

Lines changed: 42 additions & 25 deletions

File tree

infrastructure/storage/csi-driver-nfs/storage-class.yaml

Lines changed: 31 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -42,23 +42,36 @@ mountOptions:
4242
- noatime
4343
- nconnect=4
4444
---
45-
# Immich photos NFS storage class (read-only external library)
46-
apiVersion: storage.k8s.io/v1
47-
kind: StorageClass
45+
# =============================================================================
46+
# Static PVs for existing NFS directories (read-only)
47+
# =============================================================================
48+
# NFS CSI dynamic provisioner creates subdirectories per PVC — won't work for
49+
# mounting existing data. Use static PVs instead for pre-existing NFS shares.
50+
51+
# Immich photos - read-only mount to TrueNAS photo library
52+
apiVersion: v1
53+
kind: PersistentVolume
4854
metadata:
4955
name: nfs-immich-photos
50-
provisioner: nfs.csi.k8s.io
51-
parameters:
52-
server: 192.168.10.133
53-
share: /mnt/BigTank/photos/All
54-
reclaimPolicy: Retain
55-
volumeBindingMode: Immediate
56-
mountOptions:
57-
- nfsvers=4.1
58-
- nolock
59-
- tcp
60-
- rsize=1048576
61-
- wsize=1048576
62-
- noatime
63-
- nconnect=4
64-
- ro
56+
spec:
57+
capacity:
58+
storage: 2Ti
59+
accessModes:
60+
- ReadOnlyMany
61+
persistentVolumeReclaimPolicy: Retain
62+
storageClassName: ""
63+
mountOptions:
64+
- nfsvers=4.1
65+
- nolock
66+
- tcp
67+
- rsize=1048576
68+
- wsize=1048576
69+
- noatime
70+
- nconnect=4
71+
- ro
72+
csi:
73+
driver: nfs.csi.k8s.io
74+
volumeHandle: nfs-immich-photos
75+
volumeAttributes:
76+
server: "192.168.10.133"
77+
share: "/mnt/BigTank/photos/All"

my-apps/media/immich/README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Originals stay on NFS read-only; only thumbnails and ML embeddings are stored lo
4949

5050
CloudNativePG (CNPG) manages the database at `infrastructure/database/cloudnative-pg/immich/`.
5151

52-
- Image: `ghcr.io/tensorchord/cloudnative-vectorchord:17.2-0.5.3` (Postgres 17 + VectorChord)
52+
- Image: `ghcr.io/tensorchord/cloudnative-vectorchord:17.5-0.4.3` (Postgres 17.5 + VectorChord 0.4.3)
5353
- Extensions: vchord (CASCADE installs pgvector), vector, earthdistance (CASCADE installs cube)
5454
- Service: `immich-database-rw.cloudnative-pg.svc.cluster.local:5432`
5555
- Credentials: ExternalSecret from 1Password (`immich-db-credentials` in immich ns, `immich-app-secret` in cnpg ns)
@@ -73,9 +73,12 @@ no Patroni, no leader election, just a postgres instance with backup management.
7373
|-----|------|--------------|--------|
7474
| `library` | 50Gi | longhorn | Enable after stable |
7575
| `immich-ml-cache` | 10Gi | longhorn | No (re-downloadable) |
76-
| `nfs-photos` | 2Ti | `nfs-immich-photos` (CSI, read-only) | N/A (source of truth) |
76+
| `nfs-photos` | 2Ti | static PV (NFS CSI, read-only) | N/A (source of truth) |
7777

78-
## NFS StorageClass
78+
## NFS Static PV
7979

80-
The `nfs-immich-photos` StorageClass is defined in `infrastructure/storage/csi-driver-nfs/storage-class.yaml`.
81-
It uses `nfs.csi.k8s.io` provisioner with `ro` mount option pointing to `192.168.10.133:/mnt/BigTank/photos/All`.
80+
The `nfs-immich-photos` PersistentVolume is defined in `infrastructure/storage/csi-driver-nfs/storage-class.yaml`.
81+
It uses a **static PV** (not a StorageClass) because NFS CSI dynamic provisioning creates a new subdirectory
82+
per PVC, which doesn't work for mounting existing data. Static PVs point directly at the existing NFS share.
83+
84+
Mount: `192.168.10.133:/mnt/BigTank/photos/All` (read-only via `ro` mount option).

my-apps/media/immich/nfs-photos-pvc.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ metadata:
88
app.kubernetes.io/component: external-library
99
spec:
1010
accessModes:
11-
- ReadWriteOnce
11+
- ReadOnlyMany
1212
resources:
1313
requests:
1414
storage: 2Ti
15-
storageClassName: nfs-immich-photos
15+
storageClassName: ""
16+
volumeName: nfs-immich-photos

0 commit comments

Comments
 (0)