feat: Expose longhorn UI on tailnet

refactor: Merge inbucket services
This commit is contained in:
Pim Kunis 2024-07-21 20:30:47 +02:00
parent e129d5cf8d
commit 6152ce4577
4 changed files with 30 additions and 52 deletions

View file

@ -1,4 +1,4 @@
{ lib, nixhelm, system, machines, ... }: { { lib, nixhelm, system, machines, myLib, ... }: {
kubernetes = { kubernetes = {
helm.releases = { helm.releases = {
metallb = { metallb = {
@ -17,6 +17,7 @@
values = { values = {
persistence.defaultClassReplicaCount = 2; persistence.defaultClassReplicaCount = 2;
service.ui.type = "LoadBalancer";
defaultSettings = { defaultSettings = {
defaultDataPath = "/mnt/longhorn"; defaultDataPath = "/mnt/longhorn";
@ -29,6 +30,8 @@
}; };
resources = { resources = {
services.longhorn-frontend.spec.loadBalancerIP = myLib.globals.longhornIPv4;
namespaces = { namespaces = {
static-websites = { }; static-websites = { };
freshrss = { }; freshrss = { };
@ -60,36 +63,6 @@
}) })
machinesWithKubernetesLabels; machinesWithKubernetesLabels;
ingresses.longhorn = {
metadata.annotations = {
"cert-manager.io/cluster-issuer" = "letsencrypt";
"traefik.ingress.kubernetes.io/router.entrypoints" = "localsecure";
};
spec = {
ingressClassName = "traefik";
rules = [{
host = "longhorn.kun.is";
http.paths = [{
path = "/";
pathType = "Prefix";
backend.service = {
name = "longhorn-frontend";
port.number = 80;
};
}];
}];
tls = [{
secretName = "longhorn-tls";
hosts = [ "longhorn.kun.is" ];
}];
};
};
recurringJobs.backup-nfs.spec = { recurringJobs.backup-nfs.spec = {
cron = "0 1 * * *"; # One o'clock at night cron = "0 1 * * *"; # One o'clock at night
task = "backup"; task = "backup";
@ -155,5 +128,14 @@
bazarr.storage = "25Mi"; bazarr.storage = "25Mi";
minecraft.storage = "1Gi"; minecraft.storage = "1Gi";
}; };
tailscaleIngresses.tailscale-longhorn = {
host = "longhorn";
service = {
name = "longhorn-frontend";
portName = "http";
};
};
}; };
} }

View file

@ -26,32 +26,28 @@
}; };
services = { services = {
web.spec = { inbucket.spec = {
type = "LoadBalancer"; type = "LoadBalancer";
loadBalancerIP = myLib.globals.inbucketWebIPv4; loadBalancerIP = myLib.globals.inbucketIPv4;
selector.app = "inbucket"; selector.app = "inbucket";
ports.web = { ports = {
smtp = {
port = 25;
targetPort = "smtp";
};
web = {
port = 80; port = 80;
targetPort = "web"; targetPort = "web";
}; };
}; };
email.spec = {
type = "LoadBalancer";
loadBalancerIP = myLib.globals.inbucketEmailIPv4;
selector.app = "inbucket";
ports = [{
port = 25;
targetPort = "smtp";
}];
}; };
}; };
}; };
lab.tailscaleIngresses.tailscale = { lab.tailscaleIngresses.tailscale = {
host = "inbucket"; host = "inbucket";
service.name = "web"; service.name = "inbucket";
}; };
} }

View file

@ -58,7 +58,7 @@
services.syncthing.spec = { services.syncthing.spec = {
type = "LoadBalancer"; type = "LoadBalancer";
loadBalancerIP = myLib.globals.syncthingWebIPv4; loadBalancerIP = myLib.globals.syncthingIPv4;
selector.app = "syncthing"; selector.app = "syncthing";
ports.web = { ports.web = {

View file

@ -8,9 +8,9 @@
bittorrentIPv4 = "192.168.30.133"; bittorrentIPv4 = "192.168.30.133";
gitIPv4 = "192.168.30.132"; gitIPv4 = "192.168.30.132";
piholeIPv4 = "192.168.30.131"; piholeIPv4 = "192.168.30.131";
inbucketEmailIPv4 = "192.168.30.130"; inbucketIPv4 = "192.168.30.130";
kmsIPv4 = "192.168.30.129"; kmsIPv4 = "192.168.30.129";
traefikIPv4 = "192.168.30.128"; traefikIPv4 = "192.168.30.128";
inbucketWebIPv4 = "192.168.30.137"; syncthingIPv4 = "192.168.30.138";
syncthingWebIPv4 = "192.168.30.138"; longhornIPv4 = "192.168.30.139";
} }