2024-04-13 21:25:48 +00:00
|
|
|
{ myLib, ... }: {
|
2024-03-28 22:05:05 +00:00
|
|
|
kubernetes.resources = {
|
2024-06-15 20:27:07 +00:00
|
|
|
secrets.pihole.stringData.webPassword = "ref+sops://secrets/kubernetes.yaml#/pihole/password";
|
2024-03-28 22:05:05 +00:00
|
|
|
|
2024-07-16 13:46:13 +00:00
|
|
|
deployments.pihole.spec = {
|
|
|
|
selector.matchLabels.app = "pihole";
|
2024-03-28 22:05:05 +00:00
|
|
|
|
2024-07-30 18:33:07 +00:00
|
|
|
strategy = {
|
|
|
|
type = "RollingUpdate";
|
|
|
|
|
|
|
|
rollingUpdate = {
|
|
|
|
maxSurge = 0;
|
|
|
|
maxUnavailable = 1;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-07-16 13:46:13 +00:00
|
|
|
template = {
|
|
|
|
metadata.labels.app = "pihole";
|
2024-03-28 22:05:05 +00:00
|
|
|
|
2024-07-16 13:46:13 +00:00
|
|
|
spec = {
|
|
|
|
containers.pihole = {
|
2024-07-30 19:28:35 +00:00
|
|
|
image = myLib.globals.images.pihole;
|
2024-03-28 22:05:05 +00:00
|
|
|
|
2024-07-16 13:46:13 +00:00
|
|
|
env = {
|
|
|
|
TZ.value = "Europe/Amsterdam";
|
|
|
|
PIHOLE_DNS_.value = "192.168.30.1";
|
2024-03-28 22:05:05 +00:00
|
|
|
|
2024-07-16 13:46:13 +00:00
|
|
|
WEBPASSWORD.valueFrom.secretKeyRef = {
|
2024-04-14 19:00:15 +00:00
|
|
|
name = "pihole";
|
|
|
|
key = "webPassword";
|
|
|
|
};
|
2024-03-28 22:05:05 +00:00
|
|
|
};
|
|
|
|
|
2024-07-16 13:46:13 +00:00
|
|
|
ports = {
|
|
|
|
web.containerPort = 80;
|
2024-05-23 18:11:04 +00:00
|
|
|
|
2024-07-16 13:46:13 +00:00
|
|
|
dns = {
|
|
|
|
containerPort = 53;
|
|
|
|
protocol = "UDP";
|
|
|
|
};
|
2024-05-23 18:11:04 +00:00
|
|
|
};
|
2024-07-16 13:46:13 +00:00
|
|
|
|
|
|
|
volumeMounts = [
|
|
|
|
{
|
|
|
|
name = "data";
|
|
|
|
mountPath = "/etc/pihole";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "dnsmasq";
|
|
|
|
mountPath = "/etc/dnsmasq.d";
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
volumes = {
|
2024-07-17 08:25:23 +00:00
|
|
|
data.persistentVolumeClaim.claimName = "pihole-data";
|
|
|
|
dnsmasq.persistentVolumeClaim.claimName = "pihole-dnsmasq";
|
2024-07-16 13:46:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
securityContext = {
|
|
|
|
fsGroup = 1000;
|
|
|
|
fsGroupChangePolicy = "OnRootMismatch";
|
2024-03-28 22:05:05 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
services = {
|
2024-07-21 18:02:40 +00:00
|
|
|
pihole.spec = {
|
2024-03-28 22:05:05 +00:00
|
|
|
type = "LoadBalancer";
|
2024-04-13 21:25:48 +00:00
|
|
|
loadBalancerIP = myLib.globals.piholeIPv4;
|
2024-03-28 22:05:05 +00:00
|
|
|
selector.app = "pihole";
|
|
|
|
|
2024-07-21 18:02:40 +00:00
|
|
|
ports = {
|
|
|
|
dns = {
|
|
|
|
protocol = "UDP";
|
|
|
|
port = 53;
|
|
|
|
targetPort = "dns";
|
|
|
|
};
|
|
|
|
|
|
|
|
web = {
|
|
|
|
port = 80;
|
|
|
|
targetPort = "web";
|
|
|
|
};
|
2024-04-14 19:43:31 +00:00
|
|
|
};
|
2024-03-28 22:05:05 +00:00
|
|
|
};
|
|
|
|
};
|
2024-04-14 21:11:19 +00:00
|
|
|
};
|
2024-03-28 22:05:05 +00:00
|
|
|
|
2024-04-14 21:34:54 +00:00
|
|
|
lab = {
|
2024-07-16 13:46:13 +00:00
|
|
|
longhorn.persistentVolumeClaim = {
|
2024-07-17 08:25:23 +00:00
|
|
|
pihole-data = {
|
2024-07-16 13:46:13 +00:00
|
|
|
volumeName = "pihole-data";
|
|
|
|
storage = "750Mi";
|
|
|
|
};
|
|
|
|
|
2024-07-17 08:25:23 +00:00
|
|
|
pihole-dnsmasq = {
|
2024-07-16 13:46:13 +00:00
|
|
|
volumeName = "pihole-dnsmasq";
|
|
|
|
storage = "16Mi";
|
|
|
|
};
|
|
|
|
};
|
2024-07-21 18:02:40 +00:00
|
|
|
|
|
|
|
tailscaleIngresses.tailscale-pihole = {
|
|
|
|
host = "pihole";
|
|
|
|
service.name = "pihole";
|
|
|
|
};
|
2024-03-28 22:05:05 +00:00
|
|
|
};
|
|
|
|
}
|