From 6fd25419be81f348277862bc2242ae79e250fd1f Mon Sep 17 00:00:00 2001 From: Pim Kunis Date: Wed, 27 Mar 2024 23:11:34 +0100 Subject: [PATCH] enable static traefik load balancer IP --- nix/flake/kubenix/default.nix | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/nix/flake/kubenix/default.nix b/nix/flake/kubenix/default.nix index a0f786b..03ed9b5 100644 --- a/nix/flake/kubenix/default.nix +++ b/nix/flake/kubenix/default.nix @@ -32,11 +32,29 @@ version = "v1beta1"; kind = "L2Advertisement"; }; + + helmChartConfig = { + attrName = "helmChartConfigs"; + group = "helm.cattle.io"; + version = "v1"; + kind = "HelmChartConfig"; + }; }; resources = { ipAddressPools.main.spec.addresses = [ "192.168.30.128-192.168.30.200" ]; l2Advertisements.main.metadata = { }; + + # Override Traefik's service with a static load balancer IP. + helmChartConfigs.traefik = { + metadata.namespace = "kube-system"; + + spec.valuesContent = '' + service: + spec: + loadBalancerIP: "192.168.30.128" + ''; + }; }; helm.releases.metallb = {