From d3d6abdde810822ef316a7620ea5a6a4f36bbaa9 Mon Sep 17 00:00:00 2001 From: Pim Kunis Date: Sun, 21 Jul 2024 21:00:32 +0200 Subject: [PATCH] feat: Rollout tailscale for media stack fix: Add default for tailscale ingress option --- kubenix-modules/custom/tailscale.nix | 2 + kubenix-modules/media.nix | 128 +++++++++++---------------- my-lib/globals.nix | 23 +++-- 3 files changed, 71 insertions(+), 82 deletions(-) diff --git a/kubenix-modules/custom/tailscale.nix b/kubenix-modules/custom/tailscale.nix index 0789c6c..29ad04f 100644 --- a/kubenix-modules/custom/tailscale.nix +++ b/kubenix-modules/custom/tailscale.nix @@ -15,6 +15,8 @@ }; }; }); + + default = { }; }; }; diff --git a/kubenix-modules/media.nix b/kubenix-modules/media.nix index f921ebe..52b525c 100644 --- a/kubenix-modules/media.nix +++ b/kubenix-modules/media.nix @@ -419,34 +419,32 @@ }; }; - transmission-web.spec = { - selector = { - app = "media"; - component = "transmission"; - }; - - ports.web = { - port = 80; - targetPort = "web"; - }; - }; - - transmission-bittorrent.spec = { + transmission.spec = { type = "LoadBalancer"; - loadBalancerIP = myLib.globals.bittorrentIPv4; + loadBalancerIP = myLib.globals.transmissionIPv4; selector = { app = "media"; component = "transmission"; }; - ports.bittorrent = { - port = 31780; - targetPort = "bittorrent"; + ports = { + bittorrent = { + port = 31780; + targetPort = "bittorrent"; + }; + + web = { + port = 80; + targetPort = "web"; + }; }; }; jellyseerr.spec = { + type = "LoadBalancer"; + loadBalancerIP = myLib.globals.jellyseerrIPv4; + selector = { app = "media"; component = "jellyseerr"; @@ -459,6 +457,9 @@ }; radarr.spec = { + type = "LoadBalancer"; + loadBalancerIP = myLib.globals.radarrIPv4; + selector = { app = "media"; component = "radarr"; @@ -471,6 +472,9 @@ }; prowlarr.spec = { + type = "LoadBalancer"; + loadBalancerIP = myLib.globals.prowlarrIPv4; + selector = { app = "media"; component = "prowlarr"; @@ -483,6 +487,9 @@ }; sonarr.spec = { + type = "LoadBalancer"; + loadBalancerIP = myLib.globals.sonarrIPv4; + selector = { app = "media"; component = "sonarr"; @@ -495,6 +502,9 @@ }; bazarr.spec = { + type = "LoadBalancer"; + loadBalancerIP = myLib.globals.bazarrIPv4; + selector = { app = "media"; component = "bazarr"; @@ -523,74 +533,44 @@ }; lab = { - ingresses = { - jellyfin = { - host = "media.kun.is"; + ingresses.jellyfin = { + host = "media.kun.is"; - service = { - name = "jellyfin"; - portName = "web"; - }; + service = { + name = "jellyfin"; + portName = "web"; + }; + }; + + tailscaleIngresses = { + tailscale-jellyseerr = { + host = "jellyseerr"; + service.name = "jellyseerr"; }; - transmission = { - host = "transmission.kun.is"; - entrypoint = "localsecure"; - - service = { - name = "transmission-web"; - portName = "web"; - }; + tailscale-radarr = { + host = "radarr"; + service.name = "radarr"; }; - jellyseerr = { - host = "jellyseerr.kun.is"; - entrypoint = "localsecure"; - - service = { - name = "jellyseerr"; - portName = "web"; - }; + tailscale-sonarr = { + host = "sonarr"; + service.name = "sonarr"; }; - radarr = { - host = "radarr.kun.is"; - entrypoint = "localsecure"; - - service = { - name = "radarr"; - portName = "web"; - }; + tailscale-bazarr = { + host = "bazarr"; + service.name = "bazarr"; }; - prowlarr = { - host = "prowlarr.kun.is"; - entrypoint = "localsecure"; - - service = { - name = "prowlarr"; - portName = "web"; - }; + tailscale-prowlarr = { + host = "prowlarr"; + service.name = "prowlarr"; }; - sonarr = { - host = "sonarr.kun.is"; - entrypoint = "localsecure"; - - service = { - name = "sonarr"; - portName = "web"; - }; - }; - - bazarr = { - host = "bazarr.kun.is"; - entrypoint = "localsecure"; - - service = { - name = "bazarr"; - portName = "web"; - }; + tailscale-transmission = { + host = "transmission"; + service.name = "transmission"; }; }; diff --git a/my-lib/globals.nix b/my-lib/globals.nix index 602a1b8..e9a5806 100644 --- a/my-lib/globals.nix +++ b/my-lib/globals.nix @@ -1,16 +1,23 @@ { routerPublicIPv4 = "192.145.57.90"; routerPublicIPv6 = "2a0d:6e00:1a77::1"; - minecraftIPv4 = "192.168.30.136"; - dnsmasqIPv4 = "192.168.30.135"; - bind9IPv4 = "192.168.30.134"; bind9Ipv6 = "2a0d:6e00:1a77:30::134"; - bittorrentIPv4 = "192.168.30.133"; - gitIPv4 = "192.168.30.132"; - piholeIPv4 = "192.168.30.131"; - inbucketIPv4 = "192.168.30.130"; - kmsIPv4 = "192.168.30.129"; + + # Load balancer IPv4 traefikIPv4 = "192.168.30.128"; + kmsIPv4 = "192.168.30.129"; + inbucketIPv4 = "192.168.30.130"; + piholeIPv4 = "192.168.30.131"; + gitIPv4 = "192.168.30.132"; + transmissionIPv4 = "192.168.30.133"; + bind9IPv4 = "192.168.30.134"; + dnsmasqIPv4 = "192.168.30.135"; + minecraftIPv4 = "192.168.30.136"; + jellyseerrIPv4 = "192.168.30.137"; syncthingIPv4 = "192.168.30.138"; longhornIPv4 = "192.168.30.139"; + radarrIPv4 = "192.168.30.140"; + prowlarrIPv4 = "192.168.30.141"; + sonarrIPv4 = "192.168.30.142"; + bazarrIPv4 = "192.168.30.143"; }