Running Immich on Kubernetes with the photos left on the NAS
The problem
The household’s photos live on the Synology NAS: about 77 GB and 17,000 files, browsed over file shares and replicated to an identical NAS across the country. That’s fine for storage and backup, but browsing photos through a file share is clunky. There’s no phone backup, no search by face or place, and no albums to share.
Immich does all of that. The problem is that most photo apps expect to import your library, reorganize it, and become where the photos live. I wasn’t willing to make a cluster on three small PCs the owner of the family’s photos.
The main constraint
The NAS stays the system of record. Immich only indexes the photos and gives the family a nicer way to browse them. Removing Immich, or losing the whole cluster, should never put an original photo at risk, and most of the decisions below come from that rule.
How it was built
I wrote a specification first, then a plan, then a task list, and only then deployed anything. The spec recorded each decision with its reason and the condition that would make me revisit it. Some of the decisions:
- The existing archive is mounted read-only. Immich’s own documentation warns that without a read-only mount it may modify files. It’s enforced in two separate places: the NAS account Immich uses only has read access, and the Kubernetes volume mount is read-only too.
- New phone uploads go to a folder on the NAS that the off-site replication already covers. The newest photos are the least replaceable, so they shouldn’t live only inside the cluster.
- The shares are mounted over SMB. The archive sits inside a share that NFS couldn’t expose without opening up more of the NAS than Immich needed. With SMB, Immich signs in as its own service account, so its access could be limited to exactly what it needs.
- The database runs on fast local storage, managed by the CloudNativePG operator. Immich’s documentation says Postgres shouldn’t run over a network share, and several earlier incidents in the homelab involved replicated volumes after a node went down uncleanly.
- Machine learning was switched off for the first deploy and turned on once everything else was working, so the heaviest feature wouldn’t get in the way of spotting basic problems.
Testing it first
Before Immich existed, a throwaway pod mounted the shares and tried to write to the archive. The write was refused, as it should have been. I also took a checksum manifest of the archive before Immich ever saw it. After Immich finished indexing, I checked the archive against the manifest again, and every file was byte-for-byte identical.
Outcome
- Immich runs in the cluster, deployed through Argo CD like everything else.
- The full archive is browsable, searchable by faces and places, with zero changes to the NAS.
- Phone backups land in a NAS folder that is replicated off-site automatically.
- If the cluster disappeared tomorrow, the cost would be albums and face labels, not my photos.
What went wrong later
Two weeks after launch, Immich took down a worker node. I had deployed it without memory limits, and a large background job pushed the node into a livelock. That incident, and what changed, is written up in Out of memory, but never killed. The photos were never at risk, since the originals were never stored in the cluster.
Takeaways for a prod environment
- Write down the one constraint that must never be violated, before choosing any tools. Here it was “the NAS owns the photos.”
- Prove storage permissions with a disposable test before the real application touches anything.
- Taking checksums before and after is cheap, and it means you can prove nothing changed.