add nodeAffinity and make k3s pihole master

This commit is contained in:
2025-12-01 18:49:31 +05:30
parent d08c891f97
commit 9d715e1ca4
2 changed files with 15 additions and 4 deletions

View File

@@ -6,10 +6,10 @@ metadata:
data: data:
keepalived.conf: | keepalived.conf: |
vrrp_instance PIHOLE_VIP { vrrp_instance PIHOLE_VIP {
state BACKUP state MASTER
interface eth0 interface eth0
virtual_router_id 212 virtual_router_id 212
priority 100 priority 50
advert_int 1 advert_int 1
virtual_ipaddress { virtual_ipaddress {

View File

@@ -2,7 +2,7 @@
apiVersion: apps/v1 apiVersion: apps/v1
kind: DaemonSet kind: DaemonSet
metadata: metadata:
name: pihole-backup name: pihole
namespace: tools namespace: tools
spec: spec:
selector: selector:
@@ -14,7 +14,18 @@ spec:
app: pihole app: pihole
spec: spec:
hostNetwork: true hostNetwork: true
dnsPolicy: ClusterFirstWithHostNet
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- kube-02
- kube-03
- kube-04
- kube-05
initContainers: initContainers:
- name: init-keepalived - name: init-keepalived