pihole.yaml 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320
  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. 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. - name: "pihole-ftl-config"
  63. mountPath: "/etc/pihole/pihole-FTL.conf"
  64. subPath: "pihole-FTL.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
  188. 192.168.1.50 astoria
  189. 192.168.1.87 go
  190. 192.168.1.87 photos
  191. 192.168.1.87 photo
  192. 192.168.1.87 pihole
  193. 192.168.1.87 tesseract
  194. 192.168.1.87 sso
  195. 192.168.1.87 cd
  196. 192.168.1.87 argocd
  197. 192.168.1.87 docker
  198. 192.168.1.87 dockerr
  199. 192.168.1.87 longhorn
  200. 192.168.1.87 whoami
  201. 192.168.1.87 transmission
  202. 192.168.1.87 traefik
  203. 192.168.1.87 jackett
  204. 192.168.1.87 sonarr
  205. 192.168.1.87 whisparr
  206. 192.168.1.87 radarr
  207. 192.168.1.87 bazarr
  208. 192.168.1.87 prometheus
  209. 192.168.1.87 alertmanager
  210. 192.168.1.87 readarr
  211. 192.168.1.87 calibre
  212. 192.168.1.87 books
  213. 192.168.1.87 lidarr
  214. 192.168.1.87 airsonic
  215. 192.168.1.87 beets
  216. 192.168.1.87 codeserver
  217. 192.168.1.87 gogs
  218. 192.168.1.87 grafana
  219. 192.168.1.87 mysql
  220. 192.168.1.87 devport
  221. 192.168.1.87 homeassistant
  222. 192.168.1.87 homebridge
  223. 192.168.1.157 thick2
  224. 192.168.1.158 thick1
  225. 192.168.1.151 thin1
  226. 192.168.1.152 thin2
  227. 192.168.1.153 thin3
  228. 192.168.1.154 apc-pdu-01
  229. 192.168.1.155 pve1
  230. 192.168.1.159 apc-pdu-02
  231. 192.168.1.160 rpi4-0
  232. 192.168.1.161 rpi4-1
  233. 192.168.1.162 rpi4-2
  234. 192.168.1.163 rpi4-3
  235. 192.168.1.164 rpi4-4
  236. 192.168.1.165 rpi4-5
  237. 192.168.1.166 rpi4-6
  238. 192.168.1.167 rpi4-7
  239. 192.168.1.236 plex
  240. 192.168.0.10 talos-master talos
  241. 192.168.0.11 talos-master-01
  242. 192.168.0.12 talos-master-vm-02
  243. 192.168.0.13 talos-master-vm-03
  244. 192.168.0.14 talos-worker-vm-01
  245. 192.168.0.15 talos-worker-vm-02
  246. 192.168.0.16 talos-worker-vm-03
  247. 192.168.0.17 talos-worker-vm-04
  248. 192.168.0.21 ceph-thin1
  249. 192.168.0.22 ceph-thin2
  250. 192.168.0.23 ceph-thin3
  251. 192.168.0.24 ceph-thin4
  252. 192.168.0.25 ceph-thin5
  253. 192.168.0.26 ceph-thin6
  254. 192.168.0.27 ceph-thin7
  255. 192.168.0.128 ceph
  256. 192.168.0.129 rados
  257. ---
  258. apiVersion: v1
  259. kind: ConfigMap
  260. metadata:
  261. name: dnsmasq-options
  262. namespace: default
  263. data:
  264. 01-pihole.conf: |
  265. # Pi-hole: A black hole for Internet advertisements
  266. # (c) 2017 Pi-hole, LLC (https://pi-hole.net)
  267. # Network-wide ad blocking via your own hardware.
  268. #
  269. # Dnsmasq config for Pi-hole's FTLDNS
  270. #
  271. # This file is copyright under the latest version of the EUPL.
  272. # Please see LICENSE file for your rights under this license.
  273. ###############################################################################
  274. # FILE AUTOMATICALLY POPULATED BY PI-HOLE INSTALL/UPDATE PROCEDURE. #
  275. # ANY CHANGES MADE TO THIS FILE AFTER INSTALL WILL BE LOST ON THE NEXT UPDATE #
  276. # #
  277. # IF YOU WISH TO CHANGE THE UPSTREAM SERVERS, CHANGE THEM IN: #
  278. # /etc/pihole/setupVars.conf #
  279. # #
  280. # ANY OTHER CHANGES SHOULD BE MADE IN A SEPARATE CONFIG FILE #
  281. # WITHIN /etc/dnsmasq.d/yourname.conf #
  282. ###############################################################################
  283. addn-hosts=/etc/pihole/local.list
  284. addn-hosts=/etc/pihole/custom.list
  285. localise-queries
  286. no-resolv
  287. log-queries
  288. log-facility=/var/log/pihole/pihole.log
  289. log-async
  290. cache-size=10000
  291. server=8.8.8.8
  292. #domain-needed
  293. domain=dezendorf.net
  294. expand-hosts
  295. bogus-priv
  296. except-interface=nonexisting
  297. ---
  298. apiVersion: v1
  299. kind: ConfigMap
  300. metadata:
  301. name: pihole-ftl-config
  302. namespace: default
  303. data:
  304. pihole-FTL.conf: |
  305. #; Pi-hole FTL config file
  306. #; Comments should start with #; to avoid issues with PHP and bash reading this file
  307. PRIVACYLEVEL=0
  308. BLOCK_ICLOUD_PR=false