Skip to content

Commit

Permalink
Decouple uni07eta network stage from control plane stage
Browse files Browse the repository at this point in the history
  • Loading branch information
dsariel committed Feb 7, 2025
1 parent 44608a4 commit 8c575e2
Show file tree
Hide file tree
Showing 12 changed files with 113 additions and 20 deletions.
27 changes: 27 additions & 0 deletions automation/vars/uni07eta-adoption.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
vas:
uni07eta-adoption:
stages:
- path: examples/dt/un07eta/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/un07eta/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: networking.yaml
16 changes: 14 additions & 2 deletions automation/vars/uni07eta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
vas:
uni07eta:
stages:
- path: examples/dt/uni07eta/control-plane/nncp
- path: examples/dt/uni07eta/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/uni07eta/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/uni07eta/control-plane
wait_conditions:
- >-
Expand All @@ -23,7 +35,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
24 changes: 11 additions & 13 deletions dt/uni07eta/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ transformers:
create: true
components:
- ../../lib/networking/metallb
- ../../lib/networking/netconfig
- ../../lib/networking/nad
- ../../lib/control-plane

resources:
Expand Down Expand Up @@ -344,13 +341,14 @@ replacements:
options:
create: true

- source:
kind: ConfigMap
name: network-values
fieldPath: data.octavia.net-attach-def
targets:
- select:
kind: NetworkAttachmentDefinition
name: octavia
fieldPaths:
- spec.config
# # TODO: check this again
# - source:
# kind: ConfigMap
# name: network-values
# fieldPath: data.octavia.net-attach-def
# targets:
# - select:
# kind: NetworkAttachmentDefinition
# name: octavia
# fieldPaths:
# - spec.config
22 changes: 22 additions & 0 deletions dt/uni07eta/networking/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
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
11 changes: 11 additions & 0 deletions dt/uni07eta/nncp/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -185,3 +185,14 @@ replacements:
name: master-2
fieldPaths:
- spec.desiredState.interfaces.[name=octavia].vlan.id

- source:
kind: ConfigMap
name: network-values
fieldPath: data.octavia.net-attach-def
targets:
- select:
kind: NetworkAttachmentDefinition
name: octavia
fieldPaths:
- spec.config
16 changes: 14 additions & 2 deletions examples/dt/uni07eta/control-plane.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ cd architecture/examples/dt/uni07eta
```

Edit [control-plane/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

```bash
pushd control-plane/nncp
pushd control-plane/networking/nncp
kustomize build > nncp.yaml
oc apply -f nncp.yaml
oc wait nncp \
Expand All @@ -43,6 +43,18 @@ oc wait nncp \
popd
```

## Apply remaining networking configuration

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


Generate the control-plane and networking CRs.

```bash
Expand Down
2 changes: 1 addition & 1 deletion examples/dt/uni07eta/control-plane/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ components:
- ../../../../dt/uni07eta

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/uni07eta/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/uni07eta/nncp
- ../../../../../../dt/uni07eta/nncp

resources:
- values.yaml
1 change: 1 addition & 0 deletions examples/dt/uni07eta/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ components:
- ../../../dt/uni07eta/edpm

resources:
- control-plane/networking/nncp/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 @@ -312,7 +312,8 @@
- dt/uni07eta
- examples/dt/uni07eta
- examples/dt/uni07eta/control-plane
- examples/dt/uni07eta/control-plane/nncp
- examples/dt/uni07eta/control-plane/networking
- examples/dt/uni07eta/control-plane/networking/nncp
- examples/dt/uni07eta/edpm
- examples/dt/uni07eta/networker
- examples/dt/uni07eta/networker/nodeset
Expand Down

0 comments on commit 8c575e2

Please sign in to comment.