Skip to content

Commit 9a035c7

Browse files
Merge pull request #677 from fultonj/dcn_split_net_control
Decouple DCN network stage from control plane stage Apply the pattern from commit 3105c9e to separate networking from control-plane deployment, allowing network CRs to be created before the control plane for DCN. Create dt/dcn/networking component with base networks Move nncp under control-plane/networking/ Add networking stage to automation/vars/dcn.yaml Update control-plane kustomization paths Move octavia NAD and storagemgmt NetConfig patches to networking Reviewed-by: Andrew Bays <andrew.bays@gmail.com>
2 parents 24844ea + a6bdd5b commit 9a035c7

File tree

14 files changed

+151
-80
lines changed

14 files changed

+151
-80
lines changed

automation/vars/dcn.yaml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ vas:
33
dcn:
44
stages:
55
- name: nncp-configuration
6-
path: examples/dt/dcn/control-plane/nncp
6+
path: examples/dt/dcn/control-plane/networking/nncp
77
wait_conditions:
88
- >-
99
oc -n openstack wait nncp
@@ -15,6 +15,19 @@ vas:
1515
src_file: values.yaml
1616
build_output: nncp.yaml
1717

18+
- name: networking
19+
path: examples/dt/dcn/control-plane/networking
20+
wait_conditions:
21+
- >-
22+
oc -n metallb-system wait pod
23+
-l app=metallb -l component=speaker
24+
--for condition=Ready
25+
--timeout=5m
26+
values:
27+
- name: network-values
28+
src_file: nncp/values.yaml
29+
build_output: network.yaml
30+
1831
- name: control-plane
1932
path: examples/dt/dcn/control-plane
2033
wait_conditions:
@@ -23,7 +36,7 @@ vas:
2336
--timeout=30m
2437
values:
2538
- name: network-values
26-
src_file: nncp/values.yaml
39+
src_file: networking/nncp/values.yaml
2740
build_output: ../control-plane.yaml
2841
post_stage_run:
2942
- name: Deploy DCN

dt/dcn/kustomization.yaml

Lines changed: 0 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -25,71 +25,4 @@ transformers:
2525
create: true
2626
2727
components:
28-
- ../../lib/networking/metallb
29-
- ../../lib/networking/netconfig
30-
- ../../lib/networking/nad
3128
- ../../lib/control-plane
32-
33-
resources:
34-
- nad.yaml
35-
36-
# Add storagemgmt network template, as it is needed for CephHCI
37-
patches:
38-
- target:
39-
version: v1beta1
40-
kind: NetConfig
41-
name: netconfig
42-
patch: |-
43-
- op: add
44-
path: /spec/networks/-
45-
value:
46-
dnsDomain: _replaced_
47-
name: storagemgmt
48-
subnets:
49-
- _replaced_
50-
mtu: 1500
51-
52-
# Add storagemgmt network replacements
53-
replacements:
54-
# NetConfig dnsDomain specific to this VA
55-
- source:
56-
kind: ConfigMap
57-
name: network-values
58-
fieldPath: data.storagemgmt.dnsDomain
59-
targets:
60-
- select:
61-
kind: NetConfig
62-
fieldPaths:
63-
- spec.networks.[name=storagemgmt].dnsDomain
64-
# NetConfig MTU specific to this VA
65-
- source:
66-
kind: ConfigMap
67-
name: network-values
68-
fieldPath: data.storagemgmt.mtu
69-
targets:
70-
- select:
71-
kind: NetConfig
72-
fieldPaths:
73-
- spec.networks.[name=storagemgmt].mtu
74-
# NetConfig subnets specific to this VA
75-
- source:
76-
kind: ConfigMap
77-
name: network-values
78-
fieldPath: data.storagemgmt.subnets
79-
targets:
80-
- select:
81-
kind: NetConfig
82-
fieldPaths:
83-
- spec.networks.[name=storagemgmt].subnets
84-
85-
# Octavia support
86-
- source:
87-
kind: ConfigMap
88-
name: network-values
89-
fieldPath: data.octavia.net-attach-def
90-
targets:
91-
- select:
92-
kind: NetworkAttachmentDefinition
93-
name: octavia
94-
fieldPaths:
95-
- spec.config
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
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/metallb
22+
- ../../../lib/networking/netconfig
23+
- ../../../lib/networking/nad
24+
25+
resources:
26+
- nad.yaml
27+
28+
# Add storagemgmt network template, as it is needed for CephHCI
29+
patches:
30+
- target:
31+
version: v1beta1
32+
kind: NetConfig
33+
name: netconfig
34+
patch: |-
35+
- op: add
36+
path: /spec/networks/-
37+
value:
38+
dnsDomain: _replaced_
39+
name: storagemgmt
40+
subnets:
41+
- _replaced_
42+
mtu: 1500
43+
44+
# Add storagemgmt network replacements
45+
replacements:
46+
# NetConfig dnsDomain specific to this VA
47+
- source:
48+
kind: ConfigMap
49+
name: network-values
50+
fieldPath: data.storagemgmt.dnsDomain
51+
targets:
52+
- select:
53+
kind: NetConfig
54+
fieldPaths:
55+
- spec.networks.[name=storagemgmt].dnsDomain
56+
# NetConfig MTU specific to this VA
57+
- source:
58+
kind: ConfigMap
59+
name: network-values
60+
fieldPath: data.storagemgmt.mtu
61+
targets:
62+
- select:
63+
kind: NetConfig
64+
fieldPaths:
65+
- spec.networks.[name=storagemgmt].mtu
66+
# NetConfig subnets specific to this VA
67+
- source:
68+
kind: ConfigMap
69+
name: network-values
70+
fieldPath: data.storagemgmt.subnets
71+
targets:
72+
- select:
73+
kind: NetConfig
74+
fieldPaths:
75+
- spec.networks.[name=storagemgmt].subnets
76+
77+
# Octavia support
78+
- source:
79+
kind: ConfigMap
80+
name: network-values
81+
fieldPath: data.octavia.net-attach-def
82+
targets:
83+
- select:
84+
kind: NetworkAttachmentDefinition
85+
name: octavia
86+
fieldPaths:
87+
- spec.config

dt/dcn/networking/nad.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
apiVersion: k8s.cni.cncf.io/v1
3+
kind: NetworkAttachmentDefinition
4+
metadata:
5+
name: octavia
6+
labels:
7+
osp/net: octavia
8+
osp/net-attach-def-type: standard

examples/dt/dcn/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ This is a collection of CR templates that represent a Red Hat OpenStack Services
2828

2929
2. The CRs are applied against an OpenShift cluster in _stages_. That is, there is an ordering in which each grouping of CRs is fed to the cluster. It is _not_ a case of simply taking all CRs from all stages and applying them all at once.
3030

31-
3. In stages 1 and 2 [kustomize](https://kustomize.io/) is used to genereate the control plane CRs dynamically. The `control-plane/nncp/values.yaml` file(s) must be updated to fit your environment. kustomize version 5 or newer required.
31+
3. In stages 1 and 2 [kustomize](https://kustomize.io/) is used to generate the control plane CRs dynamically. The `control-plane/networking/nncp/values.yaml` file(s) must be updated to fit your environment. kustomize version 5 or newer required.
3232

3333
4. In stages 3 and 4 [kustomize](https://kustomize.io/) is used to generate the dataplane CRs dynamically. The `edpm-pre-ceph/values.yaml`, `values.yaml` and `service-values.yaml` files must be updated to fit your environment. kustomize version 5 or newer required.
3434

examples/dt/dcn/control-plane.md

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,18 @@ Change to the dcn directory
1818
cd architecture/examples/dt/dcn
1919
```
2020

21-
Edit the [control-plane/nncp/values.yaml](control-plane/nncp/values.yaml) file to suit your environment.
21+
Edit the [control-plane/networking/nncp/values.yaml](control-plane/networking/nncp/values.yaml) file to suit your environment.
2222

2323
```shell
24-
vi control-plane/nncp/values.yaml
24+
vi control-plane/networking/nncp/values.yaml
2525
```
2626

2727
## Apply node network configuration
2828

2929
Generate the node network configuration
3030

3131
```shell
32-
kustomize build control-plane/nncp > nncp.yaml
32+
kustomize build control-plane/networking/nncp > nncp.yaml
3333
```
3434

3535
Apply the NNCP CRs
@@ -44,9 +44,29 @@ Wait for NNCPs to be available
4444
oc wait nncp -l osp/nncm-config-type=standard --for jsonpath='{.status.conditions[0].reason}'=SuccessfullyConfigured --timeout=300s
4545
```
4646

47-
## Apply networking and control-plane configuration
47+
## Apply networking configuration
4848

49-
Generate the control-plane and networking CRs.
49+
Generate the networking CRs.
50+
51+
```shell
52+
kustomize build control-plane/networking > networking.yaml
53+
```
54+
55+
Apply the networking CRs
56+
57+
```shell
58+
oc apply -f networking.yaml
59+
```
60+
61+
Wait for MetalLB to be available
62+
63+
```shell
64+
oc -n metallb-system wait pod -l app=metallb -l component=speaker --for condition=Ready --timeout=5m
65+
```
66+
67+
## Apply control-plane configuration
68+
69+
Generate the control-plane CRs.
5070

5171
```shell
5272
kustomize build control-plane > control-plane.yaml

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ components:
66
- ../../../../dt/dcn/
77

88
resources:
9-
- nncp/values.yaml
9+
- networking/nncp/values.yaml
1010
- service-values.yaml
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
apiVersion: kustomize.config.k8s.io/v1beta1
3+
kind: Kustomization
4+
5+
components:
6+
- ../../../../../dt/dcn/networking
7+
8+
resources:
9+
- nncp/values.yaml
File renamed without changes.

examples/dt/dcn/control-plane/nncp/kustomization.yaml renamed to examples/dt/dcn/control-plane/networking/nncp/kustomization.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ transformers:
1818
create: true
1919
2020
components:
21-
- ../../../../../dt/dcn/nncp
21+
- ../../../../../../dt/dcn/nncp
2222

2323

2424
resources:

0 commit comments

Comments
 (0)