Skip to content

Commit 1a5a18a

Browse files
committed
fix(cilium): use dsr load-balancer mode
This should maybe fix issues with pinging VIPs https://docs.cilium.io/en/stable/network/kubernetes/kubeproxy-free/#dsr-mode Signed-off-by: Vegard Hagen <[email protected]>
1 parent 044deb3 commit 1a5a18a

File tree

5 files changed

+32
-3
lines changed

5 files changed

+32
-3
lines changed

k8s/infra/network/cilium/bgp-advertise-lb-services.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@ metadata:
66
bgp.cilium.io/advertise: loadbalancer-services
77
spec:
88
advertisements:
9-
- advertisementType: "Service"
9+
- advertisementType: Service
1010
service:
1111
addresses:
1212
- LoadBalancerIP
13+
- ExternalIP
1314
selector:
1415
matchLabels:
1516
bgp.cilium.io/advertise-service: default

k8s/infra/network/cilium/bgp-cluster-config.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@ spec:
66
nodeSelector:
77
matchLabels:
88
node-role.kubernetes.io/control-plane: ""
9+
kubernetes.io/hostname: "ctrl-01"
910
bgpInstances:
1011
- name: "65200"
1112
localASN: 65200
1213
peers:
1314
- name: "ucg-max-65100"
1415
peerASN: 65100
15-
peerAddress: 172.20.10.1
16+
peerAddress: 192.168.1.1
1617
peerConfigRef:
1718
name: ucg-max

k8s/infra/network/cilium/kustomization.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: kustomize.config.k8s.io/v1beta1
22
kind: Kustomization
33

44
resources:
5-
- announce.yaml
5+
# - announce.yaml
66
- bgp-ip-pool.yaml
77
- bgp-advertise-lb-services.yaml
88
- bgp-peer-ucg-max-config.yaml

k8s/infra/network/cilium/values.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ cgroup:
2222
# https://docs.cilium.io/en/stable/operations/performance/tuning/#ebpf-host-routing
2323
bpf:
2424
hostLegacyRouting: true
25+
# due to loadBalancer.mode: "dsr".
26+
masquerade: true
2527

2628
# https://docs.cilium.io/en/stable/network/concepts/ipam/
2729
ipam:
@@ -59,6 +61,9 @@ resources:
5961
#debug:
6062
# enabled: true
6163

64+
l2announcements:
65+
enabled: false
66+
6267
# https://docs.cilium.io/en/latest/network/bgp-control-plane/bgp-control-plane-v2/
6368
bgpControlPlane:
6469
enabled: true
@@ -71,6 +76,26 @@ externalIPs:
7176
loadBalancer:
7277
# https://docs.cilium.io/en/stable/network/kubernetes/kubeproxy-free/#maglev-consistent-hashing
7378
algorithm: maglev
79+
# https://docs.cilium.io/en/stable/network/kubernetes/kubeproxy-free/#dsr-mode
80+
mode: dsr
81+
l7:
82+
backend: envoy
83+
84+
# The default "vxlan" is incompatible with loadBalancer.mode: "dsr".
85+
routingMode: native
86+
#tunnelProtocol: ""
87+
88+
ipMasqAgent:
89+
enabled: true
90+
91+
#
92+
#enableIPv4Masquerade: true
93+
94+
# invalid daemon configuration: native routing cidr must be configured with option
95+
# --ipv4-native-routing-cidr
96+
# in combination with --enable-ipv4=true
97+
# --enable-ipv4-masquerade=true
98+
# --enable-ip-masq-agent=false --routing-mode=native --ipam=kubernetes"
7499

75100
gatewayAPI:
76101
enabled: true

k8s/infra/vpn/coturn/svc.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ metadata:
1010
lb-ipam.cilium.io/ip-pool: default-bgp
1111
spec:
1212
type: LoadBalancer
13+
externalTrafficPolicy: Local
14+
internalTrafficPolicy: Local
1315
selector:
1416
app.kubernetes.io/name: coturn
1517
ports:

0 commit comments

Comments
 (0)