Skip to content
This repository was archived by the owner on Oct 27, 2025. It is now read-only.

Commit 33ae17b

Browse files
committed
feat: bgp metallb (remove elected-node bottleneck)
Signed-off-by: 90DY <forward@90dy.ltd>
1 parent 6c4d8ee commit 33ae17b

File tree

2 files changed

+27
-32
lines changed

2 files changed

+27
-32
lines changed

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ A High Availability, frugal Kubernetes cluster using [Kubespray](https://github.
3737

3838
- **Kubernetes Core**: v1.31.4, containerd runtime, secret encryption at rest
3939
- **Networking**: Calico CNI, IPVS proxy mode with strict ARP, NodeLocal DNS cache
40-
- **High Availability**: MetalLB (Layer 2 mode), Kube-VIP (ARP mode), supplementary addresses in SSL keys
40+
- **High Availability**: MetalLB (BGP Layer 3 mode), Kube-VIP (ARP mode), supplementary addresses in SSL keys
4141
- **Enterprise Features**: Gateway API CRDs, secure communication
4242

4343
## Quick Start
@@ -104,4 +104,3 @@ Email: contact@ctnr.io
104104
## License
105105

106106
MIT License - see [LICENSE](LICENSE) file
107-

group_vars/k8s_cluster/addons.yml.ts

Lines changed: 26 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,8 @@ metallb_enabled: true
192192
metallb_speaker_enabled: "{{ metallb_enabled }}"
193193
metallb_namespace: "metallb-system"
194194
metallb_version: v0.13.9
195-
# If your VPS provider does not support BGP (like Contabo), you should use MetalLB in Layer 2 mode, which relies on ARP/NDP for IP assignment
196-
metallb_protocol: "layer2"
195+
# Using BGP Layer 3 mode to prevent node elected bottleneck and distribute traffic more efficiently
196+
metallb_protocol: "layer3"
197197
metallb_port: "7472"
198198
metallb_memberlist_port: "7946"
199199
metallb_config:
@@ -225,34 +225,30 @@ metallb_config:
225225
# external:
226226
# ip_range: ${externalIpRanges}
227227
# auto_assign: true
228-
layer2:
229-
# internal ip is for all services, external ip is for ingresses like nginx ingress controller
230-
- internal
231-
# - external
232-
# layer3:
233-
# defaults:
234-
# peer_port: 179
235-
# hold_time: 120s
236-
# communities:
237-
# vpn-only: "1234:1"
238-
# NO_ADVERTISE: "65535:65282"
239-
# metallb_peers:
240-
# peer1:
241-
# peer_address: 10.6.0.1
242-
# peer_asn: 64512
243-
# my_asn: 4200000000
244-
# communities:
245-
# - vpn-only
246-
# address_pool:
247-
# - pool1
248-
# peer2:
249-
# peer_address: 10.10.0.1
250-
# peer_asn: 64513
251-
# my_asn: 4200000000
252-
# communities:
253-
# - NO_ADVERTISE
254-
# address_pool:
255-
# - pool2
228+
# layer2:
229+
# # internal ip is for all services, external ip is for ingresses like nginx ingress controller
230+
# - internal
231+
# # - external
232+
layer3:
233+
defaults:
234+
peer_port: 179
235+
hold_time: 120s
236+
communities:
237+
internal-only: "65535:65281"
238+
NO_ADVERTISE: "65535:65282"
239+
metallb_peers:
240+
# Configure BGP peers for each worker node to distribute traffic
241+
${workers
242+
.map(
243+
(worker) => yaml`
244+
${worker.name}:
245+
peer_address: ${worker.privateIp}
246+
peer_asn: 64512
247+
my_asn: 4200000000
248+
address_pool:
249+
- internal
250+
`)
251+
.join("\n")}
256252
257253
argocd_enabled: false
258254
# argocd_version: v2.11.0

0 commit comments

Comments
 (0)