Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decouple uni01alpha network stage from control plane stage #497

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 15 additions & 18 deletions automation/vars/uni01alpha-adoption.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,17 @@
vas:
uni01alpha-adoption:
stages:
- path: examples/dt/uni01alpha/control-plane/nncp
- pre_stage_run:
- name: Apply cinder-lvm label on master-0
type: cr
definition:
metadata:
labels:
openstack.org/cinder-lvm: ""
kind: Node
resource_name: master-0
state: patched
path: examples/dt/uni01alpha/control-plane/networking/nncp
wait_conditions:
- >-
oc -n openstack wait nncp
Expand All @@ -14,26 +24,13 @@ vas:
src_file: values.yaml
build_output: nncp.yaml

- pre_stage_run:
- name: Apply cinder-lvm label on master-0
type: cr
definition:
metadata:
labels:
openstack.org/cinder-lvm: ""
kind: Node
resource_name: master-0
state: patched
path: examples/dt/uni01alpha/control-plane
- path: examples/dt/uni01alpha/control-plane/networking
wait_conditions:
- >-
oc -n openstack wait openstackcontrolplane
controlplane
oc -n metallb-system wait pod
-l app=metallb -l component=speaker
--for condition=Ready
--timeout=60m
values:
- name: network-values
src_file: nncp/values.yaml
- name: service-values
src_file: service-values.yaml
build_output: control-plane.yaml
build_output: networking.yaml
37 changes: 24 additions & 13 deletions automation/vars/uni01alpha.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,17 @@
vas:
uni01alpha:
stages:
- path: examples/dt/uni01alpha/control-plane/nncp
- pre_stage_run:
- name: Apply cinder-lvm label on master-0
type: cr
definition:
metadata:
labels:
openstack.org/cinder-lvm: ""
kind: Node
resource_name: master-0
state: patched
path: examples/dt/uni01alpha/control-plane/networking/nncp
wait_conditions:
- >-
oc -n openstack wait nncp
Expand All @@ -14,17 +24,18 @@ vas:
src_file: values.yaml
build_output: nncp.yaml

- pre_stage_run:
- name: Apply cinder-lvm label on master-0
type: cr
definition:
metadata:
labels:
openstack.org/cinder-lvm: ""
kind: Node
resource_name: master-0
state: patched
path: examples/dt/uni01alpha/control-plane
- path: examples/dt/uni01alpha/control-plane/networking
wait_conditions:
- >-
oc -n metallb-system wait pod
-l app=metallb -l component=speaker
--for condition=Ready
values:
- name: network-values
src_file: nncp/values.yaml
build_output: networking.yaml

- path: examples/dt/uni01alpha/control-plane
wait_conditions:
- >-
oc -n openstack wait openstackcontrolplane
Expand All @@ -33,7 +44,7 @@ vas:
--timeout=60m
values:
- name: network-values
src_file: nncp/values.yaml
src_file: networking/nncp/values.yaml
- name: service-values
src_file: service-values.yaml
build_output: control-plane.yaml
Expand Down
27 changes: 0 additions & 27 deletions dt/uni01alpha/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,8 @@ transformers:
create: true

components:
- ../../lib/networking/metallb
- netconfig
- ../../lib/networking/nad
- ../../lib/control-plane

resources:
- nad.yaml

replacements:
- source:
Expand Down Expand Up @@ -457,25 +452,3 @@ replacements:
- spec.nova.template.cellTemplates
options:
create: true

- source:
kind: ConfigMap
name: network-values
fieldPath: data.octavia.net-attach-def
targets:
- select:
kind: NetworkAttachmentDefinition
name: octavia
fieldPaths:
- spec.config

- source:
kind: ConfigMap
name: network-values
fieldPath: data.ironic.net-attach-def
targets:
- select:
kind: NetworkAttachmentDefinition
name: ironic
fieldPaths:
- spec.config
48 changes: 48 additions & 0 deletions dt/uni01alpha/networking/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
apiVersion: kustomize.config.k8s.io/v1alpha1
kind: Component

transformers:
- |-
apiVersion: builtin
kind: NamespaceTransformer
metadata:
name: _ignored_
namespace: openstack
setRoleBindingSubjects: none
unsetOnly: true
fieldSpecs:
- path: metadata/name
kind: Namespace
create: true
components:
- ../../../lib/networking/metallb
- netconfig
- ../../../lib/networking/nad

resources:
- nad.yaml

replacements:
- source:
kind: ConfigMap
name: network-values
fieldPath: data.octavia.net-attach-def
targets:
- select:
kind: NetworkAttachmentDefinition
name: octavia
fieldPaths:
- spec.config

- source:
kind: ConfigMap
name: network-values
fieldPath: data.ironic.net-attach-def
targets:
- select:
kind: NetworkAttachmentDefinition
name: ironic
fieldPaths:
- spec.config
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ transformers:
create: true

components:
- ../../../lib/nncp
- ../../../../lib/nncp

patches:
- target:
Expand Down
35 changes: 24 additions & 11 deletions examples/dt/uni01alpha/control-plane.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,33 +52,46 @@ cd architecture/examples/dt/uni01alpha
```

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

Apply node network configuration
## Apply node network configuration

Generate the node network configuration
```bash
pushd control-plane/nncp
kustomize build > nncp.yaml
kustomize build control-plane/networking/nncp > nncp.yaml
```
Apply the NNCP CRs
```
oc apply -f nncp.yaml
```
Wait for NNCPs to be available
```
oc wait nncp \
-l osp/nncm-config-type=standard \
--for jsonpath='{.status.conditions[0].reason}'=SuccessfullyConfigured \
--timeout=300s
popd
```

Generate the control-plane and networking CRs.
## Apply remaining networking configuration

```bash
pushd control-plane
kustomize build > control-plane.yaml
Generate the reminaing networking configuration
```
kustomize build control-plane/networking > networking.yaml
```
Apply the networking CRs
```
oc apply -f networking.yaml
```

## Create CRs
## Apply the control-plane configurastion.

Generate the control-plane CRs.
```bash
kustomize build control-plane/ > control-plane.yaml
```
Apply the CRs
```bash
oc apply -f control-plane.yaml
popd
```

Wait for control plane to be available
Expand Down
2 changes: 1 addition & 1 deletion examples/dt/uni01alpha/control-plane/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ components:
- ../../../../dt/uni01alpha

resources:
- nncp/values.yaml
- networking/nncp/values.yaml
- service-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

components:
- ../../../../../dt/uni01alpha/networking

resources:
- nncp/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

components:
- ../../../../../dt/uni01alpha/nncp
- ../../../../../../dt/uni01alpha/networking/nncp

resources:
- values.yaml
Loading