Skip to content

Commit

Permalink
Decouple uni04delta network stage from control plane stage
Browse files Browse the repository at this point in the history
  • Loading branch information
jirimacku committed Feb 7, 2025
1 parent b773b51 commit c2f3d04
Show file tree
Hide file tree
Showing 12 changed files with 139 additions and 58 deletions.
27 changes: 27 additions & 0 deletions automation/vars/uni04delta-adoption.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
vas:
uni04delta-adoption:
stages:
- path: examples/dt/uni04delta/control-plane/networking/nncp
wait_conditions:
- >-
oc -n openstack wait nncp
-l osp/nncm-config-type=standard
--for jsonpath='{.status.conditions[0].reason}'=SuccessfullyConfigured
--timeout=5m
values:
- name: network-values
src_file: values.yaml
build_output: nncp.yaml

- path: examples/dt/uni04delta/control-plane/networking
wait_conditions:
- >-
oc -n metallb-system wait pod
-l app=metallb -l component=speaker
--for condition=Ready
--timeout=5min
values:
- name: network-values
src_file: nncp/values.yaml
build_output: networking.yaml
16 changes: 14 additions & 2 deletions automation/vars/uni04delta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
vas:
uni04delta:
stages:
- path: examples/dt/uni04delta/control-plane/nncp
- path: examples/dt/uni04delta/control-plane/networking/nncp
wait_conditions:
- >-
oc -n openstack wait nncp
Expand All @@ -14,6 +14,18 @@ vas:
src_file: values.yaml
build_output: nncp.yaml

- path: examples/dt/uni04delta/control-plane/networking
wait_conditions:
- >-
oc -n metallb-system wait pod
-l app=metallb -l component=speaker
--for condition=Ready
--timeout=5m
values:
- name: network-values
src_file: nncp/values.yaml
build_output: network.yaml

- path: examples/dt/uni04delta/control-plane
wait_conditions:
- >-
Expand All @@ -22,7 +34,7 @@ vas:
--timeout=60m
values:
- name: network-values
src_file: nncp/values.yaml
src_file: networking/nncp/values.yaml
- name: service-values.yaml
src_file: service-values.yaml
build_output: control-plane.yaml
Expand Down
48 changes: 0 additions & 48 deletions dt/uni04delta/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,57 +17,9 @@ transformers:
create: true
components:
- ../../lib/networking/metallb
- ../../lib/networking/netconfig
- ../../lib/networking/nad
- ../../lib/control-plane

patches:
- target:
version: v1beta1
kind: NetConfig
name: netconfig
patch: |-
- op: add
path: /spec/networks/-
value:
dnsDomain: _replaced_
name: storagemgmt
subnets:
- _replaced_
mtu: 1500
replacements:
- source:
kind: ConfigMap
name: network-values
fieldPath: data.storagemgmt.dnsDomain
targets:
- select:
kind: NetConfig
fieldPaths:
- spec.networks.[name=storagemgmt].dnsDomain

- source:
kind: ConfigMap
name: network-values
fieldPath: data.storagemgmt.mtu
targets:
- select:
kind: NetConfig
fieldPaths:
- spec.networks.[name=storagemgmt].mtu

- source:
kind: ConfigMap
name: network-values
fieldPath: data.storagemgmt.subnets
targets:
- select:
kind: NetConfig
fieldPaths:
- spec.networks.[name=storagemgmt].subnets

- source:
kind: ConfigMap
name: service-values
Expand Down
68 changes: 68 additions & 0 deletions dt/uni04delta/networking/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
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
- ../../../lib/networking/netconfig
- ../../../lib/networking/nad

patches:
- target:
version: v1beta1
kind: NetConfig
name: netconfig
patch: |-
- op: add
path: /spec/networks/-
value:
dnsDomain: _replaced_
name: storagemgmt
subnets:
- _replaced_
mtu: 1500
replacements:
- source:
kind: ConfigMap
name: network-values
fieldPath: data.storagemgmt.dnsDomain
targets:
- select:
kind: NetConfig
fieldPaths:
- spec.networks.[name=storagemgmt].dnsDomain

- source:
kind: ConfigMap
name: network-values
fieldPath: data.storagemgmt.mtu
targets:
- select:
kind: NetConfig
fieldPaths:
- spec.networks.[name=storagemgmt].mtu

- source:
kind: ConfigMap
name: network-values
fieldPath: data.storagemgmt.subnets
targets:
- select:
kind: NetConfig
fieldPaths:
- spec.networks.[name=storagemgmt].subnets
20 changes: 16 additions & 4 deletions examples/dt/uni04delta/control-plane.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,14 @@ Change to uni04delta directory
cd architecture/examples/dt/uni04delta
```

Apply the required network configurations.
# Apply the required node network configurations.
```bash
vi control-plane/networking/nncp/values.yaml
```

```bash
# Change the Node Network Configuration folder.
pushd control-plane/nncp
pushd control-plane/networking/nncp

# Generate the configuration
kustomize build > nncp.yaml
Expand All @@ -38,8 +41,18 @@ oc wait nncp -l osp/nncm-config-type=standard \
# change the working directory
popd
```
# Apply remainig networking configuration

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

Generate and apply the control-plane configurations.
# Generate and apply the control-plane configurations.

```bash
# Navigate to control-panel
Expand All @@ -56,4 +69,3 @@ oc wait openstackcontrolplane --for condition=Ready --timeout=600s

# change the work_dir
popd
```
2 changes: 1 addition & 1 deletion examples/dt/uni04delta/control-plane/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ components:
- ../../../../dt/uni04delta/

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/uni04delta/networking

resources:
- nncp/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ transformers:
create: true
components:
- ../../../../../lib/nncp
- ../../../../../../lib/nncp

resources:
- values.yaml
2 changes: 1 addition & 1 deletion examples/dt/uni04delta/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ components:
- ../../../dt/uni04delta/edpm/nodeset

resources:
- control-plane/nncp/values.yaml
- control-plane/networking/nncp/values.yaml
- control-plane/service-values.yaml
- values.yaml
3 changes: 2 additions & 1 deletion zuul.d/validations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,8 @@
- dt/uni04delta
- examples/dt/uni04delta
- examples/dt/uni04delta/control-plane
- examples/dt/uni04delta/control-plane/nncp
- examples/dt/uni04delta/control-plane/networking
- examples/dt/uni04delta/control-plane/networking/nncp
- examples/dt/uni04delta/deployment
- examples/dt/uni04delta/edpm-pre-ceph
- examples/dt/uni04delta/edpm-pre-ceph/nodeset
Expand Down

0 comments on commit c2f3d04

Please sign in to comment.