kubernetes-deployments/modules/dnsmasq.nix

44 lines
877 B
Nix
Raw Normal View History

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";
spec.containers.dnsmasq = {
2024-12-19 20:07:30 +00:00
image = utils.mkNixNGImage "dnsmasq";
imagePullPolicy = "Always";
2024-09-07 10:35: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";
};
};
};
};
}