feat(dnsmasq): Move to dns k8s namespace

refactor(pihole): Move to dns k8s namespace
This commit is contained in:
Pim Kunis 2024-07-17 10:25:23 +02:00
parent e9307da90d
commit 342ba2baeb
6 changed files with 29 additions and 32 deletions

View file

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

View file

@ -72,10 +72,10 @@
forgejo = { };
paperless = { };
syncthing = { };
pihole = { };
immich = { };
attic = { };
inbucket = { };
dns = { };
};
nodes =

View file

@ -1,6 +1,5 @@
{ myLib, ... }: {
kubernetes.resources = {
# TODO: generate this with nix?
configMaps.dnsmasq-config.data.config = ''
address=/kms.kun.is/${myLib.globals.kmsIPv4}
address=/ssh.git.kun.is/${myLib.globals.gitIPv4}
@ -16,33 +15,29 @@
server=/kun.is/${myLib.globals.bind9IPv4}
'';
deployments.dnsmasq = {
metadata.labels.app = "dnsmasq";
deployments.dnsmasq.spec = {
selector.matchLabels.app = "dnsmasq";
spec = {
selector.matchLabels.app = "dnsmasq";
template = {
metadata.labels.app = "dnsmasq";
template = {
metadata.labels.app = "dnsmasq";
spec = {
containers.dnsmasq = {
image = "dockurr/dnsmasq:2.90";
spec = {
containers.dnsmasq = {
image = "dockurr/dnsmasq:2.90";
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";
volumeMounts = [{
name = "config";
mountPath = "/etc/dnsmasq.conf";
subPath = "config";
}];
};
volumes.config.configMap.name = "dnsmasq-config";
};
};
};

View file

@ -44,8 +44,8 @@
};
volumes = {
data.persistentVolumeClaim.claimName = "data";
dnsmasq.persistentVolumeClaim.claimName = "dnsmasq";
data.persistentVolumeClaim.claimName = "pihole-data";
dnsmasq.persistentVolumeClaim.claimName = "pihole-dnsmasq";
};
securityContext = {
@ -57,7 +57,7 @@
};
services = {
web.spec = {
pihole-web.spec = {
selector.app = "pihole";
ports.web = {
@ -66,7 +66,7 @@
};
};
dns.spec = {
pihole-dns.spec = {
type = "LoadBalancer";
loadBalancerIP = myLib.globals.piholeIPv4;
selector.app = "pihole";
@ -86,18 +86,18 @@
entrypoint = "localsecure";
service = {
name = "web";
name = "pihole-web";
portName = "web";
};
};
longhorn.persistentVolumeClaim = {
data = {
pihole-data = {
volumeName = "pihole-data";
storage = "750Mi";
};
dnsmasq = {
pihole-dnsmasq = {
volumeName = "pihole-dnsmasq";
storage = "16Mi";
};