pihole.yaml 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  1. apiVersion: apps/v1
  2. kind: Deployment
  3. metadata:
  4. name: pihole
  5. labels:
  6. app: pihole
  7. spec:
  8. revisionHistoryLimit: 10
  9. replicas: 3
  10. strategy:
  11. type: RollingUpdate
  12. template:
  13. metadata:
  14. labels:
  15. app: pihole
  16. spec:
  17. dnsPolicy: ClusterFirstWithHostNet
  18. dnsConfig:
  19. nameservers:
  20. - 8.8.8.8
  21. searches:
  22. - dezendorf.net
  23. - dezendorf.com
  24. volumes:
  25. - name: "pihole-custom-list"
  26. configMap:
  27. name: "pihole-custom-list"
  28. - name: "dnsmasq-options"
  29. configMap:
  30. name: "dnsmasq-options"
  31. containers:
  32. - name: pihole
  33. image: 'pihole/pihole:latest'
  34. ports:
  35. - name: dns-udp
  36. containerPort: 53
  37. protocol: UDP
  38. - name: dns-tcp
  39. containerPort: 53
  40. protocol: TCP
  41. - name: web
  42. containerPort: 80
  43. protocol: TCP
  44. volumeMounts:
  45. - name: "pihole-custom-list"
  46. mountPath: "/etc/pihole/custom.list"
  47. subPath: "custom.list"
  48. readOnly: true
  49. - name: "dnsmasq-options"
  50. mountPath: "/etc/dnsmasq.d/01-pihole.conf"
  51. subPath: "01-pihole.conf"
  52. readOnly: true
  53. affinity:
  54. podAntiAffinity:
  55. preferredDuringSchedulingIgnoredDuringExecution:
  56. - weight: 100
  57. podAffinityTerm:
  58. labelSelector:
  59. matchExpressions:
  60. - key: app
  61. operator: In
  62. values:
  63. - web
  64. topologyKey: kubernetes.io/hostname
  65. ---
  66. apiVersion: traefik.containo.us/v1alpha1
  67. kind: IngressRoute
  68. metadata:
  69. name: pihole-websecure-route
  70. namespace: default
  71. spec:
  72. entryPoints:
  73. - websecure
  74. routes:
  75. - match: Host(`pihole.dezendorf.net`)
  76. kind: Rule
  77. services:
  78. - name: pihole-web-svc
  79. port: 80
  80. tls:
  81. certResolver: myresolver
  82. ---
  83. apiVersion: v1
  84. kind: Service
  85. metadata:
  86. name: pihole-web-svc
  87. spec:
  88. type: ClusterIP
  89. ports:
  90. - name: websecure
  91. port: 80
  92. targetPort: 80
  93. selector:
  94. app: pihole
  95. ---
  96. apiVersion: v1
  97. kind: Service
  98. metadata:
  99. name: pihole-dns-tcp-svc
  100. spec:
  101. type: ClusterIP
  102. selector:
  103. app: pihole
  104. ports:
  105. - name: dns-tcp
  106. port: 53
  107. targetPort: 53
  108. protocol: TCP
  109. ---
  110. apiVersion: v1
  111. kind: Service
  112. metadata:
  113. name: pihole-dns-udp-svc
  114. spec:
  115. type: ClusterIP
  116. selector:
  117. app: pihole
  118. ports:
  119. - name: dns-udp
  120. port: 53
  121. targetPort: 53
  122. protocol: UDP
  123. ---
  124. apiVersion: traefik.containo.us/v1alpha1
  125. kind: IngressRoute
  126. metadata:
  127. name: pihole-web-route
  128. namespace: default
  129. spec:
  130. entryPoints:
  131. - web
  132. routes:
  133. - match: Host(`pihole.dezendorf.net`)
  134. kind: Rule
  135. middlewares:
  136. - name: redirecthttps
  137. services:
  138. - name: pihole-web-svc
  139. port: 80
  140. ---
  141. apiVersion: traefik.containo.us/v1alpha1
  142. kind: IngressRouteTCP
  143. metadata:
  144. name: pihole-tcp-route
  145. spec:
  146. entryPoints:
  147. - dns-tcp
  148. routes:
  149. - match: HostSNI(`*`)
  150. priority: 10
  151. services:
  152. - name: pihole-dns-tcp-svc
  153. port: 53
  154. ---
  155. apiVersion: traefik.containo.us/v1alpha1
  156. kind: IngressRouteUDP
  157. metadata:
  158. name: pihole-udp-route
  159. spec:
  160. entryPoints:
  161. - dns-udp
  162. routes:
  163. - services:
  164. - name: pihole-dns-udp-svc
  165. port: 53
  166. ---
  167. apiVersion: v1
  168. kind: ConfigMap
  169. metadata:
  170. name: pihole-custom-list
  171. namespace: default
  172. data:
  173. custom.list: |
  174. 192.168.1.9 gondor.dezendorf.net
  175. 192.168.1.50 astoria.dezendorf.net
  176. 192.168.1.87 go.dezendorf.net
  177. 192.168.1.87 pihole.dezendorf.net
  178. 192.168.1.87 tesseract.dezendorf.net
  179. 192.168.1.87 sso.dezendorf.net
  180. 192.168.1.87 argocd.dezendorf.net
  181. 192.168.1.87 auth.dezendorf.net
  182. 192.168.1.87 longhorn.dezendorf.net
  183. 192.168.1.87 whoami.dezendorf.net
  184. 192.168.1.87 transmission.dezendorf.net
  185. 192.168.1.87 traefik.dezendorf.net
  186. 192.168.1.87 jackett.dezendorf.net
  187. 192.168.1.87 sonarr.dezendorf.net
  188. 192.168.1.87 whisparr.dezendorf.net
  189. 192.168.1.87 radarr.dezendorf.net
  190. 192.168.1.87 bazarr.dezendorf.net
  191. 192.168.1.87 prometheus.dezendorf.net
  192. 192.168.1.87 alertmanager.dezendorf.net
  193. 192.168.1.87 readarr.dezendorf.net
  194. 192.168.1.87 calibre.dezendorf.net
  195. 192.168.1.87 books.dezendorf.net
  196. 192.168.1.87 lidarr.dezendorf.net
  197. 192.168.1.87 airsonic.dezendorf.net
  198. 192.168.1.87 beets.dezendorf.net
  199. 192.168.1.87 codeserver.dezendorf.net
  200. 192.168.1.87 gogs.dezendorf.net
  201. 192.168.1.87 grafana.dezendorf.net
  202. 192.168.1.87 mysql.dezendorf.net
  203. 192.168.1.157 thick2.dezendorf.net
  204. 192.168.1.158 thick1.dezendorf.net
  205. 192.168.1.151 thin1.dezendorf.net
  206. 192.168.1.152 thin2.dezendorf.net
  207. 192.168.1.153 thin3.dezendorf.net
  208. 192.168.1.154 apc-pdu-01.dezendorf.net
  209. 192.168.1.155 pve1.dezendorf.net
  210. 192.168.1.159 apc-pdu-02.dezendorf.net
  211. 192.168.1.236 plex.dezendorf.net
  212. ---
  213. apiVersion: v1
  214. kind: ConfigMap
  215. metadata:
  216. name: dnsmasq-options
  217. namespace: default
  218. data:
  219. custom.list: |
  220. # Pi-hole: A black hole for Internet advertisements
  221. # (c) 2017 Pi-hole, LLC (https://pi-hole.net)
  222. # Network-wide ad blocking via your own hardware.
  223. #
  224. # Dnsmasq config for Pi-hole's FTLDNS
  225. #
  226. # This file is copyright under the latest version of the EUPL.
  227. # Please see LICENSE file for your rights under this license.
  228. ###############################################################################
  229. # FILE AUTOMATICALLY POPULATED BY PI-HOLE INSTALL/UPDATE PROCEDURE. #
  230. # ANY CHANGES MADE TO THIS FILE AFTER INSTALL WILL BE LOST ON THE NEXT UPDATE #
  231. # #
  232. # IF YOU WISH TO CHANGE THE UPSTREAM SERVERS, CHANGE THEM IN: #
  233. # /etc/pihole/setupVars.conf #
  234. # #
  235. # ANY OTHER CHANGES SHOULD BE MADE IN A SEPARATE CONFIG FILE #
  236. # WITHIN /etc/dnsmasq.d/yourname.conf #
  237. ###############################################################################
  238. addn-hosts=/etc/pihole/local.list
  239. addn-hosts=/etc/pihole/custom.list
  240. localise-queries
  241. no-resolv
  242. log-queries
  243. log-facility=/var/log/pihole/pihole.log
  244. log-async
  245. cache-size=10000
  246. server=8.8.8.8
  247. domain-needed
  248. expand-hosts
  249. bogus-priv
  250. except-interface=nonexisting