From 2ed872fa8fc05298e4f42368f3c799a1fd8fe848 Mon Sep 17 00:00:00 2001 From: Pim Kunis Date: Thu, 23 May 2024 22:30:30 +0200 Subject: [PATCH] Migrate media stack data to longhorn --- kubenix-modules/media.nix | 49 ++++++++++++++++++++++++++++++----- kubenix-modules/volumes.nix | 51 +++++++++++++++++++++++++++---------- 2 files changed, 80 insertions(+), 20 deletions(-) diff --git a/kubenix-modules/media.nix b/kubenix-modules/media.nix index 21b5bc1..cf191bf 100644 --- a/kubenix-modules/media.nix +++ b/kubenix-modules/media.nix @@ -76,9 +76,14 @@ }; volumes = { - config.persistentVolumeClaim.claimName = "jellyfin-config"; + config.persistentVolumeClaim.claimName = "jellyfin"; media.persistentVolumeClaim.claimName = "media"; }; + + securityContext = { + fsGroup = 0; + fsGroupChangePolicy = "OnRootMismatch"; + }; }; }; }; @@ -125,9 +130,14 @@ }; volumes = { - config.persistentVolumeClaim.claimName = "transmission-config"; + config.persistentVolumeClaim.claimName = "transmission"; media.persistentVolumeClaim.claimName = "media"; }; + + securityContext = { + fsGroup = 1000; + fsGroupChangePolicy = "OnRootMismatch"; + }; }; }; }; @@ -152,7 +162,7 @@ }; spec = { - volumes.config.persistentVolumeClaim.claimName = "jellyseerr-config"; + volumes.config.persistentVolumeClaim.claimName = "jellyseerr"; containers.jellyseerr = { image = "fallenbagel/jellyseerr:1.7.0"; @@ -164,6 +174,11 @@ mountPath = "/app/config"; }]; }; + + securityContext = { + fsGroup = 0; + fsGroupChangePolicy = "OnRootMismatch"; + }; }; }; }; @@ -206,9 +221,14 @@ }; volumes = { - config.persistentVolumeClaim.claimName = "radarr-config"; + config.persistentVolumeClaim.claimName = "radarr"; media.persistentVolumeClaim.claimName = "media"; }; + + securityContext = { + fsGroup = 1000; + fsGroupChangePolicy = "OnRootMismatch"; + }; }; }; }; @@ -233,7 +253,7 @@ }; spec = { - volumes.config.persistentVolumeClaim.claimName = "prowlarr-config"; + volumes.config.persistentVolumeClaim.claimName = "prowlarr"; containers.prowlarr = { image = "lscr.io/linuxserver/prowlarr:latest"; @@ -245,6 +265,11 @@ mountPath = "/config"; }]; }; + + securityContext = { + fsGroup = 1000; + fsGroupChangePolicy = "OnRootMismatch"; + }; }; }; }; @@ -287,9 +312,14 @@ }; volumes = { - config.persistentVolumeClaim.claimName = "sonarr-config"; + config.persistentVolumeClaim.claimName = "sonarr"; media.persistentVolumeClaim.claimName = "media"; }; + + securityContext = { + fsGroup = 1000; + fsGroupChangePolicy = "OnRootMismatch"; + }; }; }; }; @@ -332,9 +362,14 @@ }; volumes = { - config.persistentVolumeClaim.claimName = "bazarr-config"; + config.persistentVolumeClaim.claimName = "bazarr"; media.persistentVolumeClaim.claimName = "media"; }; + + securityContext = { + fsGroup = 1000; + fsGroupChangePolicy = "OnRootMismatch"; + }; }; }; }; diff --git a/kubenix-modules/volumes.nix b/kubenix-modules/volumes.nix index 9dd57f3..b6bdccd 100644 --- a/kubenix-modules/volumes.nix +++ b/kubenix-modules/volumes.nix @@ -5,19 +5,44 @@ # volumeMounts = [ # { - # name = "paperless-data"; - # mountPath = "/paperless-data"; + # name = "jellyfin"; + # mountPath = "/jellyfin"; # } # { - # name = "paperless-redisdata"; - # mountPath = "/paperless-redisdata"; + # name = "transmission"; + # mountPath = "/transmission"; + # } + # { + # name = "jellyseerr"; + # mountPath = "/jellyseerr"; + # } + # { + # name = "radarr"; + # mountPath = "/radarr"; + # } + # { + # name = "prowlarr"; + # mountPath = "/prowlarr"; + # } + # { + # name = "sonarr"; + # mountPath = "/sonarr"; + # } + # { + # name = "bazarr"; + # mountPath = "/bazarr"; # } # ]; # }; # volumes = { - # paperless-data.persistentVolumeClaim.claimName = "paperless-data"; - # paperless-redisdata.persistentVolumeClaim.claimName = "paperless-redisdata"; + # jellyfin.persistentVolumeClaim.claimName = "jellyfin"; + # transmission.persistentVolumeClaim.claimName = "transmission"; + # jellyseerr.persistentVolumeClaim.claimName = "jellyseerr"; + # radarr.persistentVolumeClaim.claimName = "radarr"; + # prowlarr.persistentVolumeClaim.claimName = "prowlarr"; + # sonarr.persistentVolumeClaim.claimName = "sonarr"; + # bazarr.persistentVolumeClaim.claimName = "bazarr"; # }; # }; @@ -35,18 +60,18 @@ syncthing.storage = "400Mi"; paperless-data.storage = "10Gi"; paperless-redisdata.storage = "20Mi"; + jellyfin.storage = "5Gi"; + transmission.storage = "25Mi"; + jellyseerr.storage = "75Mi"; + radarr.storage = "300Mi"; + prowlarr.storage = "150Mi"; + sonarr.storage = "150Mi"; + bazarr.storage = "25Mi"; }; nfsVolumes = { - jellyfin-config.path = "jellyfin/config"; media.path = "media"; music.path = "media/music"; - transmission-config.path = "transmission/config"; - jellyseerr-config.path = "jellyseerr/config"; - radarr-config.path = "radarr/config"; - prowlarr-config.path = "prowlarr/config"; - sonarr-config.path = "sonarr/config"; - bazarr-config.path = "bazarr/config"; atticd.path = "atticd"; }; };