Replace dnsmasq deployment with NixNG image

This commit is contained in:
Pim Kunis 2024-09-17 13:22:02 +02:00
parent 0cc17722cb
commit 22a2d7c8b1
2 changed files with 9 additions and 33 deletions

View file

@ -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": {

View file

@ -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";
};
};
};