pihole.yaml 6.8 KB

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