diff --git a/README.md b/README.md index 836d3a4..f1bd22f 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,7 @@ Currently, the applications being deployed like this are: - `attic` - `inbucket` - `dnsmasq` +- `bind9` ## Known bugs diff --git a/flake-parts/kubenix.nix b/flake-parts/kubenix.nix index d6f45ca..fdf4418 100644 --- a/flake-parts/kubenix.nix +++ b/flake-parts/kubenix.nix @@ -38,7 +38,7 @@ mkDeployScriptAndManifest = module: applyset: namespace: let kubernetes = (kubenix.evalModules.${system} { - specialArgs = { inherit namespace myLib blog-pim; }; + specialArgs = { inherit namespace myLib blog-pim dns; }; module = { kubenix, ... }: { @@ -98,4 +98,6 @@ "${self}/kubenix-modules/inbucket.nix" "inbucket" "inbucket"; kubenix.dnsmasq = mkDeployScriptAndManifest "${self}/kubenix-modules/dnsmasq.nix" "dnsmasq" "dns"; + kubenix.bind9 = mkDeployScriptAndManifest + "${self}/kubenix-modules/bind9" "bind9" "dns"; }) diff --git a/kubenix-modules/all.nix b/kubenix-modules/all.nix index 95eaf8e..8e77fc0 100644 --- a/kubenix-modules/all.nix +++ b/kubenix-modules/all.nix @@ -1,7 +1,6 @@ let applications = [ ./media.nix - ./bind9 # ./argo.nix # ./minecraft.nix ]; diff --git a/kubenix-modules/bind9/default.nix b/kubenix-modules/bind9/default.nix index 7ce9a08..50aaefc 100644 --- a/kubenix-modules/bind9/default.nix +++ b/kubenix-modules/bind9/default.nix @@ -41,69 +41,65 @@ in }; }; - deployments.bind9 = { - metadata.labels.app = "bind9"; + deployments.bind9.spec = { + selector.matchLabels.app = "bind9"; - spec = { - selector.matchLabels.app = "bind9"; + template = { + metadata.labels.app = "bind9"; - template = { - metadata.labels.app = "bind9"; + spec = { + containers = { + bind9-udp = { + image = "ubuntu/bind9:9.18-22.04_beta"; + envFrom = [{ configMapRef.name = "bind9-env"; }]; - spec = { - containers = { - bind9-udp = { - image = "ubuntu/bind9:9.18-22.04_beta"; - envFrom = [{ configMapRef.name = "bind9-env"; }]; - - ports.dns-udp = { - containerPort = 53; - protocol = "UDP"; - }; - - volumeMounts = [ - { - name = "config"; - mountPath = "/etc/bind/named.conf"; - subPath = "config"; - } - { - name = "config"; - mountPath = "/etc/bind/kun.is.zone"; - subPath = "kunis-zone"; - } - ]; + ports.dns-udp = { + containerPort = 53; + protocol = "UDP"; }; - bind9-tcp = { - image = "ubuntu/bind9:9.18-22.04_beta"; - envFrom = [{ configMapRef.name = "bind9-env"; }]; - - ports.dns-tcp = { - containerPort = 53; - protocol = "TCP"; - }; - - volumeMounts = [ - { - name = "config"; - mountPath = "/etc/bind/named.conf"; - subPath = "config"; - } - { - name = "config"; - mountPath = "/etc/bind/kun.is.zone"; - subPath = "kunis-zone"; - } - ]; - }; + volumeMounts = [ + { + name = "config"; + mountPath = "/etc/bind/named.conf"; + subPath = "config"; + } + { + name = "config"; + mountPath = "/etc/bind/kun.is.zone"; + subPath = "kunis-zone"; + } + ]; }; - volumes = [{ - name = "config"; - configMap.name = "bind9-config"; - }]; + bind9-tcp = { + image = "ubuntu/bind9:9.18-22.04_beta"; + envFrom = [{ configMapRef.name = "bind9-env"; }]; + + ports.dns-tcp = { + containerPort = 53; + protocol = "TCP"; + }; + + volumeMounts = [ + { + name = "config"; + mountPath = "/etc/bind/named.conf"; + subPath = "config"; + } + { + name = "config"; + mountPath = "/etc/bind/kun.is.zone"; + subPath = "kunis-zone"; + } + ]; + }; }; + + volumes = [{ + name = "config"; + configMap.name = "bind9-config"; + }]; }; }; };