This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # enables cloudflare tunnel sidecar container | |
| # and sets upstream dns in pihole to leverage it | |
| doh: | |
| enabled: true | |
| pullPolicy: Always | |
| envVars: { | |
| DOH_UPSTREAM: "https://1.1.1.1/dns-query" | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # create a kubernetes service and expose | |
| # port 53 outside of cluster on the local network | |
| serviceDns: | |
| loadBalancerIP: 192.168.1.100 | |
| type: LoadBalancer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # these values will set our ingress proxy and allow us to point | |
| # pihole-k3s.mylocaldomain.org DNS record to 192.168.100 | |
| # will create kubernees ingress | |
| ingress: | |
| enabled: true | |
| hosts: | |
| - pihole-k3s.mylocaldomain.org | |
| # will create kubernetes services |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # add the repo locally and update to pull the available charts | |
| helm repo add mojo2600 https://mojo2600.github.io/pihole-kubernetes/ | |
| helm repo update |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # use the same token you used earlier | |
| # set the server ip address to your new VIP | |
| curl -sfL https://get.k3s.io | K3S_TOKEN=DC87A250BCBA499994CF808CEADD1BCC sh -s - agent --server https://192.168.1.100:6443 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # assuming lb2 is 192.168.1.21 | |
| vrrp_script chk_haproxy { | |
| script 'killall -0 haproxy' # faster than pidof | |
| interval 2 | |
| } | |
| vrrp_instance haproxy-vip { | |
| interface eth1 | |
| state BACKUP | |
| priority 100 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # assuming lb1 is 192.168.1.20 | |
| vrrp_script chk_haproxy { | |
| script 'killall -0 haproxy' # faster than pidof | |
| interval 2 | |
| } | |
| vrrp_instance haproxy-vip { | |
| interface eth1 | |
| state MASTER | |
| priority 200 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo nano /etc/haproxy/haproxy.cfg | |
| # add the following config, ctrl-x then y to exit and save | |
| frontend k3s-frontend | |
| bind *:6443 | |
| mode tcp | |
| option tcplog | |
| default_backend k3s-backend |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # server-1: 192.168.1.10 | |
| # server-2: 192.168.1.11 | |
| # server-3: 192.168.1.12 | |
| # lb-VIP : 192.168.1.100 | |
| # generate your own unique token | |
| # server-1 | |
| curl -sfL https://get.k3s.io | K3S_TOKEN=DC87A250BCBA499994CF808CEADD1BCC sh -s - server \ | |
| --cluster-init \ | |
| --tls-san=192.168.1.100 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## For Mac, install kubectl and helm (you'll need it later) | |
| brew install kubernetes-cli helm | |
| ## For Windows, run terminal as Admin | |
| choco install kubernetes-cli kubernetes-helm |