pihole.yaml 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  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 photo
  187. 192.168.1.87 photos
  188. 192.168.1.87 dns
  189. 192.168.1.87 pihole
  190. 192.168.1.87 tesseract
  191. 192.168.1.87 sso
  192. 192.168.1.87 ssor
  193. 192.168.1.87 argocd
  194. 192.168.1.87 auth
  195. 192.168.1.87 longhorn
  196. 192.168.1.87 whoami
  197. 192.168.1.87 transmission
  198. 192.168.1.87 traefik
  199. 192.168.1.87 jackett
  200. 192.168.1.87 sonarr
  201. 192.168.1.87 whisparr
  202. 192.168.1.87 radarr
  203. 192.168.1.87 bazarr
  204. 192.168.1.87 prometheus
  205. 192.168.1.87 alertmanager
  206. 192.168.1.87 readarr
  207. 192.168.1.87 calibre
  208. 192.168.1.87 books
  209. 192.168.1.87 lidarr
  210. 192.168.1.87 lidarrr
  211. 192.168.1.87 airsonic
  212. 192.168.1.87 beets
  213. 192.168.1.87 codeserver
  214. 192.168.1.87 gogs
  215. 192.168.1.87 git
  216. 192.168.1.87 grafana
  217. 192.168.1.87 mysql
  218. 192.168.1.87 gopy
  219. 192.168.1.87 devport
  220. 192.168.1.87 wireguard
  221. 192.168.1.157 thick2
  222. 192.168.1.158 thick1
  223. 192.168.1.151 thin1
  224. 192.168.1.152 thin2
  225. 192.168.1.153 thin3
  226. 192.168.1.154 apc-pdu-01
  227. 192.168.1.155 pve1
  228. 192.168.1.159 apc-pdu-02
  229. 192.168.1.160 rpi4-0
  230. 192.168.1.161 rpi4-1
  231. 192.168.1.162 rpi4-2
  232. 192.168.1.163 rpi4-3
  233. 192.168.1.164 rpi4-4
  234. 192.168.1.165 rpi4-5
  235. 192.168.1.236 plex
  236. ---
  237. apiVersion: v1
  238. kind: ConfigMap
  239. metadata:
  240. name: dnsmasq-options
  241. namespace: default
  242. data:
  243. 01-pihole.conf: |
  244. # Pi-hole: A black hole for Internet advertisements
  245. # (c) 2017 Pi-hole, LLC (https://pi-hole.net)
  246. # Network-wide ad blocking via your own hardware.
  247. #
  248. # Dnsmasq config for Pi-hole's FTLDNS
  249. #
  250. # This file is copyright under the latest version of the EUPL.
  251. # Please see LICENSE file for your rights under this license.
  252. ###############################################################################
  253. # FILE AUTOMATICALLY POPULATED BY PI-HOLE INSTALL/UPDATE PROCEDURE. #
  254. # ANY CHANGES MADE TO THIS FILE AFTER INSTALL WILL BE LOST ON THE NEXT UPDATE #
  255. # #
  256. # IF YOU WISH TO CHANGE THE UPSTREAM SERVERS, CHANGE THEM IN: #
  257. # /etc/pihole/setupVars.conf #
  258. # #
  259. # ANY OTHER CHANGES SHOULD BE MADE IN A SEPARATE CONFIG FILE #
  260. # WITHIN /etc/dnsmasq.d/yourname.conf #
  261. ###############################################################################
  262. addn-hosts=/etc/pihole/local.list
  263. addn-hosts=/etc/pihole/custom.list
  264. localise-queries
  265. no-resolv
  266. log-queries
  267. log-facility=/var/log/pihole/pihole.log
  268. log-async
  269. cache-size=10000
  270. server=8.8.8.8
  271. #domain-needed
  272. domain=dezendorf.net
  273. expand-hosts
  274. bogus-priv
  275. except-interface=nonexisting