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`
- `forgejo`
- `paperless-ngx`
- `syncthing`
## Known bugs

View file

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

View file

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

View file

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

View file

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

View file

@ -12,12 +12,21 @@
# 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 = {
longhornVolumes = {
minecraft.storage = "1Gi";
pihole-data.storage = "750Mi";
pihole-dnsmasq.storage = "16Mi";
syncthing.storage = "400Mi";
jellyfin.storage = "5Gi";
transmission.storage = "25Mi";
jellyseerr.storage = "75Mi";
@ -45,11 +54,12 @@
paperless-data.storage = "10Gi";
paperless-redisdata.storage = "20Mi";
paperless-db.storage = "150Mi";
syncthing.storage = "400Mi";
};
nfsVolumes = {
media.path = "media";
music.path = "media/music";
# music.path = "media/music";
};
};
}