Skip to content

Instantly share code, notes, and snippets.

@iler
Created March 29, 2020 10:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iler/57260fe9ad94cf93ab726ae02cf364e7 to your computer and use it in GitHub Desktop.
Save iler/57260fe9ad94cf93ab726ae02cf364e7 to your computer and use it in GitHub Desktop.
pihole-cloudflared.yaml
apiVersion: v1
kind: Namespace
metadata:
name: pihole-system
---
apiVersion: v1
kind: ConfigMap
metadata:
name: pihole-ftl.conf
namespace: pihole-system
data:
pihole-FTL.conf: |
MAXDBDAYS=7
LOGFILE=/var/log/pihole/pihole-FTL.log
---
apiVersion: v1
kind: ConfigMap
metadata:
name: whitelist.txt
namespace: pihole-system
data:
whitelist.txt: |
ichnaea.netflix.com
nrdp.nccp.netflix.com
collector-medium.lightstep.com
newrelic.com
---
apiVersion: v1
kind: ConfigMap
metadata:
name: adlists.list
namespace: pihole-system
data:
adlists.list: |
https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
https://mirror1.malwaredomains.com/files/justdomains
http://sysctl.org/cameleon/hosts
https://s3.amazonaws.com/lists.disconnect.me/simple_tracking.txt
https://s3.amazonaws.com/lists.disconnect.me/simple_ad.txt
https://hosts-file.net/ad_servers.txt
https://raw.githubusercontent.com/Perflyst/PiHoleBlocklist/master/SmartTV.txt
https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/master/data/hosts/spy.txt
https://blocklist.site/app/dl/malware
https://blocklist.site/app/dl/spam
https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
https://gitlab.com/quidsup/notrack-blocklists/raw/master/notrack-blocklist.txt
---
apiVersion: v1
kind: ConfigMap
metadata:
name: pihole-env
namespace: pihole-system
data:
TZ: Europe/Helsinki
DNS1: 127.0.0.1#5054
DNS2: 127.0.0.1#5054
WEBPASSWORD: salakala
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: pihole
namespace: pihole-system
labels:
app: pihole
spec:
replicas: 3
selector:
matchLabels:
app: pihole
template:
metadata:
labels:
app: pihole
spec:
containers:
- name: pihole-cloudflared
image: visibilityspots/cloudflared:amd64
resources:
requests:
memory: "64Mi"
cpu: "250m"
limits:
memory: "128Mi"
cpu: "500m"
- name: pihole-core
image: pihole/pihole:v4.4
resources:
requests:
memory: "64Mi"
cpu: "250m"
limits:
memory: "128Mi"
cpu: "500m"
readinessProbe:
exec:
command: ['dig', '@127.0.0.1', 'hs.fi']
timeoutSeconds: 20
initialDelaySeconds: 5
periodSeconds: 60
env:
- name: TZ
valueFrom:
configMapKeyRef:
name: pihole-env
key: TZ
- name: WEBPASSWORD
valueFrom:
configMapKeyRef:
name: pihole-env
key: WEBPASSWORD
- name: DNS1
valueFrom:
configMapKeyRef:
name: pihole-env
key: DNS1
- name: DNS2
valueFrom:
configMapKeyRef:
name: pihole-env
key: DNS2
ports:
- name: web
containerPort: 80
- name : dns
protocol : UDP
containerPort: 53
volumeMounts:
- name: etc-pihole
mountPath: /etc/pihole
- name: etc-dnsmasq
mountPath: /etc/dnsmasq.d
- name: var-log
mountPath: /var/log
- name: var-log-lighttpd
mountPath: /var/log/lighttpd
- name: ftlconf
mountPath: /etc/pihole/pihole-FTL.conf
subPath: pihole-FTL.conf
- name: whitelist
mountPath: /etc/pihole/whitelist.txt
subPath: whitelist.txt
- name: adlists
mountPath: /etc/pihole/adlists.list
subPath: adlists.list
volumes:
- name: etc-pihole
emptyDir:
medium: Memory
- name: etc-dnsmasq
emptyDir:
medium: Memory
- name: var-log
emptyDir:
medium: Memory
- name: var-log-lighttpd
emptyDir:
medium: Memory
- name: ftlconf
configMap:
name: pihole-ftl.conf
items:
- key: pihole-FTL.conf
path: pihole-FTL.conf
- name: whitelist
configMap:
name: whitelist.txt
items:
- key: whitelist.txt
path: whitelist.txt
- name: adlists
configMap:
name: adlists.list
items:
- key: adlists.list
path: adlists.list
---
kind: Service
apiVersion: v1
metadata:
name: pihole-web-service
namespace : pihole-system
spec:
selector:
app: pihole
ports:
- protocol: TCP
port: 80
targetPort: 80
name : web
type: LoadBalancer
loadBalancerIP: 10.10.71.10
---
kind: Service
apiVersion: v1
metadata:
name: pihole-dns-service
namespace: pihole-system
spec:
selector:
app: pihole
ports:
- protocol: UDP
port: 53
targetPort: 53
name : dns
type: LoadBalancer
loadBalancerIP: 10.10.71.11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment