浏览代码

fix dnsmasq local queries

Breandan Dezendorf 2 年之前
父节点
当前提交
fcb99bd297
共有 1 个文件被更改,包括 57 次插入5 次删除
  1. 57 5
      dezendorf/homelab/k3s/pihole/pihole.yaml

+ 57 - 5
dezendorf/homelab/k3s/pihole/pihole.yaml

@@ -5,18 +5,14 @@ metadata:
   labels:
     app: pihole
 spec:
-  selector:
-    matchLabels:
-      octopusexport: OctopusExport
   revisionHistoryLimit: 10
-  replicas: 1
+  replicas: 3
   strategy:
     type: RollingUpdate
   template:
     metadata:
       labels:
         app: pihole
-        octopusexport: OctopusExport
     spec:
       dnsPolicy: ClusterFirstWithHostNet
       dnsConfig:
@@ -29,6 +25,9 @@ spec:
         - name: "pihole-custom-list"
           configMap:
             name: "pihole-custom-list"
+        - name: "dnsmasq-options"
+          configMap:
+            name:  "dnsmasq-options"
       containers:
         - name: pihole
           image: 'pihole/pihole:latest'
@@ -47,6 +46,10 @@ spec:
               mountPath: "/etc/pihole/custom.list"
               subPath: "custom.list"
               readOnly: true
+            - name: "dnsmasq-options"
+              mountPath: "/etc/dnsmasq.d/01-pihole.conf"
+              subPath: "01-pihole.conf"
+              readOnly: true
       affinity:
         podAntiAffinity:
           preferredDuringSchedulingIgnoredDuringExecution:
@@ -207,3 +210,52 @@ data:
     192.168.1.155 pve1.dezendorf.net
     192.168.1.159 apc-pdu-02.dezendorf.net
     192.168.1.236 plex.dezendorf.net
+
+---
+apiVersion: v1
+kind: ConfigMap
+metadata:
+  name: dnsmasq-options
+  namespace: default
+data:
+  custom.list: |
+    # Pi-hole: A black hole for Internet advertisements
+    # (c) 2017 Pi-hole, LLC (https://pi-hole.net)
+    # Network-wide ad blocking via your own hardware.
+    #
+    # Dnsmasq config for Pi-hole's FTLDNS
+    #
+    # This file is copyright under the latest version of the EUPL.
+    # Please see LICENSE file for your rights under this license.
+    
+    ###############################################################################
+    #      FILE AUTOMATICALLY POPULATED BY PI-HOLE INSTALL/UPDATE PROCEDURE.      #
+    # ANY CHANGES MADE TO THIS FILE AFTER INSTALL WILL BE LOST ON THE NEXT UPDATE #
+    #                                                                             #
+    #        IF YOU WISH TO CHANGE THE UPSTREAM SERVERS, CHANGE THEM IN:          #
+    #                      /etc/pihole/setupVars.conf                             #
+    #                                                                             #
+    #        ANY OTHER CHANGES SHOULD BE MADE IN A SEPARATE CONFIG FILE           #
+    #                    WITHIN /etc/dnsmasq.d/yourname.conf                      #
+    ###############################################################################
+    
+    addn-hosts=/etc/pihole/local.list
+    addn-hosts=/etc/pihole/custom.list
+    
+    
+    localise-queries
+    
+    
+    no-resolv
+    
+    log-queries
+    log-facility=/var/log/pihole/pihole.log
+    
+    log-async
+    cache-size=10000
+    server=8.8.8.8
+    domain-needed
+    expand-hosts
+    bogus-priv
+    except-interface=nonexisting
+