geerlingguy / turing-pi-cluster

DEPRECATED - Turing Pi cluster configuration for Raspberry Pi Compute Modules
https://www.youtube.com/watch?v=kgVz4-SEhbE
MIT License
355 stars 47 forks source link

Add Pi-hole to Turing Pi Cluster #12

Closed geerlingguy closed 4 years ago

geerlingguy commented 4 years ago

As another example of a nice little utility that can be run on a small Pi cluster (but strikes way above it's weight class in effectiveness and utility), I'd like to install Pi-hole on the cluster and see how it runs.

I'm thinking of just using this Pi-hole chart: https://github.com/MoJo2600/pihole-kubernetes/tree/master/charts/pihole

geerlingguy commented 4 years ago

(Just noting that a PV is required for persistence, and the K3s cluster includes rancher.io/local-path, so as with the MySQL databases, a reboot could really throw things for a loop if Pods that require local PVs are scheduled on different nodes than where they originally started!)

geerlingguy commented 4 years ago

So... Pi-hole is slightly heavyweight as a K8s-style app, it's better to run it directly using Docker and/or standalone. Though I had it working. The Helm chart for it (linked previously) is fairly complete but was not as simple as I was originally hoping, and I want it to be simple and fast.

I'm going to look into a newer/slimmer alternative, blocky, which even has prometheus metrics so stats can be aggregated in a Grafana dashboard! https://github.com/0xERR0R/blocky

Though I might go back to pihole...

geerlingguy commented 4 years ago

Blocky was about the same experience as Pi-hole. Slightly lighter weight and faster to start... but I do enjoy the UX of Pi-hole a bit more.

geerlingguy commented 4 years ago

Woohoo! Using the following values, I can connect via a LoadBalancer in the cluster:

      serviceUDP:
        loadBalancerIP: '10.0.100.99'
        type: LoadBalancer
Screen Shot 2020-05-25 at 10 59 11 PM

And I can add any of the worker node Pis to my DNS Servers list on my Mac to connect through Pi-hole:

Screen Shot 2020-05-25 at 11 00 01 PM
geerlingguy commented 4 years ago

And logged in as admin:

Screen Shot 2020-05-25 at 11 01 55 PM

Definitely sticking with Pi-hole for the fancy UX.

geerlingguy commented 4 years ago

Testing with dig shows 28-32ms query time for sites like apple.com/google.com.

Using my default router / ISP DNS, I get 30-48ms... maybe my ISP (Spectrum) ain't so good after all! I sometimes switch to 8.8.8.8/8.8.4.4, but for now I'm going to stick with the Turing Pi Pi-hole instance a while and see how it works out.