2024-10-28 15:05:06 +00:00
|
|
|
{
|
|
|
|
utils,
|
|
|
|
globals,
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}: {
|
2024-09-07 10:35:02 +00:00
|
|
|
options.dnsmasq.enable = lib.mkEnableOption "dnsmasq";
|
|
|
|
|
|
|
|
config = lib.mkIf config.dnsmasq.enable {
|
|
|
|
kubernetes.resources = {
|
|
|
|
deployments.dnsmasq.spec = {
|
|
|
|
selector.matchLabels.app = "dnsmasq";
|
|
|
|
|
|
|
|
template = {
|
|
|
|
metadata.labels.app = "dnsmasq";
|
|
|
|
|
2024-09-17 11:22:02 +00:00
|
|
|
spec.containers.dnsmasq = {
|
2024-12-19 20:07:30 +00:00
|
|
|
image = utils.mkNixNGImage "dnsmasq";
|
2024-09-17 11:22:02 +00:00
|
|
|
imagePullPolicy = "Always";
|
2024-09-07 10:35:02 +00:00
|
|
|
|
2024-09-17 11:22:02 +00:00
|
|
|
ports.dns = {
|
|
|
|
containerPort = 53;
|
|
|
|
protocol = "UDP";
|
2024-09-07 10:35:02 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
services.dnsmasq.spec = {
|
|
|
|
loadBalancerIP = globals.dnsmasqIPv4;
|
|
|
|
type = "LoadBalancer";
|
|
|
|
selector.app = "dnsmasq";
|
|
|
|
|
|
|
|
ports.dns = {
|
|
|
|
port = 53;
|
|
|
|
targetPort = "dns";
|
|
|
|
protocol = "UDP";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|