Add wyse pihole to traefik

This commit is contained in:
Joey Hafner 2023-03-04 20:55:13 -08:00
parent 61d105eeca
commit 6c8f7d83b6
3 changed files with 161 additions and 1 deletions

View File

@ -0,0 +1,107 @@
container {
name pihole {
description Pihole
environment PIHOLE_DNS_ {
value "1.1.1.1;8.8.8.8"
}
environment QUERY_LOGGING {
value false
}
environment TZ {
value America/Eastern
}
image pihole/pihole:latest
network pihole-net {
address 172.20.0.10
}
}
network pihole-net {
prefix 172.20.0.0/24
}
}
interfaces {
ethernet eth0 {
address dhcp
}
ethernet eth1 {
address 10.0.0.1/24
}
loopback lo {
}
}
nat {
source {
rule 100 {
outbound-interface eth0
source {
address 10.0.0.0/24
}
translation {
address masquerade
}
}
}
}
service {
dns {
forwarding {
allow-from 10.0.0.0/24
cache-size 0
listen-address 10.0.0.1
name-server 172.20.0.10
}
}
ssh {
port 22
}
}
system {
config-management {
commit-revisions 100
}
conntrack {
modules {
ftp
h323
nfs
pptp
sip
sqlnet
tftp
}
}
console {
device ttyS0 {
speed 115200
}
}
host-name vyos
login {
user vyos {
authentication {
encrypted-password REDACTED
plaintext-password ""
}
}
}
name-server 1.1.1.1
name-server 8.8.8.8
ntp {
server time1.vyos.net {
}
server time2.vyos.net {
}
server time3.vyos.net {
}
}
syslog {
global {
facility all {
level info
}
facility protocols {
level debug
}
}
}
}

40
router/config/pihole.md Normal file
View File

@ -0,0 +1,40 @@
Adding a Pihole container has hit a few roadblocks.
Here is the basic container configuration I attempted to use:
```
container name pihole {
cap-add net-admin
environment TZ {
value America/Los_Angeles
}
environment WEBPASSWORD {
value Raider8-Payable-Veto-Dictation
}
image pihole/pihole
memory 256
network default {
address 172.18.0.2
}
port dns {
destination 53
source 53
}
port webui {
destination 80
source 80
}
volume pihole_dnsmasq {
destination /etc/dnsmasq
source /home/vyos/container/pihole/dnsmasq
}
volume pihole_pihole {
destination /etc/pihole
source /home/vyos/container/pihole/pihole
}
}
network default {
prefix 172.18.0.0/16
}
```
With this configuration, we see the Pihole is failing to bring up the DNS service due to a port collision.

View File

@ -8,9 +8,22 @@ http:
service: "pi-pihole@file"
tls:
certResolver: "lets-encrypt"
wyse-pihole:
rule: "Host(`wyse.pihole.jafner.net`)"
entryPoints: "websecure"
middlewares:
- "lan-only@file"
service: "wyse-pihole@file"
tls:
certResolver: "lets-encrypt"
services:
pi-pihole:
loadBalancer:
servers:
- url: "http://192.168.1.21/"
- url: "http://192.168.1.21/"
wyse-pihole:
loadBalancer:
servers:
- url: "http://192.168.1.32/"