pihole

by SavePointSam

Helm chartv0.2.0App 2023.05.0Verified publisher

A Helm chart to deploy pi-hole on Kubernetes

About this chart

Pi-hole

Pi-holeĀ® is a DNS sinkhole that protects your devices from unwanted content without installing any client-side software.

TL;DR

$ helm repo add savepointsam https://savepointsam.github.io/charts
$ helm install my-release savepointsam/pihole

Introduction

This chart bootstraps a Pi-hole deployment on a Kubernetes cluster using the Helm package manager.

Prerequisites

  • Kubernetes 1.20+
  • Helm 3.2.0+

Installing the Chart

To install the chart with the release name my-release:

helm install my-release savepointsam/pihole

The command deploys unbound on the Kubernetes cluster in the default configuration. The Parameters section lists the parameters that can be configured during installation.

Tip: List all releases using helm list

Uninstalling the Chart

To uninstall/delete the my-release deployment:

helm delete my-release

The command removes all the Kubernetes components associated with the chart and deletes the release.

Parameters

Global parameters

NameDescriptionValue
global.imageRegistryGlobal Docker image registry""
global.imagePullSecretsGlobal Docker registry secret names as an array[]
global.storageClassGlobal StorageClass for Persistent Volume(s)""

Common parameters

NameDescriptionValue
kubeVersionOverride Kubernetes version""
nameOverrideString to partially override common.names.name""
fullnameOverrideString to fully override common.names.fullname""
namespaceOverrideString to fully override common.names.namespace""
commonLabelsLabels to add to all deployed objects{}
commonAnnotationsAnnotations to add to all deployed objects{}
clusterDomainKubernetes cluster domain namecluster.local
extraDeployArray of extra objects to deploy with the release[]
diagnosticMode.enabledEnable diagnostic mode (all probes will be disabled and the command will be overridden)false
diagnosticMode.commandCommand to override all containers in the deployment["sleep"]
diagnosticMode.argsArgs to override all containers in the deployment["infinity"]

Pi-hole parameters

NameDescriptionValue
pihole.timezoneTimezone for log rotation calculationAmerica/Los_Angeles
pihole.upstreamList of upstream DNS servers["8.8.8.8","8.8.4.4"]
pihole.dnssec.enabledEnable DNSSECfalse
pihole.privateRangeForwarding.enabledEnable forwarding of reverse lookup for private rangesfalse
pihole.requireFqdnOnly forward Full Qualified Domain Namestrue
pihole.virtualHostHostname/IP for admin web UI access in addition to default "pi.hole/admin"""
pihole.ipv6SupportRetain/Remove IPv6 configurationtrue
pihole.temperatureUnitPreferred temperature unit ("c", "f", or "k")f
pihole.reverseServer.enabledEnable rev-serverfalse
pihole.reverseServer.domainDomain of local network router""
pihole.reverseServer.targetIP address of local network router""
pihole.reverseServer.cidrReverse DNS zone""
pihole.webui.admin.emailDefault admin email for web UI""
pihole.webui.admin.passwordDefault admin password for web UI""
pihole.webui.boxedLayoutEnable boxed layout in web UItrue
pihole.webui.queryLoggingEnable query loggingtrue
pihole.webui.themeSet web UI theme ("default-dark", "default-darker", "default-light", "default-auto", "lcars")default-auto

Pi-hole advanced parameters

NameDescriptionValue
pihole.advanced.webPortThis will break the 'webpage blocked' functionality of Pi-hole however it may help advanced setups. This guide explains how to restore webpage blocked functionality using a linux router DNAT rule: https://discourse.pi-hole.net/t/alternative-synology-installation-method/5454?u=diginc""

| pihole.advanced.webBindAddress | Lighttpd's bind address. If left unset lighttpd will bind to every interface, except when running in host networking mode where it will use FTLCONF_LOCAL_IPV4 instead. | "" | | pihole.advanced.skipGravityOnBoot | Use this option to skip updating the Gravity Database when booting up the container | false | | pihole.advanced.corsHosts | List of domains/subdomains on which CORS is allowed. Wildcards are not supported | [] | | pihole.advanced.customCacheSize | Set the cache size for dnsmasq. When pihole.dnssec.enabled is "true", then this setting is ignored | 10000 | | pihole.advanced.ftlCmd | Customize the options with which pihole-ftl starts | no-daemon | | pihole.advanced.ftlConf | Customize pihole-FTL.conf with settings described here: https://docs.pi-hole.net/ftldns/configfile/ | {} |

Pi-hole experimental parameters

NameDescriptionValue
pihole.experimental.dnsmasqUserAllows changing the user that FTLDNS runs as""
pihole.experimental.piholeUidOverrides image's default pihole user id to match a host user id""
pihole.experimental.piholeGidOverrides image's default pihole group id to match a host group id""
pihole.experimental.webUidOverrides image's default www-data user id to match a host user id""
pihole.experimental.webGidOverrides image's default www-data group id to match a host group id""
pihole.experimental.weblogsStdout"true" logs to defined files, "false" redirect access and error logs to stdoutfalse

Pi-hole deployment parameters

NameDescriptionValue
pihole.image.registryPi-hole image registrydocker.io
pihole.image.repositoryPi-hole image repositorypihole/pihole
pihole.image.tagPi-hole image tag (immutable tags are recommended)2022.05
pihole.image.pullPolicyPi-hole image pull policyIfNotPresent
pihole.image.pullSecretsPi-hole image pull secrets[]
pihole.image.debugEnable Pi-hole image debug modefalse
pihole.replicaCountNumber of Pi-hole replicas to deploy1
pihole.containerPorts.dnsPi-hole DNS container port53
pihole.containerPorts.httpPi-hole HTTP container port80
pihole.containerPorts.dhcpPi-hole DHCP container port67
pihole.containerPorts.dhcpv6Pi-hole DHCPv6 container port547
pihole.livenessProbe.enabledEnable livenessProbe on Pi-hole containerstrue
pihole.livenessProbe.initialDelaySecondsInitial delay seconds for livenessProbe60
pihole.livenessProbe.periodSecondsPeriod seconds for livenessProbe10
pihole.livenessProbe.timeoutSeconds

Deploy pihole with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has pihole on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartpihole is pinned at v0.2.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply