pihole.yaml 8.0 KB

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