pihole.yaml 6.8 KB

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