Skip to content

Commit a285c84

Browse files
Merge pull request #572 from eduolivares/bgp-cp-network-split
Decouple BGP network stage from control plane stage This removes the networking components metallb, NetConfig and NAD from the controlplane stage of BGP. Our expectation is that this helps to avoid OSPRH-16282 Besides, this would align BGP jobs with Uni jobs and aparently this decoupling will be needed to test adoption. This change was created using the following PR as inspiration: #489 Reviewed-by: John Fulton <[email protected]>
2 parents 226b9ff + 17958ad commit a285c84

28 files changed

+662
-552
lines changed

automation/vars/bgp-l3-xl.yaml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ vas:
6464
namespace: openshift-cluster-node-tuning-operator
6565
state: present
6666
name: nncp-configuration
67-
path: examples/dt/bgp-l3-xl/control-plane/nncp
67+
path: examples/dt/bgp-l3-xl/control-plane/networking/nncp
6868
wait_conditions:
6969
- >-
7070
oc -n openstack wait nncp
@@ -76,6 +76,18 @@ vas:
7676
src_file: values.yaml
7777
build_output: nncp.yaml
7878

79+
- name: networking
80+
path: examples/dt/bgp-l3-xl/control-plane/networking
81+
wait_conditions:
82+
- >-
83+
oc -n metallb-system wait pod
84+
-l app=metallb -l component=speaker
85+
--for condition=Ready
86+
values:
87+
- name: network-values
88+
src_file: nncp/values.yaml
89+
build_output: networking.yaml
90+
7991
- name: control-plane
8092
path: examples/dt/bgp-l3-xl/control-plane
8193
wait_conditions:
@@ -86,7 +98,7 @@ vas:
8698
--timeout=30m
8799
values:
88100
- name: network-values
89-
src_file: nncp/values.yaml
101+
src_file: networking/nncp/values.yaml
90102
- name: service-values
91103
src_file: service-values.yaml
92104
build_output: control-plane.yaml

automation/vars/bgp_dt01.yaml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ vas:
5252
namespace: openshift-cluster-node-tuning-operator
5353
state: present
5454
name: nncp-configuration
55-
path: examples/dt/bgp_dt01/control-plane/nncp
55+
path: examples/dt/bgp_dt01/control-plane/networking/nncp
5656
wait_conditions:
5757
- >-
5858
oc -n openstack wait nncp
@@ -64,6 +64,18 @@ vas:
6464
src_file: values.yaml
6565
build_output: nncp.yaml
6666

67+
- name: networking
68+
path: examples/dt/bgp_dt01/control-plane/networking
69+
wait_conditions:
70+
- >-
71+
oc -n metallb-system wait pod
72+
-l app=metallb -l component=speaker
73+
--for condition=Ready
74+
values:
75+
- name: network-values
76+
src_file: nncp/values.yaml
77+
build_output: networking.yaml
78+
6779
- name: control-plane
6880
path: examples/dt/bgp_dt01/control-plane
6981
wait_conditions:
@@ -74,7 +86,7 @@ vas:
7486
--timeout=30m
7587
values:
7688
- name: network-values
77-
src_file: nncp/values.yaml
89+
src_file: networking/nncp/values.yaml
7890
- name: service-values
7991
src_file: service-values.yaml
8092
build_output: control-plane.yaml

dt/bgp/kustomization.yaml

Lines changed: 0 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -25,63 +25,9 @@ transformers:
2525
create: true
2626
2727
components:
28-
- ../../lib/networking
29-
- networking/bgpmetallb
3028
- ../../lib/control-plane
3129

32-
resources:
33-
- ocp_networks_octavia_netattach.yaml
34-
3530
patches:
36-
# Add BGP networks to NetConfig
37-
- target:
38-
kind: NetConfig
39-
name: netconfig
40-
patch: |-
41-
- op: add
42-
path: /spec/networks/-
43-
value:
44-
dnsDomain: bgpnet0.example.com
45-
name: bgpnet0
46-
subnets:
47-
- _replaced_
48-
mtu: 1500
49-
- target:
50-
kind: NetConfig
51-
name: netconfig
52-
patch: |-
53-
- op: add
54-
path: /spec/networks/-
55-
value:
56-
dnsDomain: bgpnet1.example.com
57-
name: bgpnet1
58-
subnets:
59-
- _replaced_
60-
mtu: 1500
61-
- target:
62-
kind: NetConfig
63-
name: netconfig
64-
patch: |-
65-
- op: add
66-
path: /spec/networks/-
67-
value:
68-
dnsDomain: bgpmainnet.example.com
69-
name: bgpmainnet
70-
subnets:
71-
- _replaced_
72-
mtu: 1500
73-
- target:
74-
kind: NetConfig
75-
name: netconfig
76-
patch: |-
77-
- op: add
78-
path: /spec/networks/-
79-
value:
80-
dnsDomain: bgpmainnetv6.example.com
81-
name: bgpmainnetv6
82-
subnets:
83-
- _replaced_
84-
mtu: 1500
8531
# Enable heat
8632
- target:
8733
kind: OpenStackControlPlane
@@ -101,44 +47,6 @@ patches:
10147
networkAttachment: internalapi
10248
10349
replacements:
104-
# BGP NetConfig customizations
105-
- source:
106-
kind: ConfigMap
107-
name: network-values
108-
fieldPath: data.bgp.subnets.bgpnet0
109-
targets:
110-
- select:
111-
kind: NetConfig
112-
fieldPaths:
113-
- spec.networks.[name=bgpnet0].subnets
114-
- source:
115-
kind: ConfigMap
116-
name: network-values
117-
fieldPath: data.bgp.subnets.bgpnet1
118-
targets:
119-
- select:
120-
kind: NetConfig
121-
fieldPaths:
122-
- spec.networks.[name=bgpnet1].subnets
123-
- source:
124-
kind: ConfigMap
125-
name: network-values
126-
fieldPath: data.bgp.subnets.bgpmainnet
127-
targets:
128-
- select:
129-
kind: NetConfig
130-
fieldPaths:
131-
- spec.networks.[name=bgpmainnet].subnets
132-
- source:
133-
kind: ConfigMap
134-
name: network-values
135-
fieldPath: data.bgp.subnets.bgpmainnetv6
136-
targets:
137-
- select:
138-
kind: NetConfig
139-
fieldPaths:
140-
- spec.networks.[name=bgpmainnetv6].subnets
141-
14250
# Control plane customization to use glance with swift
14351
- source:
14452
kind: ConfigMap
@@ -304,14 +212,3 @@ replacements:
304212
- spec.octavia.template.octaviaWorker.customServiceConfig
305213
options:
306214
create: true
307-
308-
- source:
309-
kind: ConfigMap
310-
name: network-values
311-
fieldPath: data.octavia.net-attach-def
312-
targets:
313-
- select:
314-
kind: NetworkAttachmentDefinition
315-
name: octavia
316-
fieldPaths:
317-
- spec.config

dt/bgp/namespace.yaml

Lines changed: 0 additions & 12 deletions
This file was deleted.
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
---
2+
apiVersion: kustomize.config.k8s.io/v1alpha1
3+
kind: Component
4+
5+
transformers:
6+
# Set namespace to OpenStack on all namespaced objects without a namespace
7+
- |-
8+
apiVersion: builtin
9+
kind: NamespaceTransformer
10+
metadata:
11+
name: _ignored_
12+
namespace: openstack
13+
setRoleBindingSubjects: none
14+
unsetOnly: true
15+
fieldSpecs:
16+
- path: metadata/name
17+
kind: Namespace
18+
create: true
19+
20+
components:
21+
- ../../../lib/networking
22+
- bgpmetallb
23+
24+
resources:
25+
- ocp_networks_octavia_netattach.yaml
26+
27+
patches:
28+
# Add BGP networks to NetConfig
29+
- target:
30+
kind: NetConfig
31+
name: netconfig
32+
patch: |-
33+
- op: add
34+
path: /spec/networks/-
35+
value:
36+
dnsDomain: bgpnet0.example.com
37+
name: bgpnet0
38+
subnets:
39+
- _replaced_
40+
mtu: 1500
41+
- target:
42+
kind: NetConfig
43+
name: netconfig
44+
patch: |-
45+
- op: add
46+
path: /spec/networks/-
47+
value:
48+
dnsDomain: bgpnet1.example.com
49+
name: bgpnet1
50+
subnets:
51+
- _replaced_
52+
mtu: 1500
53+
- target:
54+
kind: NetConfig
55+
name: netconfig
56+
patch: |-
57+
- op: add
58+
path: /spec/networks/-
59+
value:
60+
dnsDomain: bgpmainnet.example.com
61+
name: bgpmainnet
62+
subnets:
63+
- _replaced_
64+
mtu: 1500
65+
- target:
66+
kind: NetConfig
67+
name: netconfig
68+
patch: |-
69+
- op: add
70+
path: /spec/networks/-
71+
value:
72+
dnsDomain: bgpmainnetv6.example.com
73+
name: bgpmainnetv6
74+
subnets:
75+
- _replaced_
76+
mtu: 1500
77+
78+
replacements:
79+
# BGP NetConfig customizations
80+
- source:
81+
kind: ConfigMap
82+
name: network-values
83+
fieldPath: data.bgp.subnets.bgpnet0
84+
targets:
85+
- select:
86+
kind: NetConfig
87+
fieldPaths:
88+
- spec.networks.[name=bgpnet0].subnets
89+
- source:
90+
kind: ConfigMap
91+
name: network-values
92+
fieldPath: data.bgp.subnets.bgpnet1
93+
targets:
94+
- select:
95+
kind: NetConfig
96+
fieldPaths:
97+
- spec.networks.[name=bgpnet1].subnets
98+
- source:
99+
kind: ConfigMap
100+
name: network-values
101+
fieldPath: data.bgp.subnets.bgpmainnet
102+
targets:
103+
- select:
104+
kind: NetConfig
105+
fieldPaths:
106+
- spec.networks.[name=bgpmainnet].subnets
107+
- source:
108+
kind: ConfigMap
109+
name: network-values
110+
fieldPath: data.bgp.subnets.bgpmainnetv6
111+
targets:
112+
- select:
113+
kind: NetConfig
114+
fieldPaths:
115+
- spec.networks.[name=bgpmainnetv6].subnets
116+
- source:
117+
kind: ConfigMap
118+
name: network-values
119+
fieldPath: data.octavia.net-attach-def
120+
targets:
121+
- select:
122+
kind: NetworkAttachmentDefinition
123+
name: octavia
124+
fieldPaths:
125+
- spec.config

examples/dt/bgp-l3-xl/control-plane.md

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,19 @@ Change to the bgp-l3-xl/control-plane directory
1616
```
1717
cd architecture/examples/dt/bgp-l3-xl/control-plane
1818
```
19-
Edit the [nncp/values.yaml](control-plane/nncp/values.yaml) and
19+
Edit the [networking/nncp/values.yaml](control-plane/networking/nncp/values.yaml) and
2020
[service-values.yaml](control-plane/service-values.yaml) files to suit
2121
your environment.
2222
```
23-
vi nncp/values.yaml
23+
vi networking/nncp/values.yaml
2424
vi service-values.yaml
2525
```
2626

2727
## Apply node network configuration
2828

2929
Generate the node network configuration
3030
```
31-
kustomize build nncp > nncp.yaml
31+
kustomize build networking/nncp > nncp.yaml
3232
```
3333
Apply the NNCP CRs
3434
```
@@ -39,9 +39,20 @@ Wait for NNCPs to be available
3939
oc wait nncp -l osp/nncm-config-type=standard --for jsonpath='{.status.conditions[0].reason}'=SuccessfullyConfigured --timeout=300s
4040
```
4141

42-
## Apply networking and control-plane configuration
42+
## Apply the remaining networking configuration
4343

44-
Generate the control-plane and networking CRs.
44+
Generate the networking CRs.
45+
```
46+
kustomize build networking > networking.yaml
47+
```
48+
Apply the CRs
49+
```
50+
oc apply -f networking.yaml
51+
```
52+
53+
## Apply control-plane configuration
54+
55+
Generate the control-plane CRs.
4556
```
4657
kustomize build > control-plane.yaml
4758
```

0 commit comments

Comments
 (0)