feat(immich): Move to separate k8s namespace

This commit is contained in:
Pim Kunis 2024-07-16 16:13:29 +02:00
parent 2853429dc4
commit d1d09da3d3
6 changed files with 130 additions and 139 deletions

View file

@ -65,6 +65,7 @@ Currently, the applications being deployed like this are:
- `paperless-ngx` - `paperless-ngx`
- `syncthing` - `syncthing`
- `pihole` - `pihole`
- `immich`
## Known bugs ## Known bugs

View file

@ -90,4 +90,6 @@
"${self}/kubenix-modules/syncthing.nix" "syncthing" "syncthing"; "${self}/kubenix-modules/syncthing.nix" "syncthing" "syncthing";
kubenix.pihole = mkDeployScriptAndManifest kubenix.pihole = mkDeployScriptAndManifest
"${self}/kubenix-modules/pihole.nix" "pihole" "pihole"; "${self}/kubenix-modules/pihole.nix" "pihole" "pihole";
kubenix.immich = mkDeployScriptAndManifest
"${self}/kubenix-modules/immich.nix" "immich" "immich";
}) })

View file

@ -5,7 +5,6 @@ let
./bind9 ./bind9
./dnsmasq.nix ./dnsmasq.nix
./attic.nix ./attic.nix
./immich.nix
# ./argo.nix # ./argo.nix
# ./minecraft.nix # ./minecraft.nix
]; ];

View file

@ -73,6 +73,7 @@
paperless = { }; paperless = { };
syncthing = { }; syncthing = { };
pihole = { }; pihole = { };
immich = { };
}; };
nodes = nodes =

View file

@ -1,13 +1,7 @@
{ {
kubernetes.resources = { kubernetes.resources = {
deployments = { deployments = {
immich-server = { immich.spec = {
metadata.labels = {
app = "immich";
component = "server";
};
spec = {
selector.matchLabels = { selector.matchLabels = {
app = "immich"; app = "immich";
component = "server"; component = "server";
@ -29,7 +23,9 @@
}; };
spec = { spec = {
volumes.data.persistentVolumeClaim.claimName = "immich"; volumes.data.persistentVolumeClaim.claimName = "data";
enableServiceLinks = false;
containers.immich = { containers.immich = {
image = "ghcr.io/immich-app/immich-server:v1.108.0"; image = "ghcr.io/immich-app/immich-server:v1.108.0";
@ -38,12 +34,12 @@
env = { env = {
TZ.value = "Europe/Amsterdam"; TZ.value = "Europe/Amsterdam";
REDIS_HOSTNAME.value = "immich-redis.default.svc.cluster.local"; REDIS_HOSTNAME.value = "redis.immich.svc.cluster.local";
DB_HOSTNAME.value = "immich-postgres.default.svc.cluster.local"; DB_HOSTNAME.value = "postgres.immich.svc.cluster.local";
DB_USERNAME.value = "postgres"; DB_USERNAME.value = "postgres";
DB_PASSWORD.value = "ref+sops://secrets/kubernetes.yaml#/immich/databasePassword"; DB_PASSWORD.value = "ref+sops://secrets/kubernetes.yaml#/immich/databasePassword";
DB_DATABASE_NAME.value = "immich"; DB_DATABASE_NAME.value = "immich";
IMMICH_MACHINE_LEARNING_URL.value = "http://immich-ml.default.svc.cluster.local"; IMMICH_MACHINE_LEARNING_URL.value = "http://ml.immich.svc.cluster.local";
}; };
volumeMounts = [{ volumeMounts = [{
@ -54,15 +50,8 @@
}; };
}; };
}; };
};
immich-ml = { ml.spec = {
metadata.labels = {
app = "immich";
component = "machine-learning";
};
spec = {
selector.matchLabels = { selector.matchLabels = {
app = "immich"; app = "immich";
component = "machine-learning"; component = "machine-learning";
@ -75,7 +64,7 @@
}; };
spec = { spec = {
volumes.cache.persistentVolumeClaim.claimName = "immich-cache"; volumes.cache.persistentVolumeClaim.claimName = "cache";
containers.machine-learning = { containers.machine-learning = {
image = "ghcr.io/immich-app/immich-machine-learning:v1.108.0"; image = "ghcr.io/immich-app/immich-machine-learning:v1.108.0";
@ -91,15 +80,8 @@
}; };
}; };
}; };
};
immich-redis = { redis.spec = {
metadata.labels = {
app = "immich";
component = "redis";
};
spec = {
selector.matchLabels = { selector.matchLabels = {
app = "immich"; app = "immich";
component = "redis"; component = "redis";
@ -129,15 +111,8 @@
}; };
}; };
}; };
};
immich-database = { database.spec = {
metadata.labels = {
app = "immich";
component = "database";
};
spec = {
selector.matchLabels = { selector.matchLabels = {
app = "immich"; app = "immich";
component = "database"; component = "database";
@ -159,7 +134,7 @@
}; };
spec = { spec = {
volumes.data.persistentVolumeClaim.claimName = "immich-db"; volumes.data.persistentVolumeClaim.claimName = "database";
containers.postgres = { containers.postgres = {
image = "docker.io/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0"; image = "docker.io/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0";
@ -187,10 +162,9 @@
}; };
}; };
}; };
};
services = { services = {
immich-server.spec = { server.spec = {
selector = { selector = {
app = "immich"; app = "immich";
component = "server"; component = "server";
@ -202,7 +176,7 @@
}; };
}; };
immich-redis.spec = { redis.spec = {
selector = { selector = {
app = "immich"; app = "immich";
component = "redis"; component = "redis";
@ -214,7 +188,7 @@
}; };
}; };
immich-ml.spec = { ml.spec = {
selector = { selector = {
app = "immich"; app = "immich";
component = "machine-learning"; component = "machine-learning";
@ -226,7 +200,7 @@
}; };
}; };
immich-postgres.spec = { postgres.spec = {
selector = { selector = {
app = "immich"; app = "immich";
component = "database"; component = "database";
@ -239,18 +213,32 @@
}; };
}; };
persistentVolumeClaims.immich-cache.spec = { persistentVolumeClaims.cache.spec = {
accessModes = [ "ReadWriteOnce" ]; accessModes = [ "ReadWriteOnce" ];
resources.requests.storage = "5Gi"; resources.requests.storage = "5Gi";
}; };
}; };
lab.ingresses.immich-test = { lab = {
ingresses.immich = {
host = "immich.kun.is"; host = "immich.kun.is";
service = { service = {
name = "immich-server"; name = "server";
portName = "web"; portName = "web";
}; };
}; };
longhorn.persistentVolumeClaim = {
data = {
volumeName = "immich";
storage = "50Gi";
};
database = {
volumeName = "immich-db";
storage = "5Gi";
};
};
};
} }

View file

@ -34,8 +34,6 @@
bazarr.storage = "25Mi"; bazarr.storage = "25Mi";
attic.storage = "15Gi"; attic.storage = "15Gi";
attic-db.storage = "150Mi"; attic-db.storage = "150Mi";
immich.storage = "50Gi";
immich-db.storage = "5Gi";
}; };
longhorn.persistentVolume = { longhorn.persistentVolume = {
@ -55,6 +53,8 @@
syncthing.storage = "400Mi"; syncthing.storage = "400Mi";
pihole-data.storage = "750Mi"; pihole-data.storage = "750Mi";
pihole-dnsmasq.storage = "16Mi"; pihole-dnsmasq.storage = "16Mi";
immich.storage = "50Gi";
immich-db.storage = "5Gi";
}; };
nfsVolumes = { nfsVolumes = {