Skip to content

Commit

Permalink
Decouple VA1 network stage from control plane stage
Browse files Browse the repository at this point in the history
  • Loading branch information
abays committed Jan 30, 2025
1 parent 44608a4 commit 527e2fc
Show file tree
Hide file tree
Showing 10 changed files with 108 additions and 62 deletions.
4 changes: 2 additions & 2 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/network/nncp
wait_conditions:
- >-
oc -n openstack wait nncp
Expand All @@ -23,5 +23,5 @@ vas:
--timeout=5m
values:
- name: network-values
src_file: nncp/values.yaml
src_file: network/nncp/values.yaml
build_output: networking.yaml
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/network/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/network
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: network/nncp/values.yaml
build_output: ../control-plane.yaml

- path: examples/va/hci/edpm-pre-ceph/nodeset
Expand Down
17 changes: 14 additions & 3 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/network/nncp/values.yaml](control-plane/network/nncp/values.yaml) file to suit your environment.
```
vi control-plane/nncp/values.yaml
vi control-plane/network/nncp/values.yaml
```

## Apply node network configuration

Generate the node network configuration
```
kustomize build control-plane/nncp > nncp.yaml
kustomize build control-plane/network/nncp > nncp.yaml
```
Apply the NNCP CRs
```
Expand All @@ -34,6 +34,17 @@ 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 remaining networking configuration

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

## Apply networking and control-plane configuration

Generate the control-plane and networking CRs.
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
- network/nncp/values.yaml
- service-values.yaml
75 changes: 75 additions & 0 deletions examples/va/hci/control-plane/network/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

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

resources:
- nncp/values.yaml

# 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
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/network/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

0 comments on commit 527e2fc

Please sign in to comment.