This commit is contained in:
Waylon Walker 2025-11-22 22:20:32 -06:00
parent 8c0277c8f3
commit 9e2c30af22
60 changed files with 8853 additions and 232 deletions

2788
pihole/basic-install.sh Normal file

File diff suppressed because it is too large Load diff

157
pihole/deployment.yaml Normal file
View file

@ -0,0 +1,157 @@
---
apiVersion: v1
kind: Service
metadata:
annotations:
kompose.cmd: kompose convert -o deployment.yaml -n pihole
kompose.service.expose: pihole.wayl.one
kompose.version: 1.31.2 (a92241f79)
creationTimestamp: null
labels:
io.kompose.service: pihole
name: pihole
namespace: pihole
spec:
ports:
- name: "80"
port: 80
targetPort: 80
selector:
io.kompose.service: pihole
status:
loadBalancer: {}
---
apiVersion: v1
kind: Namespace
metadata:
creationTimestamp: null
name: pihole
namespace: pihole
spec: {}
status: {}
---
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
kompose.cmd: kompose convert -o deployment.yaml -n pihole
kompose.service.expose: pihole.wayl.one
kompose.version: 1.31.2 (a92241f79)
creationTimestamp: null
labels:
io.kompose.service: pihole
name: pihole
namespace: pihole
spec:
replicas: 1
selector:
matchLabels:
io.kompose.service: pihole
strategy:
type: Recreate
template:
metadata:
annotations:
kompose.cmd: kompose convert -o deployment.yaml -n pihole
kompose.service.expose: pihole.wayl.one
kompose.version: 1.31.2 (a92241f79)
creationTimestamp: null
labels:
io.kompose.network/pihole-default: "true"
io.kompose.service: pihole
spec:
containers:
- env:
- name: TZ
value: America/Chicago
- name: WEBPASSWORD
value: password
image: pihole/pihole:latest
name: pihole
ports:
- containerPort: 80
protocol: TCP
resources: {}
securityContext:
capabilities:
add:
- NET_ADMIN
volumeMounts:
- mountPath: /etc/pihole
name: pihole
- mountPath: /etc/dnsmasq.d
name: dnsmasq
restartPolicy: Always
volumes:
- name: pihole
persistentVolumeClaim:
claimName: pihole
- name: dnsmasq
persistentVolumeClaim:
claimName: dnsmasq
status: {}
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
kompose.cmd: kompose convert -o deployment.yaml -n pihole
kompose.service.expose: pihole.wayl.one
kompose.version: 1.31.2 (a92241f79)
creationTimestamp: null
labels:
io.kompose.service: pihole
name: pihole
namespace: pihole
spec:
rules:
- host: pihole.wayl.one
http:
paths:
- backend:
service:
name: pihole
port:
number: 80
path: /
pathType: Prefix
status:
loadBalancer: {}
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
creationTimestamp: null
labels:
io.kompose.service: pihole
name: pihole
namespace: pihole
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100Mi
status: {}
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
creationTimestamp: null
labels:
io.kompose.service: dnsmasq
name: dnsmasq
namespace: pihole
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100Mi
status: {}

View file

@ -4,67 +4,23 @@ services:
pihole:
image: pihole/pihole:latest
container_name: pihole
restart: unless-stopped
security_opt:
- no-new-privileges:true
networks:
- proxy
# Volumes store your data between container upgrades
volumes:
- /etc/localtime:/etc/localtime:ro
- ${PWD}/pihole/data/etc-pihole/:/etc/pihole/
- ${PWD}/pihole/data/etc-dnsmasq.d/:/etc/dnsmasq.d/
# ports:
# - "8080:80/tcp"
# - "53:53/tcp"
# - "53:53/udp"
# - "67:67/udp"
- pihole:/etc/pihole/
- dnsmasq:/etc/dnsmasq.d/
ports:
- 80
environment:
# TZ: "America/Chicago"
WEBPASSWORD: "${PIHOLE_PASSWORD}"
TZ: "America/Chicago"
WEBPASSWORD: password
# Recommended but not required (DHCP needs NET_ADMIN)
# https://github.com/pi-hole/docker-pi-hole#note-on-capabilities
cap_add:
- NET_ADMIN
labels:
- "traefik.enable=true"
- "traefik.http.routers.pihole.entrypoints=http"
- "traefik.http.routers.pihole.rule=Host(`pihole.${URL}`)"
- "traefik.http.middlewares.pihole-https-redirect.redirectscheme.scheme=https"
- "traefik.http.routers.pihole.middlewares=pihole-https-redirect"
- "traefik.http.routers.pihole-secure.entrypoints=https"
- "traefik.http.routers.pihole-secure.rule=Host(`pihole.${URL}`)"
- "traefik.http.routers.pihole-secure.tls=true"
- "traefik.http.routers.pihole-secure.service=pihole"
- "traefik.http.services.pihole.loadbalancer.server.port=80"
- "traefik.docker.network=proxy"
kompose.service.expose: pihole.wayl.one
networks:
proxy:
external: true
#
# version: "3"
# # More info at https://github.com/pi-hole/docker-pi-hole/ and https://docs.pi-hole.net/
# services:
# pihole:
# container_name: pihole
# image: pihole/pihole:latest
# # For DHCP it is recommended to remove these ports and instead add: network_mode: "host"
# ports:
# # - "53:53/tcp"
# # - "53:53/udp"
# # - "67:67/udp" # Only required if you are using Pi-hole as your DHCP server
# - "8080:80/tcp"
# environment:
# TZ: "America/Chicago"
# # WEBPASSWORD: 'set a secure password here or it will be random'
# # Volumes store your data between container upgrades
# volumes:
# - "./etc-pihole:/etc/pihole"
# - "./etc-dnsmasq.d:/etc/dnsmasq.d"
# # https://github.com/pi-hole/docker-pi-hole#note-on-capabilities
# cap_add:
# - NET_ADMIN # Required if you are using Pi-hole as your DHCP server, else not needed
# restart: unless-stopped
volumes:
pihole:
dnsmasq:

10
pihole/justfile Normal file
View file

@ -0,0 +1,10 @@
default: convert deploy viz
convert:
kompose convert -o deployment.yaml -n pihole
deploy:
kubectl apply -f deployment.yaml
viz:
k8sviz -n pihole --kubeconfig $KUBECONFIG -t png -o pihole-k8s.png
restart:
kubectl rollout restart -n pihole deployment/pihole