pihole.yaml 7.0 KB

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