pihole.yaml 6.5 KB

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