Skip to content

Instantly share code, notes, and snippets.

@cclloyd
Created January 30, 2020 01:04
Show Gist options
  • Save cclloyd/c102371ac2e7066407d03e4120aa5c95 to your computer and use it in GitHub Desktop.
Save cclloyd/c102371ac2e7066407d03e4120aa5c95 to your computer and use it in GitHub Desktop.
pihole k8s
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: pihole
namespace: wfs
labels:
app: pihole
spec:
replicas: 1
selector:
matchLabels:
app: pihole
template:
metadata:
labels:
app: pihole
spec:
#dnsConfig:
# nameservers:
# - 127.0.0.1
# - 10.0.0.1
#dnsPolicy: None
containers:
- name: pihole
image: pihole/pihole:latest
imagePullPolicy: Always
securityContext:
capabilities:
add:
- NET_ADMIN
ports:
- containerPort: 80
name: http
protocol: TCP
- containerPort: 53
name: dns
protocol: TCP
- containerPort: 53
name: dns-udp
protocol: UDP
env:
- name: TZ
value: "America/New_York"
- name: DNS1
value: "10.0.0.1"
- name: DNS2
value: 1.1.1.1
# value: "no"
volumeMounts:
- name: pihole-data
mountPath: /etc/pihole
- name: pihole-dns
mountPath: /etc/dnsmasq.d
volumes:
- name: pihole-data
persistentVolumeClaim:
claimName: pihole-pvc
- name: pihole-dns
persistentVolumeClaim:
claimName: pihole-dns-pvc
---
kind: Service
apiVersion: v1
metadata:
name: pihole-tcp
namespace: wfs
annotations:
metallb.universe.tf/address-pool: default
metallb.universe.tf/allow-shared-ip: pihole
spec:
selector:
app: pihole
externalTrafficPolicy: Local
ports:
- protocol: TCP
name: dns
port: 53
targetPort: dns
- protocol: TCP
name: http
port: 80
targetPort: http
type: LoadBalancer
---
kind: Service
apiVersion: v1
metadata:
name: pihole-udp
namespace: wfs
annotations:
metallb.universe.tf/address-pool: default
metallb.universe.tf/allow-shared-ip: pihole
spec:
selector:
app: pihole
externalTrafficPolicy: Local
ports:
- protocol: UDP
name: dns
port: 53
targetPort: dns-udp
type: LoadBalancer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment