pihole.yaml 7.7 KB

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