Skip to content

Commit fd76862

Browse files
committed
test(bgp): enable bgp in cilium
Signed-off-by: Vegard Hagen <[email protected]>
1 parent 6fd4d4b commit fd76862

File tree

14 files changed

+105
-6
lines changed

14 files changed

+105
-6
lines changed

k8s/apps/dev/whoami/svc.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ metadata:
44
name: whoami
55
namespace: whoami
66
annotations:
7-
io.cilium/lb-ipam-ips: 192.168.1.223
7+
io.cilium/lb-ipam-ips: 192.168.1.223,172.20.10.200
8+
labels:
9+
ip-pool: default
10+
advertise: bgp
811
spec:
912
type: LoadBalancer
1013
selector:

k8s/apps/utils/torrent/svc-torrent.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ metadata:
44
name: torrent-torrent
55
namespace: torrent
66
annotations:
7-
io.cilium/lb-ipam-ips: 192.168.1.225
7+
io.cilium/lb-ipam-ips: 192.168.1.225,172.20.10.250
8+
labels:
9+
ip-pool: default
10+
advertise: bgp
811
spec:
912
type: LoadBalancer
1013
selector:

k8s/infra/auth/lldap/svc.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ metadata:
44
name: lldap
55
namespace: lldap
66
annotations:
7-
io.cilium/lb-ipam-ips: 192.168.1.242
7+
io.cilium/lb-ipam-ips: 192.168.1.242,172.20.10.120
8+
labels:
9+
ip-pool: default
10+
advertise: bgp
811
spec:
912
type: LoadBalancer
1013
# https://kubernetes.io/docs/concepts/services-networking/cluster-ip-allocation/
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
apiVersion: cilium.io/v2
2+
kind: CiliumBGPAdvertisement
3+
metadata:
4+
name: loadbalancer-services
5+
labels:
6+
advertise: loadbalancer-services
7+
spec:
8+
advertisements:
9+
- advertisementType: "Service"
10+
service:
11+
addresses:
12+
- LoadBalancerIP
13+
selector:
14+
matchLabels:
15+
advertise: bgp
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
apiVersion: cilium.io/v2
2+
kind: CiliumBGPClusterConfig
3+
metadata:
4+
name: cilium-unifi
5+
spec:
6+
nodeSelector:
7+
matchLabels:
8+
node-role.kubernetes.io/control-plane: ""
9+
bgpInstances:
10+
- name: "65200"
11+
localASN: 65200
12+
peers:
13+
- name: "ucg-max-65100"
14+
peerASN: 65100
15+
peerAddress: 172.20.10.1
16+
peerConfigRef:
17+
name: cilium-peer
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
apiVersion: cilium.io/v2
2+
kind: CiliumBGPPeerConfig
3+
metadata:
4+
name: cilium-peer
5+
spec:
6+
gracefulRestart:
7+
enabled: true
8+
restartTimeSeconds: 15
9+
families:
10+
- afi: ipv4
11+
safi: unicast
12+
advertisements:
13+
matchLabels:
14+
advertise: loadbalancer-services
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
apiVersion: "cilium.io/v2alpha1"
2+
kind: CiliumLoadBalancerIPPool
3+
metadata:
4+
name: default-ip-pool
5+
spec:
6+
blocks:
7+
- cidr: "172.20.10.0/24"
8+
serviceSelector:
9+
matchLabels:
10+
ip-pool: default

k8s/infra/network/cilium/kustomization.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ kind: Kustomization
44
resources:
55
- announce.yaml
66
- ip-pool.yaml
7+
- default-ip-pool.yaml
8+
- bgp-advertisement.yaml
9+
- bgp-peer-config.yaml
10+
- bgp-cluster-config.yaml
711
- dashboards/cilium.yaml
812
- dashboards/cilium-operator.yaml
913

k8s/infra/network/cilium/values.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ cgroup:
2323
bpf:
2424
hostLegacyRouting: true
2525

26+
## ???
27+
# routingMode: "host"
28+
# ipv4NativeRoutingCIDR=10.0.0.0/8
29+
# k8s.requireIPv4PodCIDR=true
30+
2631
# https://docs.cilium.io/en/stable/network/concepts/ipam/
2732
ipam:
2833
mode: kubernetes
@@ -64,6 +69,10 @@ k8sClientRateLimit:
6469
qps: 20
6570
burst: 100
6671

72+
# https://docs.cilium.io/en/latest/network/bgp-control-plane/bgp-control-plane-v2/
73+
bgpControlPlane:
74+
enabled: true
75+
6776
l2announcements:
6877
enabled: true
6978

k8s/infra/network/dns/adguard/svc.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ metadata:
44
name: adguard
55
namespace: dns
66
annotations:
7-
io.cilium/lb-ipam-ips: 192.168.1.253
7+
io.cilium/lb-ipam-ips: 192.168.1.253,172.20.10.153
8+
labels:
9+
ip-pool: default
10+
advertise: bgp
811
spec:
912
type: LoadBalancer
1013
ports:

0 commit comments

Comments
 (0)