apiVersion: v1 kind: PersistentVolumeClaim metadata: name: pihole-pvc namespace: pihole spec: accessModes: - ReadWriteOnce resources: requests: storage: 1Gi --- apiVersion: apps/v1 kind: Deployment metadata: name: pihole namespace: pihole labels: app: pihole spec: replicas: 1 selector: matchLabels: app: pihole template: metadata: labels: app: pihole spec: dnsPolicy: "None" dnsConfig: nameservers: - 8.8.8.8 - 8.8.4.4 containers: - name: pihole image: pihole/pihole:latest ports: - containerPort: 80 name: http - containerPort: 53 name: dns-tcp protocol: TCP - containerPort: 53 name: dns-udp protocol: UDP env: - name: TZ value: "Europe/Madrid" #- name: WEBPASSWORD #value: "" #- name: FTLCONF_webserver_api_password #value: '' #- name: DNSMASQ_LISTENING #value: "all" - name: FTLCONF_dns_listeningMode value: "all" - name: WEB_PORT value: "80" #- name: VIRTUAL_HOST #value: "pihole" #- name: FTLCONF_LOCAL_IPV4 #value: "0.0.0.0" - name: SKIPGRAVITYONBOOT value: "1" volumeMounts: - name: pihole-data mountPath: /etc/pihole #- name: pihole-dnsmasq #mountPath: /etc/dnsmasq.d resources: requests: memory: "256Mi" cpu: "100m" limits: memory: "512Mi" cpu: "500m" securityContext: capabilities: add: - NET_ADMIN - SYS_TIME - SYS_NICE volumes: - name: pihole-data persistentVolumeClaim: claimName: pihole-pvc #- name: pihole-dnsmasq #emptyDir: {} --- apiVersion: v1 kind: Service metadata: name: pihole-web namespace: pihole labels: app: pihole spec: type: ClusterIP ports: - port: 80 targetPort: 80 protocol: TCP name: http selector: app: pihole --- apiVersion: v1 kind: Service metadata: name: pihole-dns namespace: pihole labels: app: pihole spec: type: LoadBalancer ports: - port: 53 targetPort: 53 protocol: TCP name: dns-tcp - port: 53 targetPort: 53 protocol: UDP name: dns-udp selector: app: pihole