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 / keepalived-backup-3.conf
Created February 20, 2024 19:28
keepalived backup 3 conf
vrrp_instance VI_1 {
state BACKUP
interface eth0 # Change to your network interface name
virtual_router_id 51
priority 100 # Lower priority for backups
advert_int 1
unicast_src_ip 10.10.10.13 # piserver-b3
unicast_peer {
10.10.10.10 # piserver-p1
10.10.10.11 # piserver-b1
@sirkirby
sirkirby / keepalived-backup2.conf
Last active February 20, 2024 19:29
keepalived backup 2 conf
vrrp_instance VI_1 {
state BACKUP
interface eth0 # Change to your network interface name
virtual_router_id 51
priority 150 # Lower priority for backups
advert_int 1
unicast_src_ip 10.10.10.12 # piserver-b2
unicast_peer {
10.10.10.10 # piserver-p1
10.10.10.11 # piserver-b1
@sirkirby
sirkirby / keepalived-backup1.conf
Last active February 20, 2024 18:58
keepalived backup 1 conf
vrrp_instance VI_1 {
state BACKUP
interface eth0 # Change to your network interface name
virtual_router_id 51
priority 200 # Lower priority for backups
advert_int 1
unicast_src_ip 10.10.10.11 # piserver-b1
unicast_peer {
10.10.10.10 # piserver-p1
10.10.10.12 # piserver-b2
@sirkirby
sirkirby / keepalived-primary.conf
Last active February 20, 2024 18:57
keepalived primary config
vrrp_instance VI_1 {
state MASTER
interface eth0 # Change to your network interface name via `ip a`
virtual_router_id 51
priority 250 # Higher priority for the master, 255 max value
advert_int 1
unicast_src_ip 10.10.10.10 # piserver-p1
unicast_peer {
10.10.10.11 # piserver-b1
10.10.10.12 # piserver-b2
@sirkirby
sirkirby / dnsdist-show-servers.txt
Created February 20, 2024 18:32
dnsdist show servers
sudo dnsdist -c
> showServers()
# Name Address State Qps Qlim Ord Wt Queries Drops Drate Lat Outstanding Pools
0 pihole-cluster 10.10.10.254:53 up 0.9 0 1 1 77818 109 0.0 13.0 0
1 pihole1 10.10.10.5:53 up 0.9 0 1 1 77867 0 0.0 16.9 0
2 pihole2 10.10.10.6:53 up 0.8 0 1 1 77798 94 0.0 18.3 0
All 0.0 233483 203
@sirkirby
sirkirby / dnsdist-config.conf
Created February 20, 2024 18:29
dnsdist configuration
-- Define your Pi-hole DNS servers
newServer({address="10.10.10.254", name="pihole-cluster", checkName="cloudflare.com", checkInterval=30})
newServer({address="10.10.10.5", name="pihole1", checkName="cloudflare.com", checkInterval=30})
newServer({address="10.10.10.6", name="pihole2", checkName="cloudflare.com", checkInterval=30})
-- Set the load balancing policy
setServerPolicy(roundrobin)
-- Listen on port 53 (DNS)
addLocal("0.0.0.0:53")
@sirkirby
sirkirby / ip_vs_modules.sh
Created February 19, 2024 23:02
kube-vip additional server config
# for control-plan nodes, ensure ip_vs modules are loaded
sudo nano /etc/modules-load.d/modules.conf
# add the following
ip_vs
ip_vs_rr
ip_vs_wrr
ip_vs_sh
nf_conntrack_ipv4
@sirkirby
sirkirby / kube-vip-helm-install.sh
Created February 19, 2024 22:31
kube-vip helm install cluster
helm install my-kube-vip kube-vip/kube-vip -n kube-system -f kube_vip_values.yaml
@sirkirby
sirkirby / kube_vip_values.yaml
Created February 19, 2024 22:20
kube-vip helm values
image:
repository: ghcr.io/kube-vip/kube-vip
pullPolicy: Always
# Overrides the image tag whose default is the chart appVersion.
tag: v0.6.4
config:
address: "192.168.1.100"
env:
@sirkirby
sirkirby / kube-vip-helm.sh
Created February 19, 2024 22:18
Add kube-vip helm repository
helm repo add kube-vip https://kube-vip.github.io/helm-charts
helm repo update