Skip to content

Commit ab9a979

Browse files
committed
fix(cilium): enable dsr load balancing
Direct Server Return (DSR) should preserve the client IP address for requests https://docs.cilium.io/en/stable/network/kubernetes/kubeproxy-free/#dsr-mode Also need to change the routing mode to native for this to work Signed-off-by: Vegard Hagen <[email protected]>
1 parent b73ed2c commit ab9a979

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

k8s/infra/network/cilium/values.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ cgroup:
2121
# https://docs.cilium.io/en/stable/operations/performance/tuning/#ebpf-host-routing
2222
bpf:
2323
masquerade: true
24+
lbModeAnnotation: true
2425

2526
# https://docs.cilium.io/en/stable/network/concepts/ipam/
2627
ipam:
@@ -77,6 +78,18 @@ externalIPs:
7778
loadBalancer:
7879
# https://docs.cilium.io/en/stable/network/kubernetes/kubeproxy-free/#maglev-consistent-hashing
7980
algorithm: maglev
81+
#mode: dsr
82+
mode: snat
83+
dsrDispatch: geneve
84+
l7:
85+
backend: envoy
86+
87+
# The default "vxlan" is incompatible with loadBalancer.mode: "dsr"
88+
routingMode: native
89+
tunnelProtocol: geneve
90+
91+
ipMasqAgent:
92+
enabled: true
8093

8194
gatewayAPI:
8295
enabled: true

k8s/infra/network/gateway/gw-external.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ spec:
1010
bgp.cilium.io/advertise-service: default
1111
bgp.cilium.io/ip-pool: default
1212
l2.cilium.io/ip-pool: default
13+
annotations:
14+
service.cilium.io/forwarding-mode: dsr
1315
addresses:
1416
- type: IPAddress
1517
value: 172.20.10.110

k8s/infra/network/gateway/gw-internal.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ spec:
99
labels:
1010
bgp.cilium.io/advertise-service: default
1111
bgp.cilium.io/ip-pool: default
12+
annotations:
13+
service.cilium.io/forwarding-mode: dsr
1214
addresses:
1315
- type: IPAddress
1416
value: 172.20.10.100

0 commit comments

Comments
 (0)