An implementation of PiHole project running on Ranchers K3s.
This setup is working for a multi-node cluster only, because PiHole is using 'low ports' for DNS and DHCP (No. 53/67), you will need a loadbalancer (MetalLB or K3s' LB) to route traffic to your pods. Having the services run on Nodeports/Hostport did not work out for me.
For the K3s setup part, i had great success with (Alex Ellis')[https://blog.alexellis.io/test-drive-k3s-on-raspberry-pi/] description.
The YAML Definition holds Service and Deployment definition for PiHole. You need to configure following things:
- within the Deployment.template.PodSpec section, to whatever DNS Servers you like to use. DO NOTE DELETE the localhost reference!
- the same applies to the environment variable section at the bottom - add your DNS servers for variables DNS1 and DNS2. These are required by PiHole
- Set a nicer Webpassword, that will be applied to the Dashboard
- Set your ServerIP to whatever is your Node's Outbound IP Address.
PiHole states, a single instance of PiHole has hardware requirements of about 500MB system memory. Slightly afraid if RPi3 would handle it, I noticed the memory usage is not going far over 200MB. Including K3s and containerd overhead, i am running at about 580MB (shortly over 50%) system memory usage.