pihole.yaml 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340
  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. - name: "pihole-ftl-config"
  36. configMap:
  37. name: "pihole-ftl-config"
  38. containers:
  39. - name: pihole
  40. image: 'pihole/pihole:2024.07.0'
  41. readinessProbe:
  42. httpGet:
  43. path: /admin/
  44. port: 80
  45. initialDelaySeconds: 20
  46. livenessProbe:
  47. exec:
  48. command:
  49. - dig
  50. - +short
  51. - "@127.0.0.1"
  52. - radarr.dezendorf.net
  53. initialDelaySeconds: 60
  54. periodSeconds: 30
  55. ports:
  56. - name: dns-udp
  57. containerPort: 53
  58. protocol: UDP
  59. - name: dns-tcp
  60. containerPort: 53
  61. protocol: TCP
  62. - name: web
  63. containerPort: 80
  64. protocol: TCP
  65. volumeMounts:
  66. - name: "pihole-custom-list"
  67. mountPath: "/etc/pihole/custom.list"
  68. subPath: "custom.list"
  69. readOnly: true
  70. - name: "dnsmasq-options"
  71. mountPath: "/etc/dnsmasq.d/01-pihole.conf"
  72. subPath: "01-pihole.conf"
  73. readOnly: true
  74. - name: "pihole-ftl-config"
  75. mountPath: "/etc/pihole/pihole-FTL.conf"
  76. subPath: "pihole-FTL.conf"
  77. readOnly: true
  78. affinity:
  79. podAntiAffinity:
  80. preferredDuringSchedulingIgnoredDuringExecution:
  81. - weight: 100
  82. podAffinityTerm:
  83. labelSelector:
  84. matchExpressions:
  85. - key: app
  86. operator: In
  87. values:
  88. - web
  89. topologyKey: kubernetes.io/hostname
  90. ---
  91. apiVersion: traefik.containo.us/v1alpha1
  92. kind: IngressRoute
  93. metadata:
  94. name: pihole-websecure-route
  95. namespace: default
  96. spec:
  97. entryPoints:
  98. - websecure
  99. routes:
  100. - match: Host(`pihole.dezendorf.net`)
  101. kind: Rule
  102. services:
  103. - name: pihole-web-svc
  104. port: 80
  105. tls:
  106. certResolver: myresolver
  107. ---
  108. apiVersion: v1
  109. kind: Service
  110. metadata:
  111. name: pihole-web-svc
  112. spec:
  113. type: ClusterIP
  114. ports:
  115. - name: websecure
  116. port: 80
  117. targetPort: 80
  118. selector:
  119. app: pihole
  120. ---
  121. apiVersion: v1
  122. kind: Service
  123. metadata:
  124. name: pihole-dns-tcp-svc
  125. spec:
  126. type: ClusterIP
  127. selector:
  128. app: pihole
  129. ports:
  130. - name: dns-tcp
  131. port: 53
  132. targetPort: 53
  133. protocol: TCP
  134. ---
  135. apiVersion: v1
  136. kind: Service
  137. metadata:
  138. name: pihole-dns-udp-svc
  139. spec:
  140. type: ClusterIP
  141. selector:
  142. app: pihole
  143. ports:
  144. - name: dns-udp
  145. port: 53
  146. targetPort: 53
  147. protocol: UDP
  148. ---
  149. apiVersion: traefik.containo.us/v1alpha1
  150. kind: IngressRoute
  151. metadata:
  152. name: pihole-web-route
  153. namespace: default
  154. spec:
  155. entryPoints:
  156. - web
  157. routes:
  158. - match: Host(`pihole.dezendorf.net`)
  159. kind: Rule
  160. middlewares:
  161. - name: redirecthttps
  162. services:
  163. - name: pihole-web-svc
  164. port: 80
  165. ---
  166. apiVersion: traefik.containo.us/v1alpha1
  167. kind: IngressRouteTCP
  168. metadata:
  169. name: pihole-tcp-route
  170. spec:
  171. entryPoints:
  172. - dns-tcp
  173. routes:
  174. - match: HostSNI(`*`)
  175. priority: 10
  176. services:
  177. - name: pihole-dns-tcp-svc
  178. port: 53
  179. ---
  180. apiVersion: traefik.containo.us/v1alpha1
  181. kind: IngressRouteUDP
  182. metadata:
  183. name: pihole-udp-route
  184. spec:
  185. entryPoints:
  186. - dns-udp
  187. routes:
  188. - services:
  189. - name: pihole-dns-udp-svc
  190. port: 53
  191. ---
  192. apiVersion: v1
  193. kind: ConfigMap
  194. metadata:
  195. name: pihole-custom-list
  196. namespace: default
  197. data:
  198. custom.list: |
  199. 192.168.1.9 gondor
  200. 192.168.1.50 astoria
  201. 192.168.1.87 go
  202. 192.168.1.87 photos
  203. 192.168.1.87 photo
  204. 192.168.1.87 pihole
  205. 192.168.1.87 tesseract
  206. 192.168.1.87 sso
  207. 192.168.1.87 cd
  208. 192.168.1.87 argocd
  209. 192.168.1.87 docker
  210. 192.168.1.87 dockerr
  211. 192.168.1.87 longhorn
  212. 192.168.1.87 whoami
  213. 192.168.1.87 transmission
  214. 192.168.1.87 traefik
  215. 192.168.1.87 jackett
  216. 192.168.1.87 sonarr
  217. 192.168.1.87 whisparr
  218. 192.168.1.87 radarr
  219. 192.168.1.87 bazarr
  220. 192.168.1.87 prometheus
  221. 192.168.1.87 alertmanager
  222. 192.168.1.87 readarr
  223. 192.168.1.87 calibre
  224. 192.168.1.87 books
  225. 192.168.1.87 lidarr
  226. 192.168.1.87 airsonic
  227. 192.168.1.87 beets
  228. 192.168.1.87 codeserver
  229. 192.168.1.87 gogs
  230. 192.168.1.87 grafana
  231. 192.168.1.87 mysql
  232. 192.168.1.87 devport
  233. 192.168.1.87 homeassistant
  234. 192.168.1.87 homebridge
  235. 192.168.1.87 htrae
  236. 192.168.1.157 thick2
  237. 192.168.1.158 thick1
  238. 192.168.1.151 thin1
  239. 192.168.1.152 thin2
  240. 192.168.1.153 thin3
  241. 192.168.1.154 apc-pdu-01
  242. 192.168.1.155 pve1
  243. 192.168.1.159 apc-pdu-02
  244. 192.168.1.160 rpi4-0
  245. 192.168.1.161 rpi4-1
  246. 192.168.1.162 rpi4-2
  247. 192.168.1.163 rpi4-3
  248. 192.168.1.164 rpi4-4
  249. 192.168.1.165 rpi4-5
  250. 192.168.1.166 rpi4-6
  251. 192.168.1.167 rpi4-7
  252. 192.168.1.236 plex
  253. 192.168.0.10 talos-master talos
  254. 192.168.0.11 talos-master-vm-01
  255. #192.168.0.11 talos-master-01
  256. 192.168.0.12 talos-master-vm-02
  257. 192.168.0.13 talos-master-vm-03
  258. 192.168.0.14 talos-worker-vm-01
  259. 192.168.0.15 talos-worker-vm-02
  260. 192.168.0.16 talos-worker-vm-03
  261. 192.168.0.17 talos-worker-vm-04
  262. 192.168.0.21 ceph-thin1
  263. 192.168.0.22 ceph-thin2
  264. 192.168.0.23 ceph-thin3
  265. 192.168.0.24 ceph-thin4
  266. 192.168.0.25 ceph-thin5
  267. 192.168.0.26 ceph-thin6
  268. 192.168.0.27 ceph-thin7
  269. 192.168.0.41 ceph-cache1
  270. 192.168.0.42 ceph-cache2
  271. 192.168.0.43 ceph-cache3
  272. 192.168.0.103 sv08
  273. 192.168.0.128 ceph
  274. 192.168.0.129 rados
  275. 136.61.103.116 matrix-auth.dezendorf.net
  276. 136.61.103.116 matrix.dezendorf.net
  277. ---
  278. apiVersion: v1
  279. kind: ConfigMap
  280. metadata:
  281. name: dnsmasq-options
  282. namespace: default
  283. data:
  284. 01-pihole.conf: |
  285. # Pi-hole: A black hole for Internet advertisements
  286. # (c) 2017 Pi-hole, LLC (https://pi-hole.net)
  287. # Network-wide ad blocking via your own hardware.
  288. #
  289. # Dnsmasq config for Pi-hole's FTLDNS
  290. #
  291. # This file is copyright under the latest version of the EUPL.
  292. # Please see LICENSE file for your rights under this license.
  293. ###############################################################################
  294. # FILE AUTOMATICALLY POPULATED BY PI-HOLE INSTALL/UPDATE PROCEDURE. #
  295. # ANY CHANGES MADE TO THIS FILE AFTER INSTALL WILL BE LOST ON THE NEXT UPDATE #
  296. # #
  297. # IF YOU WISH TO CHANGE THE UPSTREAM SERVERS, CHANGE THEM IN: #
  298. # /etc/pihole/setupVars.conf #
  299. # #
  300. # ANY OTHER CHANGES SHOULD BE MADE IN A SEPARATE CONFIG FILE #
  301. # WITHIN /etc/dnsmasq.d/yourname.conf #
  302. ###############################################################################
  303. addn-hosts=/etc/pihole/local.list
  304. addn-hosts=/etc/pihole/custom.list
  305. localise-queries
  306. no-resolv
  307. log-queries
  308. log-facility=/var/log/pihole/pihole.log
  309. log-async
  310. cache-size=10000
  311. server=8.8.8.8
  312. #domain-needed
  313. domain=dezendorf.net
  314. expand-hosts
  315. bogus-priv
  316. except-interface=nonexisting
  317. ---
  318. apiVersion: v1
  319. kind: ConfigMap
  320. metadata:
  321. name: pihole-ftl-config
  322. namespace: default
  323. data:
  324. pihole-FTL.conf: |
  325. #; Pi-hole FTL config file
  326. #; Comments should start with #; to avoid issues with PHP and bash reading this file
  327. PRIVACYLEVEL=0
  328. BLOCK_ICLOUD_PR=false