pihole.yaml 7.1 KB

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