Skip to content

Instantly share code, notes, and snippets.

View sirkirby's full-sized avatar
:octocat:

Chris Kirby sirkirby

:octocat:
View GitHub Profile
@sirkirby
sirkirby / pi-hole-helm-values-doh.yml
Created October 6, 2023 16:40
pi-hole helm values doh
# 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"
}
@sirkirby
sirkirby / pi-hole-helm-values-dns.yml
Created October 6, 2023 16:34
pi-hole helm values dns
# create a kubernetes service and expose
# port 53 outside of cluster on the local network
serviceDns:
loadBalancerIP: 192.168.1.100
type: LoadBalancer
@sirkirby
sirkirby / pi-hole-helm-values-web.yml
Last active October 31, 2023 19:00
pi-hole helm values web
# 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
@sirkirby
sirkirby / pi-hole-helm-chart.sh
Created October 6, 2023 15:35
pi-hole helm chart
# add the repo locally and update to pull the available charts
helm repo add mojo2600 https://mojo2600.github.io/pihole-kubernetes/
helm repo update
@sirkirby
sirkirby / k3s-agent-haproxy.sh
Created October 6, 2023 15:08
k3s agent install haproxy
# 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
@sirkirby
sirkirby / keepalived-secondary-conf.sh
Created October 5, 2023 20:56
keepalived secondary configuration
# 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
@sirkirby
sirkirby / keepalived-primary-conf.sh
Last active October 5, 2023 20:56
keepalived primary configuration
# 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
@sirkirby
sirkirby / ha-proxy-setup.sh
Created October 3, 2023 21:41
HAProxy Config
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
@sirkirby
sirkirby / k3s-ha-cluster-install.sh
Last active February 19, 2024 23:01
k3s ha cluster setup
# 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
@sirkirby
sirkirby / kubectl-install.sh
Last active October 23, 2023 15:03
kubernetes-cli.sh
## 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