Skip to content

Commit fa4b45c

Browse files
vakwetuDeydra71
authored andcommitted
Add Octavia support for SKMO multi-namespace deployment
Add reusable va/ components for Octavia: - networking-octavia: NetConfig skeleton and NAD replacements - octavia-network-values: dedicated ConfigMap with network parameters - octavia-service-values: dedicated ConfigMap with service parameters - octavia-controlplane: shared OSCP replacements (service config, images, network attachments, OVN nicMappings, CA passphrase secret) Wire Octavia into examples/va/multi-namespace-skmo: control-plane networking (NAD, NetConfig, NNCP), EDPM bridge mapping. Dependency flow is examples/ -> va/ (no reverse references). Signed-off-by: Ade Lee <alee@redhat.com> Assisted-by: Claude Opus 4.6
1 parent 98f4af5 commit fa4b45c

28 files changed

Lines changed: 666 additions & 41 deletions

File tree

automation/vars/multi-namespace-skmo.yaml

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ vas:
1515
build_output: namespace.yaml
1616

1717
- name: nncp-configuration # stage 1
18-
path: examples/va/multi-namespace/control-plane/networking/nncp
18+
path: examples/va/multi-namespace-skmo/control-plane/networking/nncp
1919
wait_conditions:
2020
# We don't wait for these NNCPs at this stage, because we'll wait for
2121
# both namespaces in the next stage so that they can deploy in parallel
@@ -26,24 +26,24 @@ vas:
2626
--timeout=5m
2727
values:
2828
- name: network-values
29-
src_file: values.yaml
29+
src_file: ../../../../multi-namespace/control-plane/networking/nncp/values.yaml
3030
build_output: nncp.yaml
3131

3232
- name: nncp-configuration2 # stage 2
33-
path: examples/va/multi-namespace/control-plane2/networking/nncp
33+
path: examples/va/multi-namespace-skmo/control-plane2/networking/nncp
3434
wait_conditions:
3535
- >-
36-
oc -n openstack wait nncp
36+
oc -n openstack2 wait nncp
3737
-l osp/nncm-config-type=standard
3838
--for jsonpath='{.status.conditions[0].reason}'=SuccessfullyConfigured
3939
--timeout=5m
4040
values:
4141
- name: network-values2
42-
src_file: values.yaml
42+
src_file: ../../../../multi-namespace/control-plane2/networking/nncp/values.yaml
4343
build_output: nncp2.yaml
4444

4545
- name: network-configuration # stage 3
46-
path: examples/va/multi-namespace/control-plane/networking
46+
path: examples/va/multi-namespace-skmo/control-plane/networking
4747
wait_conditions:
4848
- >-
4949
oc -n metallb-system wait pod
@@ -52,11 +52,11 @@ vas:
5252
--timeout=5m
5353
values:
5454
- name: network-values
55-
src_file: nncp/values.yaml
55+
src_file: ../../../multi-namespace/control-plane/networking/nncp/values.yaml
5656
build_output: network.yaml
5757

5858
- name: network-configuration2 # stage 4
59-
path: examples/va/multi-namespace/control-plane2/networking
59+
path: examples/va/multi-namespace-skmo/control-plane2/networking
6060
wait_conditions:
6161
- >-
6262
oc -n metallb-system wait pod
@@ -65,7 +65,7 @@ vas:
6565
--timeout=5m
6666
values:
6767
- name: network-values2
68-
src_file: nncp/values.yaml
68+
src_file: ../../../multi-namespace/control-plane2/networking/nncp/values.yaml
6969
build_output: network2.yaml
7070

7171
- pre_stage_run: # stage 5
@@ -222,7 +222,7 @@ vas:
222222
inventory: "${HOME}/ci-framework-data/artifacts/zuul_inventory.yml"
223223

224224
- name: edpm-nodeset # stage 7
225-
path: examples/va/multi-namespace/edpm/nodeset
225+
path: examples/va/multi-namespace-skmo/edpm/nodeset
226226
wait_conditions:
227227
# We don't wait for this namespace's OpenStackDataPlaneNodeSet at
228228
# this stage, because we'll wait for both namespaces in the next
@@ -233,7 +233,7 @@ vas:
233233
--timeout=5m
234234
values:
235235
- name: edpm-nodeset-values
236-
src_file: values.yaml
236+
src_file: ../../../multi-namespace/edpm/nodeset/values.yaml
237237
build_output: nodeset.yaml
238238

239239
- pre_stage_run: # stage 8
@@ -242,7 +242,7 @@ vas:
242242
source: "../../playbooks/multi-namespace/ns2_osdp_services.yaml"
243243
inventory: "${HOME}/ci-framework-data/artifacts/zuul_inventory.yml"
244244
name: edpm-nodeset2
245-
path: examples/va/multi-namespace/edpm2/nodeset
245+
path: examples/va/multi-namespace-skmo/edpm2/nodeset
246246
wait_conditions:
247247
- >-
248248
oc -n openstack wait
@@ -254,10 +254,15 @@ vas:
254254
--timeout=10m
255255
values:
256256
- name: edpm-nodeset2-values
257-
src_file: values.yaml
257+
src_file: ../../../multi-namespace/edpm2/nodeset/values.yaml
258258
build_output: nodeset2.yaml
259259

260-
- name: edpm-deployment # stage 9
260+
- pre_stage_run: # stage 9
261+
- name: Recreate EDPM deployments when NodeSet config hash drifted
262+
type: playbook
263+
source: "skmo/recreate-edpm-deployment-if-stale.yaml"
264+
inventory: "${HOME}/ci-framework-data/artifacts/zuul_inventory.yml"
265+
name: edpm-deployment
261266
path: examples/va/multi-namespace/edpm
262267
wait_conditions:
263268
# We don't wait for this namespace's OpenStackDataPlaneDeployment at
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
apiVersion: v1
3+
kind: ConfigMap
4+
metadata:
5+
name: edpm-nodeset-values
6+
data:
7+
nodeset:
8+
ansible:
9+
ansibleVars:
10+
edpm_ovn_bridge_mappings:
11+
- "datacentre:br-ex"
12+
- "octavia:octbr"
13+
edpm_network_config_template: |
14+
---
15+
{% set mtu_list = [ctlplane_mtu] %}
16+
{% for network in nodeset_networks %}
17+
{% set _ = mtu_list.append(lookup('vars', networks_lower[network] ~ '_mtu')) %}
18+
{%- endfor %}
19+
{% set min_viable_mtu = mtu_list | max %}
20+
network_config:
21+
- type: interface
22+
name: nic1
23+
use_dhcp: true
24+
mtu: {{ min_viable_mtu }}
25+
- type: ovs_bridge
26+
name: {{ neutron_physical_bridge_name }}
27+
mtu: {{ min_viable_mtu }}
28+
use_dhcp: false
29+
dns_servers: {{ ctlplane_dns_nameservers }}
30+
domain: {{ dns_search_domains }}
31+
addresses:
32+
- ip_netmask: {{ ctlplane_ip }}/{{ ctlplane_cidr }}
33+
routes: {{ ctlplane_host_routes }}
34+
members:
35+
- type: interface
36+
name: nic2
37+
mtu: {{ min_viable_mtu }}
38+
# force the MAC address of the bridge to this interface
39+
primary: true
40+
{% for network in nodeset_networks %}
41+
- type: vlan
42+
mtu: {{ lookup('vars', networks_lower[network] ~ '_mtu') }}
43+
vlan_id: {{ lookup('vars', networks_lower[network] ~ '_vlan_id') }}
44+
addresses:
45+
- ip_netmask:
46+
{{ lookup('vars', networks_lower[network] ~ '_ip') }}/{{ lookup('vars', networks_lower[network] ~ '_cidr') }}
47+
routes: {{ lookup('vars', networks_lower[network] ~ '_host_routes') }}
48+
{% endfor %}
49+
- type: ovs_bridge
50+
name: octbr
51+
mtu: {{ min_viable_mtu }}
52+
use_dhcp: false
53+
members:
54+
- type: vlan
55+
mtu: {{ min_viable_mtu }}
56+
vlan_id: 23
57+
device: nic2
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
# OVN Octavia compute bridge overlay for EDPM nodesets.
3+
apiVersion: kustomize.config.k8s.io/v1alpha1
4+
kind: Component
5+
6+
patches:
7+
- target:
8+
kind: ConfigMap
9+
name: edpm-nodeset-values
10+
path: edpm-octavia-ansible-vars.yaml

examples/va/multi-namespace-skmo/control-plane/kustomization.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ kind: Component
44

55
components:
66
- ../../multi-namespace/control-plane
7+
- ../components/metallb-ctlplane-bridge
8+
- ../../../../va/multi-namespace-skmo/octavia-controlplane
9+
10+
resources:
11+
- networking/octavia-netattach.yaml
12+
- octavia-ca-passphrase.yaml
713

814
patches:
915
- target:
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
apiVersion: kustomize.config.k8s.io/v1beta1
3+
kind: Kustomization
4+
5+
resources:
6+
- ../../../multi-namespace/control-plane/networking
7+
- octavia-netattach.yaml
8+
9+
components:
10+
- ../../../../../va/multi-namespace-skmo/networking-octavia
Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
---
2+
apiVersion: kustomize.config.k8s.io/v1beta1
3+
kind: Kustomization
4+
5+
# ci_gen_kustomize_values writes env-specific network-values to the base
6+
# values.yaml before build (see automation vars src_file).
7+
resources:
8+
- ../../../../multi-namespace/control-plane/networking/nncp
9+
10+
components:
11+
- ../../../../../../va/multi-namespace-skmo/octavia-network-values
12+
13+
# Octavia NNCP patches for SKMO. Select by osp/nncp-node label so patches apply
14+
# after lib/nncp-single-nic renames node-0 -> ostest-master-0.
15+
patches:
16+
- target:
17+
kind: NodeNetworkConfigurationPolicy
18+
labelSelector: osp/nncp-node=node-0
19+
patch: |-
20+
- op: add
21+
path: /spec/desiredState/interfaces/-
22+
value:
23+
description: Octavia vlan host interface
24+
name: octavia
25+
state: up
26+
type: vlan
27+
vlan:
28+
base-iface: _replaced_
29+
id: _replaced_
30+
- target:
31+
kind: NodeNetworkConfigurationPolicy
32+
labelSelector: osp/nncp-node=node-0
33+
patch: |-
34+
- op: add
35+
path: /spec/desiredState/interfaces/-
36+
value:
37+
description: Octavia bridge
38+
mtu: 1500
39+
name: octbr
40+
type: linux-bridge
41+
bridge:
42+
options:
43+
stp:
44+
enabled: false
45+
port:
46+
- name: octavia
47+
- target:
48+
kind: NodeNetworkConfigurationPolicy
49+
labelSelector: osp/nncp-node=node-1
50+
patch: |-
51+
- op: add
52+
path: /spec/desiredState/interfaces/-
53+
value:
54+
description: Octavia vlan host interface
55+
name: octavia
56+
state: up
57+
type: vlan
58+
vlan:
59+
base-iface: _replaced_
60+
id: _replaced_
61+
- target:
62+
kind: NodeNetworkConfigurationPolicy
63+
labelSelector: osp/nncp-node=node-1
64+
patch: |-
65+
- op: add
66+
path: /spec/desiredState/interfaces/-
67+
value:
68+
description: Octavia bridge
69+
mtu: 1500
70+
name: octbr
71+
type: linux-bridge
72+
bridge:
73+
options:
74+
stp:
75+
enabled: false
76+
port:
77+
- name: octavia
78+
- target:
79+
kind: NodeNetworkConfigurationPolicy
80+
labelSelector: osp/nncp-node=node-2
81+
patch: |-
82+
- op: add
83+
path: /spec/desiredState/interfaces/-
84+
value:
85+
description: Octavia vlan host interface
86+
name: octavia
87+
state: up
88+
type: vlan
89+
vlan:
90+
base-iface: _replaced_
91+
id: _replaced_
92+
- target:
93+
kind: NodeNetworkConfigurationPolicy
94+
labelSelector: osp/nncp-node=node-2
95+
patch: |-
96+
- op: add
97+
path: /spec/desiredState/interfaces/-
98+
value:
99+
description: Octavia bridge
100+
mtu: 1500
101+
name: octbr
102+
type: linux-bridge
103+
bridge:
104+
options:
105+
stp:
106+
enabled: false
107+
port:
108+
- name: octavia
109+
110+
replacements:
111+
- source:
112+
kind: ConfigMap
113+
name: octavia-network-values
114+
fieldPath: data.octavia.base_iface
115+
targets:
116+
- select:
117+
kind: NodeNetworkConfigurationPolicy
118+
labelSelector: osp/nncp-node=node-0
119+
fieldPaths:
120+
- spec.desiredState.interfaces.[name=octavia].vlan.base-iface
121+
- source:
122+
kind: ConfigMap
123+
name: octavia-network-values
124+
fieldPath: data.octavia.vlan
125+
targets:
126+
- select:
127+
kind: NodeNetworkConfigurationPolicy
128+
labelSelector: osp/nncp-node=node-0
129+
fieldPaths:
130+
- spec.desiredState.interfaces.[name=octavia].vlan.id
131+
- source:
132+
kind: ConfigMap
133+
name: octavia-network-values
134+
fieldPath: data.octavia.base_iface
135+
targets:
136+
- select:
137+
kind: NodeNetworkConfigurationPolicy
138+
labelSelector: osp/nncp-node=node-1
139+
fieldPaths:
140+
- spec.desiredState.interfaces.[name=octavia].vlan.base-iface
141+
- source:
142+
kind: ConfigMap
143+
name: octavia-network-values
144+
fieldPath: data.octavia.vlan
145+
targets:
146+
- select:
147+
kind: NodeNetworkConfigurationPolicy
148+
labelSelector: osp/nncp-node=node-1
149+
fieldPaths:
150+
- spec.desiredState.interfaces.[name=octavia].vlan.id
151+
- source:
152+
kind: ConfigMap
153+
name: octavia-network-values
154+
fieldPath: data.octavia.base_iface
155+
targets:
156+
- select:
157+
kind: NodeNetworkConfigurationPolicy
158+
labelSelector: osp/nncp-node=node-2
159+
fieldPaths:
160+
- spec.desiredState.interfaces.[name=octavia].vlan.base-iface
161+
- source:
162+
kind: ConfigMap
163+
name: octavia-network-values
164+
fieldPath: data.octavia.vlan
165+
targets:
166+
- select:
167+
kind: NodeNetworkConfigurationPolicy
168+
labelSelector: osp/nncp-node=node-2
169+
fieldPaths:
170+
- spec.desiredState.interfaces.[name=octavia].vlan.id
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
apiVersion: k8s.cni.cncf.io/v1
3+
kind: NetworkAttachmentDefinition
4+
metadata:
5+
name: octavia
6+
labels:
7+
osp/net: octavia
8+
osp/net-attach-def-type: standard
9+
spec:
10+
config: |
11+
_replaced_
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
apiVersion: v1
3+
kind: Secret
4+
metadata:
5+
name: octavia-ca-passphrase
6+
type: Opaque
7+
stringData:
8+
server-ca-passphrase: "12345678"

0 commit comments

Comments
 (0)