pihole.yaml 6.6 KB

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