feat(syncthing): Move to separate k8s namespace

This commit is contained in:
Pim Kunis 2024-07-16 15:31:47 +02:00
parent a8d9e4f634
commit c8ddbb6aeb
6 changed files with 59 additions and 39 deletions

View file

@ -63,6 +63,7 @@ Currently, the applications being deployed like this are:
- `kitchenowl` - `kitchenowl`
- `forgejo` - `forgejo`
- `paperless-ngx` - `paperless-ngx`
- `syncthing`
## Known bugs ## Known bugs

View file

@ -86,4 +86,6 @@
"${self}/kubenix-modules/forgejo" "forgejo" "forgejo"; "${self}/kubenix-modules/forgejo" "forgejo" "forgejo";
kubenix.paperless = mkDeployScriptAndManifest kubenix.paperless = mkDeployScriptAndManifest
"${self}/kubenix-modules/paperless.nix" "paperless" "paperless"; "${self}/kubenix-modules/paperless.nix" "paperless" "paperless";
kubenix.syncthing = mkDeployScriptAndManifest
"${self}/kubenix-modules/syncthing.nix" "syncthing" "syncthing";
}) })

View file

@ -1,7 +1,6 @@
let let
applications = [ applications = [
./inbucket.nix ./inbucket.nix
./syncthing.nix
./pihole.nix ./pihole.nix
./media.nix ./media.nix
./bind9 ./bind9

View file

@ -71,6 +71,7 @@
kitchenowl = { }; kitchenowl = { };
forgejo = { }; forgejo = { };
paperless = { }; paperless = { };
syncthing = { };
}; };
nodes = nodes =

View file

@ -1,47 +1,42 @@
{ {
kubernetes.resources = { kubernetes.resources = {
configMaps.syncthing.data = { deployments.syncthing.spec = {
PUID = "33"; selector.matchLabels.app = "syncthing";
PGID = "33";
TZ = "Europe/Amsterdam";
};
deployments.syncthing = { template = {
metadata.labels.app = "syncthing"; metadata.labels.app = "syncthing";
spec = { spec = {
selector.matchLabels.app = "syncthing"; containers.syncthing = {
image = "lscr.io/linuxserver/syncthing:1.23.6";
ports.web.containerPort = 8384;
template = { env = {
metadata.labels.app = "syncthing"; PUID.value = "33";
PGID.value = "33";
spec = { TZ.value = "Europe/Amsterdam";
containers.syncthing = {
image = "lscr.io/linuxserver/syncthing:1.23.6";
envFrom = [{ configMapRef.name = "syncthing"; }];
ports.web.containerPort = 8384;
volumeMounts = [
{
name = "config";
mountPath = "/config";
}
{
name = "music";
mountPath = "/music";
}
];
}; };
volumes = { volumeMounts = [
config.persistentVolumeClaim.claimName = "syncthing"; {
music.persistentVolumeClaim.claimName = "music"; name = "config";
}; mountPath = "/config";
}
{
name = "music";
mountPath = "/music";
}
];
};
securityContext = { volumes = {
fsGroup = 33; config.persistentVolumeClaim.claimName = "config";
fsGroupChangePolicy = "OnRootMismatch"; music.persistentVolumeClaim.claimName = "music";
}; };
securityContext = {
fsGroup = 33;
fsGroupChangePolicy = "OnRootMismatch";
}; };
}; };
}; };
@ -55,6 +50,13 @@
targetPort = "web"; targetPort = "web";
}; };
}; };
persistentVolumeClaims.music.spec = {
accessModes = [ "ReadWriteMany" ];
storageClassName = "";
resources.requests.storage = "1Mi";
volumeName = "music-syncthing";
};
}; };
lab = { lab = {
@ -67,5 +69,10 @@
portName = "web"; portName = "web";
}; };
}; };
longhorn.persistentVolumeClaim.config = {
volumeName = "syncthing";
storage = "400Mi";
};
}; };
} }

View file

@ -12,12 +12,21 @@
# volumes.freshrss.persistentVolumeClaim.claimName = "freshrss"; # volumes.freshrss.persistentVolumeClaim.claimName = "freshrss";
# }; # };
kubernetes.resources.persistentVolumes.music-syncthing.spec = {
capacity.storage = "1Gi";
accessModes = [ "ReadWriteMany" ];
nfs = {
server = "lewis.dmz";
path = "/mnt/longhorn/persistent/media/music";
};
};
lab = { lab = {
longhornVolumes = { longhornVolumes = {
minecraft.storage = "1Gi"; minecraft.storage = "1Gi";
pihole-data.storage = "750Mi"; pihole-data.storage = "750Mi";
pihole-dnsmasq.storage = "16Mi"; pihole-dnsmasq.storage = "16Mi";
syncthing.storage = "400Mi";
jellyfin.storage = "5Gi"; jellyfin.storage = "5Gi";
transmission.storage = "25Mi"; transmission.storage = "25Mi";
jellyseerr.storage = "75Mi"; jellyseerr.storage = "75Mi";
@ -45,11 +54,12 @@
paperless-data.storage = "10Gi"; paperless-data.storage = "10Gi";
paperless-redisdata.storage = "20Mi"; paperless-redisdata.storage = "20Mi";
paperless-db.storage = "150Mi"; paperless-db.storage = "150Mi";
syncthing.storage = "400Mi";
}; };
nfsVolumes = { nfsVolumes = {
media.path = "media"; media.path = "media";
music.path = "media/music"; # music.path = "media/music";
}; };
}; };
} }