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

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

View file

@ -89,11 +89,13 @@
kubenix.syncthing = mkDeployScriptAndManifest kubenix.syncthing = mkDeployScriptAndManifest
"${self}/kubenix-modules/syncthing.nix" "syncthing" "syncthing"; "${self}/kubenix-modules/syncthing.nix" "syncthing" "syncthing";
kubenix.pihole = mkDeployScriptAndManifest kubenix.pihole = mkDeployScriptAndManifest
"${self}/kubenix-modules/pihole.nix" "pihole" "pihole"; "${self}/kubenix-modules/pihole.nix" "pihole" "dns";
kubenix.immich = mkDeployScriptAndManifest kubenix.immich = mkDeployScriptAndManifest
"${self}/kubenix-modules/immich.nix" "immich" "immich"; "${self}/kubenix-modules/immich.nix" "immich" "immich";
kubenix.attic = mkDeployScriptAndManifest kubenix.attic = mkDeployScriptAndManifest
"${self}/kubenix-modules/attic.nix" "attic" "attic"; "${self}/kubenix-modules/attic.nix" "attic" "attic";
kubenix.inbucket = mkDeployScriptAndManifest kubenix.inbucket = mkDeployScriptAndManifest
"${self}/kubenix-modules/inbucket.nix" "inbucket" "inbucket"; "${self}/kubenix-modules/inbucket.nix" "inbucket" "inbucket";
kubenix.dnsmasq = mkDeployScriptAndManifest
"${self}/kubenix-modules/dnsmasq.nix" "dnsmasq" "dns";
}) })

View file

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

View file

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

View file

@ -1,6 +1,5 @@
{ myLib, ... }: { { myLib, ... }: {
kubernetes.resources = { kubernetes.resources = {
# TODO: generate this with nix?
configMaps.dnsmasq-config.data.config = '' configMaps.dnsmasq-config.data.config = ''
address=/kms.kun.is/${myLib.globals.kmsIPv4} address=/kms.kun.is/${myLib.globals.kmsIPv4}
address=/ssh.git.kun.is/${myLib.globals.gitIPv4} address=/ssh.git.kun.is/${myLib.globals.gitIPv4}
@ -16,10 +15,7 @@
server=/kun.is/${myLib.globals.bind9IPv4} server=/kun.is/${myLib.globals.bind9IPv4}
''; '';
deployments.dnsmasq = { deployments.dnsmasq.spec = {
metadata.labels.app = "dnsmasq";
spec = {
selector.matchLabels.app = "dnsmasq"; selector.matchLabels.app = "dnsmasq";
template = { template = {
@ -45,7 +41,6 @@
}; };
}; };
}; };
};
services.dnsmasq.spec = { services.dnsmasq.spec = {
type = "LoadBalancer"; type = "LoadBalancer";

View file

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