My complete yaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: etc-pvc
spec:
storageClassName: mayastor-3
accessModes: [ReadWriteOnce]
resources: { requests: { storage: 2Gi } }
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: dnsmasq-pvc
spec:
storageClassName: mayastor-3
accessModes: [ReadWriteOnce]
resources: { requests: { storage: 5Gi } }
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: pihole
name: pihole
namespace: pi-hole
spec:
selector:
matchLabels:
app: pihole
template:
metadata:
labels:
app: pihole
spec:
nodeSelector:
localstorage: dir
hostNetwork: true
dnsPolicy: "None"
dnsConfig:
nameservers:
# upstream DNS used by pihole.
- 192.168.178.1
containers:
- image: pihole/pihole:2023.05.2
imagePullPolicy: IfNotPresent
name: pihole
env:
- name: TZ
value: "Europe/Amsterdam"
- name: DNSMASQ_USER
value: "root"
- name: IPv6
value: "false"
- name: WEBPASSWORD
value: "Test7283"
- name: INTERFACE
value: "ens33"
securityContext:
privileged: true
capabilities:
add:
- NET_ADMIN
- NET_BIND_SERVICE
- NET_RAW
- NET_ADMIN
- SYS_NICE
- CHOWN
ports:
- containerPort: 53
protocol: TCP
- containerPort: 53
protocol: UDP
- containerPort: 67
protocol: UDP
- containerPort: 80
hostPort: 80
protocol: TCP
- containerPort: 443
hostPort: 443
protocol: TCP
volumeMounts:
- name: etc
mountPath: '/etc/pihole'
- name: dnsmasq
mountPath: '/etc/dnsmasq.d'
resources:
requests:
memory: 128Mi
cpu: 100m
limits:
hugepages-2Mi: 128Mi
memory: 2Gi
cpu: 1
restartPolicy: Always
volumes:
- name: etc
persistentVolumeClaim:
claimName: etc-pvc
- name: dnsmasq
persistentVolumeClaim:
claimName: dnsmasq-pvc
---
apiVersion: v1
kind: Service
metadata:
labels:
app: pihole
name: pihole-tcp
namespace: pi-hole
spec:
ports:
- port: 80
nodePort: 30480
name: port80
protocol: TCP
- port: 443
nodePort: 30443
name: port443
protocol: TCP
- port: 53
targetPort: 53
nodePort: 30453
protocol: TCP
name: port53
- port: 53
targetPort: 53
protocol: UDP
nodePort: 30456
name: port53-udp
- port: 67
targetPort: 67
protocol: UDP
name: port67-udp
selector:
app: pihole
type: LoadBalancer
~