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`
- `syncthing`
- `pihole`
- `immich`
## Known bugs

View file

@ -90,4 +90,6 @@
"${self}/kubenix-modules/syncthing.nix" "syncthing" "syncthing";
kubenix.pihole = mkDeployScriptAndManifest
"${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
./dnsmasq.nix
./attic.nix
./immich.nix
# ./argo.nix
# ./minecraft.nix
];

View file

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

View file

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

View file

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