pihole.yaml 7.7 KB

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