Skip to content

Deploy Pi-hole to a Kubernetes cluster on a Raspberry Pi.

License

Notifications You must be signed in to change notification settings

santisbon/pi-hole-k8s

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Network-wide ad blocking with Pi-hole, Kubernetes, and Raspberry Pi

Prerequisites

  1. Set up your Raspberry Pi with a static IP.
  2. Install and configure MicroK8s (or any other lightweight Kubernetes distribution) on your Pi.

Install

  1. Prepare your Pi's storage
    # On your Pi
    sudo mkdir -p /etc/pihole
    sudo mkdir -p /etc/dnsmasq.d
  2. If installing from source, grab the code
    # On your Pi
    CHART="./piholechart"
    
    git clone https://github.com/santisbon/pi-hole-k8s.git && cd pi-hole-k8s
    nano $CHART/values.yaml
    # edit the values
    Or if installing from the repository:
    # On your Pi
    helm repo add santisbon https://santisbon.github.io/charts/
    CHART="santisbon/pihole"
  3. Install the Helm chart which will enforce the installation order. Replace parameters with a secure password and the static IP of your Pi if you didn't do it through the values.yaml file. If using MicroK8s type the commands as microk8s helm and microk8s kubectl.
    # On your Pi
    RELEASE=pihole
    NAMESPACE=pihole-n
    
    helm install $RELEASE $CHART \
        -n $NAMESPACE \
        --create-namespace \
        --set webPassword=supersecret \
        --set externalIP=192.168.XXX.XXX \
        --set webPort=8000
  4. Configure your router to set Pi-hole as your DNS server.
  5. From your desktop, access the web admin interface at http://192.168.XXX.XXX:8000/admin.

Upgrade

helm upgrade $RELEASE $CHART -n $NAMESPACE

Uninstall

helm uninstall $RELEASE -n $NAMESPACE --wait
kubectl delete namespaces $NAMESPACE

About

Deploy Pi-hole to a Kubernetes cluster on a Raspberry Pi.

Resources

License

Stars

Watchers

Forks