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 VA1 network stage from control plane stage #489

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
10 changes: 5 additions & 5 deletions automation/vars/hci-adoption.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
vas:
hci-adoption:
stages:
- path: examples/va/hci/control-plane/nncp
- path: examples/va/hci/control-plane/networking/nncp
wait_conditions:
- >-
oc -n openstack wait nncp
Expand All @@ -14,12 +14,12 @@ vas:
src_file: values.yaml
build_output: nncp.yaml

- path: examples/va/hci/control-plane
- path: examples/va/hci/control-plane/networking
wait_conditions:
- >-
oc -n openstack wait nncp
-l osp/nncm-config-type=standard
--for jsonpath='{.status.conditions[0].reason}'=SuccessfullyConfigured
oc -n metallb-system wait pod
-l app=metallb -l component=speaker
--for condition=Ready
Comment on lines +20 to +22
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't really check whether the resources created in this stage are in fact ready. Unfortunately, those resources (NetConfig, Net-Attach-Def, L2Advertisement and IPAddressPool) do not have a status that can be examined. But our CI validation requires that we have at least one wait_conditions listed here, so I've opted to use MetalLB speaker pods as the target here...but it's really just a placeholder.

--timeout=5m
values:
- name: network-values
Expand Down
16 changes: 14 additions & 2 deletions automation/vars/hci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
vas:
hci:
stages:
- path: examples/va/hci/control-plane/nncp
- path: examples/va/hci/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/va/hci/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/va/hci/control-plane
wait_conditions:
- >-
Expand All @@ -23,7 +35,7 @@ vas:
- name: service-values
src_file: service-values.yaml
- name: network-values
src_file: nncp/values.yaml
src_file: networking/nncp/values.yaml
build_output: ../control-plane.yaml

- path: examples/va/hci/edpm-pre-ceph/nodeset
Expand Down
23 changes: 17 additions & 6 deletions examples/va/hci/control-plane.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ Change to the hci directory
```
cd architecture/examples/va/hci
```
Edit the [control-plane/nncp/values.yaml](control-plane/nncp/values.yaml) file to suit your environment.
Edit the [control-plane/networking/nncp/values.yaml](control-plane/networking/nncp/values.yaml) file to suit your environment.
```
vi control-plane/nncp/values.yaml
vi control-plane/networking/nncp/values.yaml
```

## Apply node network configuration

Generate the node network configuration
```
kustomize build control-plane/nncp > nncp.yaml
kustomize build control-plane/networking/nncp > nncp.yaml
```
Apply the NNCP CRs
```
Expand All @@ -34,13 +34,24 @@ Wait for NNCPs to be available
oc wait nncp -l osp/nncm-config-type=standard --for jsonpath='{.status.conditions[0].reason}'=SuccessfullyConfigured --timeout=300s
```

## Apply networking and control-plane configuration
## Apply remaining networking configuration

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

## Apply control-plane configuration

Generate the control-plane CR.
```
kustomize build control-plane > control-plane.yaml
```
Apply the CRs
Apply the CR
```
oc apply -f control-plane.yaml
```
Expand Down
2 changes: 1 addition & 1 deletion examples/va/hci/control-plane/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ components:
## https://github.com/kubernetes-sigs/kustomize/blob/master/examples/remoteBuild.md

resources:
- nncp/values.yaml
- networking/nncp/values.yaml
- service-values.yaml
9 changes: 9 additions & 0 deletions examples/va/hci/control-plane/networking/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

components:
- ../../../../../va/hci/networking

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

resources:
- values.yaml
2 changes: 1 addition & 1 deletion examples/va/hci/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ components:
## https://github.com/kubernetes-sigs/kustomize/blob/master/examples/remoteBuild.md

resources:
- control-plane/nncp/values.yaml
- control-plane/networking/nncp/values.yaml
- edpm-pre-ceph/nodeset/values.yaml
- service-values.yaml
- values.yaml
52 changes: 0 additions & 52 deletions va/hci/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,56 +18,4 @@ transformers:
create: true
components:
- ../../lib/networking/metallb
- ../../lib/networking/netconfig
- ../../lib/networking/nad
- ../../lib/control-plane

# Add storagemgmt network template, as it is needed for CephHCI
patches:
- target:
version: v1beta1
kind: NetConfig
name: netconfig
patch: |-
- op: add
path: /spec/networks/-
value:
dnsDomain: _replaced_
name: storagemgmt
subnets:
- _replaced_
mtu: 1500
# Add storagemgmt network replacements
replacements:
# NetConfig dnsDomain specific to this VA
- source:
kind: ConfigMap
name: network-values
fieldPath: data.storagemgmt.dnsDomain
targets:
- select:
kind: NetConfig
fieldPaths:
- spec.networks.[name=storagemgmt].dnsDomain
# NetConfig MTU specific to this VA
- source:
kind: ConfigMap
name: network-values
fieldPath: data.storagemgmt.mtu
targets:
- select:
kind: NetConfig
fieldPaths:
- spec.networks.[name=storagemgmt].mtu
# NetConfig subnets specific to this VA
- source:
kind: ConfigMap
name: network-values
fieldPath: data.storagemgmt.subnets
targets:
- select:
kind: NetConfig
fieldPaths:
- spec.networks.[name=storagemgmt].subnets
72 changes: 72 additions & 0 deletions va/hci/networking/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
---
apiVersion: kustomize.config.k8s.io/v1alpha1
kind: Component

transformers:
# Set namespace to OpenStack on all namespaced objects without a namespace
- |-
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

# Add storagemgmt network template, as it is needed for CephHCI
patches:
- target:
version: v1beta1
kind: NetConfig
name: netconfig
patch: |-
- op: add
path: /spec/networks/-
value:
dnsDomain: _replaced_
name: storagemgmt
subnets:
- _replaced_
mtu: 1500
# Add storagemgmt network replacements
replacements:
# NetConfig dnsDomain specific to this VA
- source:
kind: ConfigMap
name: network-values
fieldPath: data.storagemgmt.dnsDomain
targets:
- select:
kind: NetConfig
fieldPaths:
- spec.networks.[name=storagemgmt].dnsDomain
# NetConfig MTU specific to this VA
- source:
kind: ConfigMap
name: network-values
fieldPath: data.storagemgmt.mtu
targets:
- select:
kind: NetConfig
fieldPaths:
- spec.networks.[name=storagemgmt].mtu
# NetConfig subnets specific to this VA
- source:
kind: ConfigMap
name: network-values
fieldPath: data.storagemgmt.subnets
targets:
- select:
kind: NetConfig
fieldPaths:
- spec.networks.[name=storagemgmt].subnets
7 changes: 4 additions & 3 deletions zuul.d/validations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@
files:
- examples/va/hci
- examples/va/hci/control-plane
- examples/va/hci/control-plane/nncp
- examples/va/hci/control-plane/networking
- examples/va/hci/control-plane/networking/nncp
- examples/va/hci/deployment
- examples/va/hci/edpm-pre-ceph/deployment
- examples/va/hci/edpm-pre-ceph/nodeset
Expand All @@ -70,8 +71,8 @@
cifmw_architecture_scenario: hci
- job:
files:
- examples/va/hci/control-plane
- examples/va/hci/control-plane/nncp
- examples/va/hci/control-plane/networking
- examples/va/hci/control-plane/networking/nncp
- lib
name: rhoso-architecture-validate-hci-adoption
parent: rhoso-architecture-base-job
Expand Down