Skip to content

Commit 9c3b7e5

Browse files
committed
Decouple uni01alpha network stage from control plane stage
This removes the networking components... MetalLB NetConfig Net-attach-def ...from the control plane stage of dt/uni01alpha and gives them their own separate stage in between the NNCP stage and the control plane stage. This is needed for the uni01alpha adoption job, which relies upon this DT. For adoption we want to create the NNCPs, MetalLB CRs, NetConfig CR and Net-attach-defs, but do NOT want to create the OpenStackControlPlane. Following this can this can be done by creating an automation file with only two stages, one for NNCPs and the other for the other networking components. This change was created using the following PR as inspiration: #489 Jira: OSPRH-13801
1 parent b773b51 commit 9c3b7e5

File tree

16 files changed

+160
-110
lines changed

16 files changed

+160
-110
lines changed

automation/vars/uni01alpha-adoption.yaml

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,17 @@
22
vas:
33
uni01alpha-adoption:
44
stages:
5-
- path: examples/dt/uni01alpha/control-plane/nncp
5+
- pre_stage_run:
6+
- name: Apply cinder-lvm label on master-0
7+
type: cr
8+
definition:
9+
metadata:
10+
labels:
11+
openstack.org/cinder-lvm: ""
12+
kind: Node
13+
resource_name: master-0
14+
state: patched
15+
path: examples/dt/uni01alpha/control-plane/networking/nncp
616
wait_conditions:
717
- >-
818
oc -n openstack wait nncp
@@ -14,26 +24,13 @@ vas:
1424
src_file: values.yaml
1525
build_output: nncp.yaml
1626

17-
- pre_stage_run:
18-
- name: Apply cinder-lvm label on master-0
19-
type: cr
20-
definition:
21-
metadata:
22-
labels:
23-
openstack.org/cinder-lvm: ""
24-
kind: Node
25-
resource_name: master-0
26-
state: patched
27-
path: examples/dt/uni01alpha/control-plane
27+
- path: examples/dt/uni01alpha/control-plane/networking
2828
wait_conditions:
2929
- >-
30-
oc -n openstack wait openstackcontrolplane
31-
controlplane
30+
oc -n metallb-system wait pod
31+
-l app=metallb -l component=speaker
3232
--for condition=Ready
33-
--timeout=60m
3433
values:
3534
- name: network-values
3635
src_file: nncp/values.yaml
37-
- name: service-values
38-
src_file: service-values.yaml
39-
build_output: control-plane.yaml
36+
build_output: networking.yaml

automation/vars/uni01alpha.yaml

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,17 @@
22
vas:
33
uni01alpha:
44
stages:
5-
- path: examples/dt/uni01alpha/control-plane/nncp
5+
- pre_stage_run:
6+
- name: Apply cinder-lvm label on master-0
7+
type: cr
8+
definition:
9+
metadata:
10+
labels:
11+
openstack.org/cinder-lvm: ""
12+
kind: Node
13+
resource_name: master-0
14+
state: patched
15+
path: examples/dt/uni01alpha/control-plane/networking/nncp
616
wait_conditions:
717
- >-
818
oc -n openstack wait nncp
@@ -14,17 +24,18 @@ vas:
1424
src_file: values.yaml
1525
build_output: nncp.yaml
1626

17-
- pre_stage_run:
18-
- name: Apply cinder-lvm label on master-0
19-
type: cr
20-
definition:
21-
metadata:
22-
labels:
23-
openstack.org/cinder-lvm: ""
24-
kind: Node
25-
resource_name: master-0
26-
state: patched
27-
path: examples/dt/uni01alpha/control-plane
27+
- path: examples/dt/uni01alpha/control-plane/networking
28+
wait_conditions:
29+
- >-
30+
oc -n metallb-system wait pod
31+
-l app=metallb -l component=speaker
32+
--for condition=Ready
33+
values:
34+
- name: network-values
35+
src_file: nncp/values.yaml
36+
build_output: networking.yaml
37+
38+
- path: examples/dt/uni01alpha/control-plane
2839
wait_conditions:
2940
- >-
3041
oc -n openstack wait openstackcontrolplane
@@ -33,7 +44,7 @@ vas:
3344
--timeout=60m
3445
values:
3546
- name: network-values
36-
src_file: nncp/values.yaml
47+
src_file: networking/nncp/values.yaml
3748
- name: service-values
3849
src_file: service-values.yaml
3950
build_output: control-plane.yaml

dt/uni01alpha/kustomization.yaml

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,8 @@ transformers:
2424
create: true
2525
2626
components:
27-
- ../../lib/networking/metallb
28-
- netconfig
29-
- ../../lib/networking/nad
3027
- ../../lib/control-plane
3128

32-
resources:
33-
- nad.yaml
3429

3530
replacements:
3631
- source:
@@ -457,25 +452,3 @@ replacements:
457452
- spec.nova.template.cellTemplates
458453
options:
459454
create: true
460-
461-
- source:
462-
kind: ConfigMap
463-
name: network-values
464-
fieldPath: data.octavia.net-attach-def
465-
targets:
466-
- select:
467-
kind: NetworkAttachmentDefinition
468-
name: octavia
469-
fieldPaths:
470-
- spec.config
471-
472-
- source:
473-
kind: ConfigMap
474-
name: network-values
475-
fieldPath: data.ironic.net-attach-def
476-
targets:
477-
- select:
478-
kind: NetworkAttachmentDefinition
479-
name: ironic
480-
fieldPaths:
481-
- spec.config
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
apiVersion: kustomize.config.k8s.io/v1alpha1
3+
kind: Component
4+
5+
transformers:
6+
- |-
7+
apiVersion: builtin
8+
kind: NamespaceTransformer
9+
metadata:
10+
name: _ignored_
11+
namespace: openstack
12+
setRoleBindingSubjects: none
13+
unsetOnly: true
14+
fieldSpecs:
15+
- path: metadata/name
16+
kind: Namespace
17+
create: true
18+
19+
components:
20+
- ../../../lib/networking/metallb
21+
- netconfig
22+
- ../../../lib/networking/nad
23+
24+
resources:
25+
- nad.yaml
26+
27+
replacements:
28+
- source:
29+
kind: ConfigMap
30+
name: network-values
31+
fieldPath: data.octavia.net-attach-def
32+
targets:
33+
- select:
34+
kind: NetworkAttachmentDefinition
35+
name: octavia
36+
fieldPaths:
37+
- spec.config
38+
39+
- source:
40+
kind: ConfigMap
41+
name: network-values
42+
fieldPath: data.ironic.net-attach-def
43+
targets:
44+
- select:
45+
kind: NetworkAttachmentDefinition
46+
name: ironic
47+
fieldPaths:
48+
- spec.config
File renamed without changes.

dt/uni01alpha/nncp/kustomization.yaml renamed to dt/uni01alpha/networking/nncp/kustomization.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ transformers:
1717
create: true
1818
1919
components:
20-
- ../../../lib/nncp
20+
- ../../../../lib/nncp
2121

2222
patches:
2323
- target:

examples/dt/uni01alpha/control-plane.md

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,33 +52,46 @@ cd architecture/examples/dt/uni01alpha
5252
```
5353

5454
Edit [service-values.yaml](control-plane/service-values.yaml) and
55-
[control-plane/nncp/values.yaml](control-plane/nncp/values.yaml).
55+
[control-plane/networking/nncp/values.yaml](control-plane/networking/nncp/values.yaml).
5656

57-
Apply node network configuration
57+
## Apply node network configuration
5858

59+
Generate the node network configuration
5960
```bash
60-
pushd control-plane/nncp
61-
kustomize build > nncp.yaml
61+
kustomize build control-plane/networking/nncp > nncp.yaml
62+
```
63+
Apply the NNCP CRs
64+
```
6265
oc apply -f nncp.yaml
66+
```
67+
Wait for NNCPs to be available
68+
```
6369
oc wait nncp \
6470
-l osp/nncm-config-type=standard \
6571
--for jsonpath='{.status.conditions[0].reason}'=SuccessfullyConfigured \
6672
--timeout=300s
67-
popd
6873
```
6974

70-
Generate the control-plane and networking CRs.
75+
## Apply remaining networking configuration
7176

72-
```bash
73-
pushd control-plane
74-
kustomize build > control-plane.yaml
77+
Generate the reminaing networking configuration
78+
```
79+
kustomize build control-plane/networking > networking.yaml
80+
```
81+
Apply the networking CRs
82+
```
83+
oc apply -f networking.yaml
7584
```
7685

77-
## Create CRs
86+
## Apply the control-plane configurastion.
7887

88+
Generate the control-plane CRs.
89+
```bash
90+
kustomize build control-plane/ > control-plane.yaml
91+
```
92+
Apply the CRs
7993
```bash
8094
oc apply -f control-plane.yaml
81-
popd
8295
```
8396

8497
Wait for control plane to be available

examples/dt/uni01alpha/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/uni01alpha
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/uni01alpha/networking
7+
8+
resources:
9+
- nncp/values.yaml

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: kustomize.config.k8s.io/v1beta1
33
kind: Kustomization
44

55
components:
6-
- ../../../../../dt/uni01alpha/nncp
6+
- ../../../../../../dt/uni01alpha/networking/nncp
77

88
resources:
99
- values.yaml

0 commit comments

Comments
 (0)