When using the community Immich helm chart, the postgres subchart is deprecated, so we will need to set up our own postgres instances for Immich. In this example, I the install CloudnativePG operator to manage postgres clusters.
Set up CloudnativePG
Create the immich namespace.
kubectl create namespace immich
Create postgres secret for initial postgres username/password.
Create postgres instance for immich using cnpg. Here I use cloudnative-pgvecto.rs and add initilization statements for the extensions required by Immich. Note that you may need to check which versions of pgvecto.rs are compatible with the Immich version being deployed.
Set up volumes
Create PVs and PVCs for immich library and immich ML cache.
If using a NFS volume, this can be mounted on the local filesystem.
Create values.yaml file for immich, reference the created PVCs. If you are using Ingress certificates with private CA, you can also add the cert-manager annotations on server.ingress.annotations.
Install the chart.
If using external libraries, edit the immich-server deployment to add any additional mounts for external libraries. Note: external libraries must be outside the /usr/src/app path.
If using Traefik, we need to enable sticky sessions on the service for websockets to work nicely.
Importing
For batch importing of images from Google Takeout or iCloud data export, you can use immich-go. This will import assets into the Immich library itself, rather than linking to an external library. There are several benefits with this:
You can manage all the original files with Immich.
Have server stats reporting (External libraries are not reflected in server stats.)
Consolidate Google Photos metadata, since these are exported as sidecar JSON files from Google Takeout.
Example of importing with immich-go
First configure an API key in Immich using Account Settings > API Keys.
Google Takeout
iCloud
Resource usage profile during external library scanning.