Skip to content

Commit bc358b1

Browse files
committed
[BGP+AmphoraLBs] Fix network configuration
Amphora LBs did not work properly with BGP. With this change, network configuration is modified to: - configure NNCP with proper routes from OCP workers to octavia mgmt network (tenant network used by amphora VMs) - configure octavia NAD with proper routes to the octavia mgmt network - add br-octavia and the corresponding ovn bridge mapping to dataplane nodes - ovn-bgp-agent expose-tenant-networks is enabled to advertise via BGP routes to octavia mgmt IPs OSPRH-10768
1 parent a8cb0ac commit bc358b1

File tree

11 files changed

+195
-95
lines changed

11 files changed

+195
-95
lines changed

examples/dt/bgp_dt01/control-plane/kustomization.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,3 +132,16 @@ replacements:
132132
- spec.neutron.template.customServiceConfig
133133
options:
134134
create: true
135+
136+
# configure octavia nodeSelector
137+
- source:
138+
kind: ConfigMap
139+
name: service-values
140+
fieldPath: data.octavia.nodeSelector
141+
targets:
142+
- select:
143+
kind: OpenStackControlPlane
144+
fieldPaths:
145+
- spec.octavia.template.nodeSelector
146+
options:
147+
create: true

examples/dt/bgp_dt01/control-plane/networking/kustomization.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,19 @@ resources:
2626
- ocp_networks_netattach.yaml
2727

2828
patches:
29+
# Add octavia network to NetConfig
30+
- target:
31+
kind: NetConfig
32+
name: netconfig
33+
patch: |-
34+
- op: add
35+
path: /spec/networks/-
36+
value:
37+
dnsDomain: octavia.example.com
38+
name: octavia
39+
subnets:
40+
- _replaced_
41+
mtu: 1500
2942
# Add BGPPeer to BGPAdvertisement
3043
- target:
3144
kind: BGPAdvertisement
@@ -65,6 +78,16 @@ patches:
6578
$patch: delete
6679
6780
replacements:
81+
# octavia NetConfig kustomizations
82+
- source:
83+
kind: ConfigMap
84+
name: network-values
85+
fieldPath: data.octavia.subnets
86+
targets:
87+
- select:
88+
kind: NetConfig
89+
fieldPaths:
90+
- spec.networks.[name=octavia].subnets
6891
# BGP peer IP addresses
6992
# node3
7093
- source:

examples/dt/bgp_dt01/control-plane/networking/nncp/kustomization.yaml

Lines changed: 2 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -107,19 +107,6 @@ patches:
107107
name: _replaced_
108108
mtu: 65536
109109
state: up
110-
- target:
111-
kind: NodeNetworkConfigurationPolicy
112-
patch: |-
113-
- op: add
114-
path: /spec/desiredState/interfaces/-
115-
value:
116-
description: Octavia vlan host interface
117-
name: octavia
118-
state: up
119-
type: vlan
120-
vlan:
121-
base-iface: _replaced_
122-
id: _replaced_
123110
- target:
124111
kind: NodeNetworkConfigurationPolicy
125112
patch: |-
@@ -128,14 +115,9 @@ patches:
128115
value:
129116
description: Octavia bridge
130117
mtu: 1500
131-
name: octbr
118+
name: octavia
132119
type: linux-bridge
133-
bridge:
134-
options:
135-
stp:
136-
enabled: false
137-
port:
138-
- name: octavia
120+
state: up
139121
# Fix roles on masters
140122
- target:
141123
kind: NodeNetworkConfigurationPolicy
@@ -692,26 +674,6 @@ replacements:
692674
name: worker-3
693675
fieldPaths:
694676
- spec.desiredState.interfaces.5.ipv6.address.0.prefix-length
695-
# Octavia
696-
- source:
697-
kind: ConfigMap
698-
name: network-values
699-
fieldPath: data.octavia.base_iface
700-
targets: # octavia interfaces are needed on the workers, except worker-3
701-
- select:
702-
kind: NodeNetworkConfigurationPolicy
703-
fieldPaths:
704-
- spec.desiredState.interfaces.[name=octavia].vlan.base-iface
705-
706-
- source:
707-
kind: ConfigMap
708-
name: network-values
709-
fieldPath: data.octavia.vlan
710-
targets: # octavia interfaces are needed on the workers, except worker-3
711-
- select:
712-
kind: NodeNetworkConfigurationPolicy
713-
fieldPaths:
714-
- spec.desiredState.interfaces.[name=octavia].vlan.id
715677
# Overwrite worker-3 base routes
716678
- source:
717679
kind: ConfigMap

examples/dt/bgp_dt01/control-plane/networking/nncp/values.yaml

Lines changed: 77 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,7 @@ data:
2323
loopback_ip: 99.99.0.3
2424
loopback_ipv6: f00d:f00d:f00d:f00d:f00d:f00d:f00d:13
2525
routes:
26-
config:
27-
- destination: 99.99.0.0/16
28-
next-hop-address: 100.64.0.9
29-
next-hop-interface: enp7s0
30-
- destination: 99.99.0.0/16
31-
next-hop-address: 100.65.0.9
32-
next-hop-interface: enp8s0
26+
config: []
3327
node_1:
3428
name: master-1
3529
internalapi_ip: 172.17.0.6
@@ -45,13 +39,7 @@ data:
4539
loopback_ip: 99.99.1.3
4640
loopback_ipv6: f00d:f00d:f00d:f00d:f00d:f00d:f00d:23
4741
routes:
48-
config:
49-
- destination: 99.99.0.0/16
50-
next-hop-address: 100.64.1.9
51-
next-hop-interface: enp7s0
52-
- destination: 99.99.0.0/16
53-
next-hop-address: 100.65.1.9
54-
next-hop-interface: enp8s0
42+
config: []
5543
node_2:
5644
name: master-2
5745
internalapi_ip: 172.17.0.7
@@ -67,13 +55,7 @@ data:
6755
loopback_ip: 99.99.2.3
6856
loopback_ipv6: f00d:f00d:f00d:f00d:f00d:f00d:f00d:33
6957
routes:
70-
config:
71-
- destination: 99.99.0.0/16
72-
next-hop-address: 100.64.2.9
73-
next-hop-interface: enp7s0
74-
- destination: 99.99.0.0/16
75-
next-hop-address: 100.65.2.9
76-
next-hop-interface: enp8s0
58+
config: []
7759
node_3:
7860
name: worker-0
7961
internalapi_ip: 172.17.0.8
@@ -96,6 +78,13 @@ data:
9678
- destination: 99.99.0.0/16
9779
next-hop-address: 100.65.0.13
9880
next-hop-interface: enp8s0
81+
# routes to octavia mgmt network
82+
- destination: 172.24.0.0/16
83+
next-hop-address: 100.64.0.13
84+
next-hop-interface: enp7s0
85+
- destination: 172.24.0.0/16
86+
next-hop-address: 100.65.0.13
87+
next-hop-interface: enp8s0
9988
node_4:
10089
name: worker-1
10190
internalapi_ip: 172.17.0.9
@@ -118,6 +107,13 @@ data:
118107
- destination: 99.99.0.0/16
119108
next-hop-address: 100.65.1.13
120109
next-hop-interface: enp8s0
110+
# routes to octavia mgmt network
111+
- destination: 172.24.0.0/16
112+
next-hop-address: 100.64.1.13
113+
next-hop-interface: enp7s0
114+
- destination: 172.24.0.0/16
115+
next-hop-address: 100.65.1.13
116+
next-hop-interface: enp8s0
121117
node_5:
122118
name: worker-2
123119
internalapi_ip: 172.17.0.10
@@ -140,6 +136,13 @@ data:
140136
- destination: 99.99.0.0/16
141137
next-hop-address: 100.65.2.13
142138
next-hop-interface: enp8s0
139+
# routes to octavia mgmt network
140+
- destination: 172.24.0.0/16
141+
next-hop-address: 100.64.2.13
142+
next-hop-interface: enp7s0
143+
- destination: 172.24.0.0/16
144+
next-hop-address: 100.65.2.13
145+
next-hop-interface: enp8s0
143146
node_6:
144147
name: worker-3
145148
internalapi_ip: 172.17.0.11
@@ -158,6 +161,10 @@ data:
158161
- destination: 192.168.133.0/24
159162
next-hop-address: 100.64.10.1
160163
next-hop-interface: enp7s0
164+
# routes to octavia mgmt network
165+
- destination: 172.24.0.0/16
166+
next-hop-address: 100.64.10.1
167+
next-hop-interface: enp7s0
161168

162169
# networks
163170
ctlplane:
@@ -336,6 +343,13 @@ data:
336343
}
337344
octavia:
338345
dnsDomain: octavia.openstack.lab
346+
subnets:
347+
- allocationRanges:
348+
- end: 172.23.0.250
349+
start: 172.23.0.100
350+
cidr: 172.23.0.0/24
351+
name: subnet1
352+
vlan: 23
339353
mtu: 1500
340354
vlan: 23
341355
base_iface: enp6s0
@@ -344,18 +358,22 @@ data:
344358
"cniVersion": "0.3.1",
345359
"name": "octavia",
346360
"type": "bridge",
347-
"bridge": "octbr",
361+
"isDefaultGateway": true,
362+
"isGateway": true,
363+
"forceAddress": false,
364+
"ipMasq": false,
365+
"hairpinMode": true,
366+
"bridge": "octavia",
348367
"ipam": {
349368
"type": "whereabouts",
350369
"range": "172.23.0.0/24",
370+
"routes": [{
371+
"dst": "172.24.0.0/16",
372+
"gw": "172.23.0.1"
373+
}],
351374
"range_start": "172.23.0.30",
352375
"range_end": "172.23.0.70",
353-
"routes": [
354-
{
355-
"dst": "172.24.0.0/16",
356-
"gw": "172.23.0.150"
357-
}
358-
]
376+
"gateway": "172.23.0.1"
359377
}
360378
}
361379
@@ -486,13 +504,7 @@ data:
486504
bgp_peer: 100.65.0.9
487505
bgp_ip: 100.65.0.10
488506
routes:
489-
config:
490-
- destination: 99.99.0.0/16
491-
next-hop-address: 100.64.0.9
492-
next-hop-interface: enp7s0
493-
- destination: 99.99.0.0/16
494-
next-hop-address: 100.65.0.9
495-
next-hop-interface: enp8s0
507+
config: []
496508
node1:
497509
bgpnet0:
498510
bgp_peer: 100.64.1.9
@@ -501,13 +513,7 @@ data:
501513
bgp_peer: 100.65.1.9
502514
bgp_ip: 100.65.1.10
503515
routes:
504-
config:
505-
- destination: 99.99.0.0/16
506-
next-hop-address: 100.64.1.9
507-
next-hop-interface: enp7s0
508-
- destination: 99.99.0.0/16
509-
next-hop-address: 100.65.1.9
510-
next-hop-interface: enp8s0
516+
config: []
511517
node2:
512518
bgpnet0:
513519
bgp_peer: 100.64.2.9
@@ -516,13 +522,7 @@ data:
516522
bgp_peer: 100.65.2.9
517523
bgp_ip: 100.65.2.10
518524
routes:
519-
config:
520-
- destination: 99.99.0.0/16
521-
next-hop-address: 100.64.2.9
522-
next-hop-interface: enp7s0
523-
- destination: 99.99.0.0/16
524-
next-hop-address: 100.65.2.9
525-
next-hop-interface: enp8s0
525+
config: []
526526
node3:
527527
bgpnet0:
528528
bgp_peer: 100.64.0.13
@@ -538,6 +538,13 @@ data:
538538
- destination: 99.99.0.0/16
539539
next-hop-address: 100.65.0.13
540540
next-hop-interface: enp8s0
541+
# routes to octavia mgmt network
542+
- destination: 172.24.0.0/16
543+
next-hop-address: 100.64.0.13
544+
next-hop-interface: enp7s0
545+
- destination: 172.24.0.0/16
546+
next-hop-address: 100.65.0.13
547+
next-hop-interface: enp8s0
541548
node4:
542549
bgpnet0:
543550
bgp_peer: 100.64.1.13
@@ -553,6 +560,13 @@ data:
553560
- destination: 99.99.0.0/16
554561
next-hop-address: 100.65.1.13
555562
next-hop-interface: enp8s0
563+
# routes to octavia mgmt network
564+
- destination: 172.24.0.0/16
565+
next-hop-address: 100.64.1.13
566+
next-hop-interface: enp7s0
567+
- destination: 172.24.0.0/16
568+
next-hop-address: 100.65.1.13
569+
next-hop-interface: enp8s0
556570
node5:
557571
bgpnet0:
558572
bgp_peer: 100.64.2.13
@@ -568,6 +582,13 @@ data:
568582
- destination: 99.99.0.0/16
569583
next-hop-address: 100.65.2.13
570584
next-hop-interface: enp8s0
585+
# routes to octavia mgmt network
586+
- destination: 172.24.0.0/16
587+
next-hop-address: 100.64.2.13
588+
next-hop-interface: enp7s0
589+
- destination: 172.24.0.0/16
590+
next-hop-address: 100.65.2.13
591+
next-hop-interface: enp8s0
571592
node6:
572593
bgpnet0:
573594
bgp_peer: 100.64.10.1
@@ -577,6 +598,10 @@ data:
577598
- destination: 192.168.133.0/24
578599
next-hop-address: 100.64.10.1
579600
next-hop-interface: enp7s0
601+
# routes to octavia mgmt network
602+
- destination: 172.24.0.0/16
603+
next-hop-address: 100.64.10.1
604+
next-hop-interface: enp7s0
580605
net-attach-def:
581606
node6: |
582607
{
@@ -592,6 +617,9 @@ data:
592617
"routes": [{
593618
"dst": "192.168.133.0/24",
594619
"gw": "100.64.10.1"
620+
}, {
621+
"dst": "172.24.0.0/16",
622+
"gw": "100.64.10.1"
595623
}]
596624
}
597625
}

examples/dt/bgp_dt01/control-plane/service-values.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ data:
5454
customServiceConfig: |
5555
[controller_worker]
5656
loadbalancer_topology=ACTIVE_STANDBY
57+
nodeSelector:
58+
node-role.kubernetes.io/worker: ""
5759

5860
neutron:
5961
customServiceConfig: |

0 commit comments

Comments
 (0)