Giter Club home page Giter Club logo

pihole-kubernetes's Introduction

Pihole on Kubernetes

HOW-TO

This section covers how to setup pihole on a kubernetes cluster. Most of the commands to interact with the service is covered in the Makefile, feel free to have a look.

Guide

First create a namespace:

kubectl create namespace pihole

Then setup the .env for your

ADMIN_EMAIL="<email>"
WEBPASSWORD="x"
PIHOLE_DNS_=1.1.1.1

Please check the documentation for setting up the latests updated paramaters docker pihole.

add the configmap to your cluster

kubectl create configmap app-configs --from-env-file=.env -n pihole

Spin up the pods for the kubernetes cluster.

kubectl apply -f .

โš ๏ธ Remember to change your loadBalancerIP to a static ip that fits your cluster.

Confirm that pihole is running:

kubectl get pods -n pihole
NAME       READY   STATUS    RESTARTS   AGE
pihole-0   1/1     Running   0          3d13h
pihole-1   1/1     Running   0          3d13h

Voila, pihole should be up and running ๐Ÿค“

To get the external ip for the pods

kubectl get services -n pihole

ConfigMap

If you don't want to use an .env file to setup the configmap, you can add it straight into pihole.yml.

---
apiVersion: v1
kind: ConfigMap
metadata:
  name: pihole-configmap
  namespace: pihole
data:
  TZ: "Europe/Paris"
  ADMIN_EMAIL: "[email protected]"
  WEBPASSWORD: "xxx"
  PIHOLE_DNS_: 1.1.1.1
---

Unbound

If you want to setup Pi-hole unbound/, you need to run unbound on the kubernetes cluster. Again, remember to change loadBalancerIP in unbound.yaml to your own static ip. Then set PIHOLE_DNS_ to point to unbound service.

Source

The templates are either copy-pasted or based on these sources:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.