From 95639457f8b5d01a95c6989276c868a2168b53b8 Mon Sep 17 00:00:00 2001 From: Pim Kunis Date: Tue, 21 May 2024 22:35:46 +0200 Subject: [PATCH] Migrate Nextcloud to Longhorn --- kubenix-modules/nextcloud.nix | 5 +++ kubenix-modules/syncthing.nix | 70 +++++++++++++++++------------------ kubenix-modules/volumes.nix | 8 ++-- 3 files changed, 44 insertions(+), 39 deletions(-) diff --git a/kubenix-modules/nextcloud.nix b/kubenix-modules/nextcloud.nix index f0049ce..ba9b59f 100644 --- a/kubenix-modules/nextcloud.nix +++ b/kubenix-modules/nextcloud.nix @@ -35,6 +35,11 @@ mountPath = "/var/www/html"; }]; }; + + securityContext = { + fsGroup = 33; + fsGroupChangePolicy = "OnRootMismatch"; + }; }; }; }; diff --git a/kubenix-modules/syncthing.nix b/kubenix-modules/syncthing.nix index 3474461..8aa12c4 100644 --- a/kubenix-modules/syncthing.nix +++ b/kubenix-modules/syncthing.nix @@ -6,46 +6,46 @@ TZ = "Europe/Amsterdam"; }; - deployments.syncthing = { - metadata.labels.app = "syncthing"; + # deployments.syncthing = { + # metadata.labels.app = "syncthing"; - spec = { - selector.matchLabels.app = "syncthing"; + # spec = { + # selector.matchLabels.app = "syncthing"; - template = { - metadata.labels.app = "syncthing"; + # template = { + # metadata.labels.app = "syncthing"; - spec = { - containers.syncthing = { - image = "lscr.io/linuxserver/syncthing:1.23.6"; - envFrom = [{ configMapRef.name = "syncthing"; }]; - ports.web.containerPort = 8384; + # spec = { + # containers.syncthing = { + # image = "lscr.io/linuxserver/syncthing:1.23.6"; + # envFrom = [{ configMapRef.name = "syncthing"; }]; + # ports.web.containerPort = 8384; - volumeMounts = [ - { - name = "config"; - mountPath = "/config"; - } - { - name = "nextcloud-data"; - mountPath = "/data"; - } - { - name = "music"; - mountPath = "/music"; - } - ]; - }; + # volumeMounts = [ + # { + # name = "config"; + # mountPath = "/config"; + # } + # { + # name = "nextcloud-data"; + # mountPath = "/data"; + # } + # { + # name = "music"; + # mountPath = "/music"; + # } + # ]; + # }; - volumes = { - config.persistentVolumeClaim.claimName = "syncthing"; - nextcloud-data.persistentVolumeClaim.claimName = "nextcloud"; - music.persistentVolumeClaim.claimName = "music"; - }; - }; - }; - }; - }; + # volumes = { + # config.persistentVolumeClaim.claimName = "syncthing"; + # nextcloud-data.persistentVolumeClaim.claimName = "nextcloud"; + # music.persistentVolumeClaim.claimName = "music"; + # }; + # }; + # }; + # }; + # }; services.syncthing.spec = { selector.app = "syncthing"; diff --git a/kubenix-modules/volumes.nix b/kubenix-modules/volumes.nix index 004a3d1..a2f9995 100644 --- a/kubenix-modules/volumes.nix +++ b/kubenix-modules/volumes.nix @@ -5,14 +5,14 @@ # volumeMounts = [ # { - # name = "minecraft"; - # mountPath = "/minecraft"; + # name = "nextcloud"; + # mountPath = "/nextcloud"; # } # ]; # }; # volumes = { - # minecraft.persistentVolumeClaim.claimName = "minecraft"; + # nextcloud.persistentVolumeClaim.claimName = "nextcloud"; # }; # }; @@ -22,6 +22,7 @@ freshrss.storage = "400Mi"; radicale.storage = "200Mi"; minecraft.storage = "1Gi"; + nextcloud.storage = "50Gi"; }; nfsVolumes = { @@ -41,7 +42,6 @@ pihole-dnsmasq.path = "pihole/dnsmasq"; paperless-ngx-redisdata.path = "paperless-ngx/redisdata"; paperless-ngx-data.path = "paperless-ngx/data"; - nextcloud.path = "nextcloud/data"; forgejo.path = "forgejo/data"; forgejo-runner-data.path = "forgejo/runner/data"; forgejo-runner-certs.path = "forgejo/runner/certs";