From 22a2d7c8b122edf1c54fdb6e1b74aa247a7cc7fc Mon Sep 17 00:00:00 2001 From: Pim Kunis Date: Tue, 17 Sep 2024 13:22:02 +0200 Subject: [PATCH] Replace dnsmasq deployment with NixNG image --- flake.lock | 6 +++--- modules/dnsmasq.nix | 36 ++++++------------------------------ 2 files changed, 9 insertions(+), 33 deletions(-) diff --git a/flake.lock b/flake.lock index 01157e9..a26535c 100644 --- a/flake.lock +++ b/flake.lock @@ -411,11 +411,11 @@ "poetry2nix": "poetry2nix" }, "locked": { - "lastModified": 1725585190, - "narHash": "sha256-DFpe4CuCzjocTmDcZ6NLK2AiOOd9Orx2kIWCQTFPnNU=", + "lastModified": 1725758289, + "narHash": "sha256-7Och9QDZx5i7yNJYo/l3z46vYB7c6Hg5/XPyxMGX5mM=", "owner": "farcaller", "repo": "nixhelm", - "rev": "a8cb36a16be23d596a91bdf5876d3bd87c945049", + "rev": "f5e54a73ff511396e0262f82d34933c8745bda05", "type": "github" }, "original": { diff --git a/modules/dnsmasq.nix b/modules/dnsmasq.nix index 7cff894..f6db11d 100644 --- a/modules/dnsmasq.nix +++ b/modules/dnsmasq.nix @@ -3,44 +3,20 @@ config = lib.mkIf config.dnsmasq.enable { kubernetes.resources = { - configMaps.dnsmasq-config.data.config = '' - address=/kms.kun.is/${globals.kmsIPv4} - address=/ssh.git.kun.is/${globals.gitIPv4} - alias=${globals.routerPublicIPv4},${globals.traefikIPv4} - expand-hosts - host-record=hermes.dmz,${globals.dnsmasqIPv4} - local=/dmz/ - log-queries - no-hosts - no-resolv - port=53 - server=192.168.30.1 - server=/kun.is/${globals.bind9IPv4} - ''; - deployments.dnsmasq.spec = { selector.matchLabels.app = "dnsmasq"; template = { metadata.labels.app = "dnsmasq"; - spec = { - containers.dnsmasq = { - image = globals.images.dnsmasq; + spec.containers.dnsmasq = { + image = "nix:0/root/dnsmasq.tar"; + imagePullPolicy = "Always"; - ports.dns = { - containerPort = 53; - protocol = "UDP"; - }; - - volumeMounts = [{ - name = "config"; - mountPath = "/etc/dnsmasq.conf"; - subPath = "config"; - }]; + ports.dns = { + containerPort = 53; + protocol = "UDP"; }; - - volumes.config.configMap.name = "dnsmasq-config"; }; }; };