pihole.yaml 8.1 KB

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