feat(bind9): Move to dns k8s namespace

This commit is contained in:
Pim Kunis 2024-07-17 10:30:50 +02:00
parent 342ba2baeb
commit 7b1958e5c5
4 changed files with 55 additions and 57 deletions

View file

@ -69,6 +69,7 @@ Currently, the applications being deployed like this are:
- `attic` - `attic`
- `inbucket` - `inbucket`
- `dnsmasq` - `dnsmasq`
- `bind9`
## Known bugs ## Known bugs

View file

@ -38,7 +38,7 @@
mkDeployScriptAndManifest = module: applyset: namespace: mkDeployScriptAndManifest = module: applyset: namespace:
let let
kubernetes = (kubenix.evalModules.${system} { kubernetes = (kubenix.evalModules.${system} {
specialArgs = { inherit namespace myLib blog-pim; }; specialArgs = { inherit namespace myLib blog-pim dns; };
module = { kubenix, ... }: module = { kubenix, ... }:
{ {
@ -98,4 +98,6 @@
"${self}/kubenix-modules/inbucket.nix" "inbucket" "inbucket"; "${self}/kubenix-modules/inbucket.nix" "inbucket" "inbucket";
kubenix.dnsmasq = mkDeployScriptAndManifest kubenix.dnsmasq = mkDeployScriptAndManifest
"${self}/kubenix-modules/dnsmasq.nix" "dnsmasq" "dns"; "${self}/kubenix-modules/dnsmasq.nix" "dnsmasq" "dns";
kubenix.bind9 = mkDeployScriptAndManifest
"${self}/kubenix-modules/bind9" "bind9" "dns";
}) })

View file

@ -1,7 +1,6 @@
let let
applications = [ applications = [
./media.nix ./media.nix
./bind9
# ./argo.nix # ./argo.nix
# ./minecraft.nix # ./minecraft.nix
]; ];

View file

@ -41,69 +41,65 @@ in
}; };
}; };
deployments.bind9 = { deployments.bind9.spec = {
metadata.labels.app = "bind9"; selector.matchLabels.app = "bind9";
spec = { template = {
selector.matchLabels.app = "bind9"; metadata.labels.app = "bind9";
template = { spec = {
metadata.labels.app = "bind9"; containers = {
bind9-udp = {
image = "ubuntu/bind9:9.18-22.04_beta";
envFrom = [{ configMapRef.name = "bind9-env"; }];
spec = { ports.dns-udp = {
containers = { containerPort = 53;
bind9-udp = { protocol = "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";
}
];
}; };
bind9-tcp = { volumeMounts = [
image = "ubuntu/bind9:9.18-22.04_beta"; {
envFrom = [{ configMapRef.name = "bind9-env"; }]; name = "config";
mountPath = "/etc/bind/named.conf";
ports.dns-tcp = { subPath = "config";
containerPort = 53; }
protocol = "TCP"; {
}; name = "config";
mountPath = "/etc/bind/kun.is.zone";
volumeMounts = [ subPath = "kunis-zone";
{ }
name = "config"; ];
mountPath = "/etc/bind/named.conf";
subPath = "config";
}
{
name = "config";
mountPath = "/etc/bind/kun.is.zone";
subPath = "kunis-zone";
}
];
};
}; };
volumes = [{ bind9-tcp = {
name = "config"; image = "ubuntu/bind9:9.18-22.04_beta";
configMap.name = "bind9-config"; 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";
}];
}; };
}; };
}; };