Skip to content

Commit ba0724c

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-controlplane: shared OSCP replacements (service config, images, network attachments, OVN nicMappings, CA passphrase secret) Add user-facing values under examples/va/multi-namespace-skmo/components/: - octavia-network-values: dedicated ConfigMap with network parameters - octavia-service-values: dedicated ConfigMap with service parameters Wire Octavia into examples/va/multi-namespace-skmo: control-plane networking (NAD, NetConfig, NNCP), EDPM bridge mapping. Scope edpm_nodes_validation_check_for_fqdn override to SKMO only via kustomize replacement (SKMO EDPM nodes cannot resolve FQDN during validate-network due to MetalLB L2 timing with Octavia networking). Signed-off-by: Ade Lee <alee@redhat.com> Assisted-by: Claude Opus 4.6
1 parent 604873a commit ba0724c

27 files changed

Lines changed: 594 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
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
# Provide octavia-network-values ConfigMap for use by replacements.
3+
apiVersion: kustomize.config.k8s.io/v1alpha1
4+
kind: Component
5+
6+
resources:
7+
- octavia-network-values.yaml
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# local-config: octavia keys for replacements (static oc kustomize; ci-gen also adds octavia at deploy)
2+
---
3+
apiVersion: v1
4+
kind: ConfigMap
5+
metadata:
6+
name: octavia-network-values
7+
annotations:
8+
config.kubernetes.io/local-config: "true"
9+
data:
10+
octavia:
11+
dnsDomain: octavia.example.com
12+
mtu: 1500
13+
vlan: 23
14+
base_iface: enp7s0
15+
subnets:
16+
- allocationRanges:
17+
- end: 172.23.0.250
18+
start: 172.23.0.100
19+
cidr: 172.23.0.0/24
20+
name: subnet1
21+
vlan: 23
22+
net-attach-def: |
23+
{
24+
"cniVersion": "0.3.1",
25+
"name": "octavia",
26+
"type": "bridge",
27+
"bridge": "octbr",
28+
"ipam": {
29+
"type": "whereabouts",
30+
"range": "172.23.0.0/24",
31+
"range_start": "172.23.0.30",
32+
"range_end": "172.23.0.70",
33+
"routes": [
34+
{
35+
"dst": "172.24.0.0/16",
36+
"gw": "172.23.0.150"
37+
}
38+
]
39+
}
40+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
# Patch service-values ConfigMap with Octavia service parameters.
3+
apiVersion: kustomize.config.k8s.io/v1alpha1
4+
kind: Component
5+
6+
patches:
7+
- target:
8+
kind: ConfigMap
9+
name: service-values
10+
path: octavia-service-values.yaml
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Octavia keys for service-values ConfigMap (shared by central and leaf control planes)
2+
---
3+
apiVersion: v1
4+
kind: ConfigMap
5+
metadata:
6+
name: service-values
7+
annotations:
8+
config.kubernetes.io/local-config: "true"
9+
data:
10+
ovn:
11+
ovnController:
12+
nicMappings:
13+
octavia: octbr
14+
octavia:
15+
enabled: true
16+
amphoraImageContainerImage: quay.io/gthiemonge/octavia-amphora-image
17+
apacheContainerImage: registry.redhat.io/ubi9/httpd-24:latest
18+
octaviaAPI:
19+
networkAttachments:
20+
- internalapi
21+
octaviaHousekeeping:
22+
networkAttachments:
23+
- octavia
24+
octaviaHealthManager:
25+
networkAttachments:
26+
- octavia
27+
octaviaWorker:
28+
networkAttachments:
29+
- octavia

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

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

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

813
patches:
914
- 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: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
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+
- ../../../components/octavia-network-values
12+
13+
patches:
14+
- target:
15+
kind: NodeNetworkConfigurationPolicy
16+
patch: |-
17+
- op: add
18+
path: /spec/desiredState/interfaces/-
19+
value:
20+
description: Octavia vlan host interface
21+
name: octavia
22+
state: up
23+
type: vlan
24+
vlan:
25+
base-iface: _replaced_
26+
id: _replaced_
27+
- target:
28+
kind: NodeNetworkConfigurationPolicy
29+
patch: |-
30+
- op: add
31+
path: /spec/desiredState/interfaces/-
32+
value:
33+
description: Octavia bridge
34+
mtu: 1500
35+
name: octbr
36+
type: linux-bridge
37+
bridge:
38+
options:
39+
stp:
40+
enabled: false
41+
port:
42+
- name: octavia
43+
44+
replacements:
45+
- source:
46+
kind: ConfigMap
47+
name: octavia-network-values
48+
fieldPath: data.octavia.base_iface
49+
targets:
50+
- select:
51+
kind: NodeNetworkConfigurationPolicy
52+
fieldPaths:
53+
- spec.desiredState.interfaces.[name=octavia].vlan.base-iface
54+
- source:
55+
kind: ConfigMap
56+
name: octavia-network-values
57+
fieldPath: data.octavia.vlan
58+
targets:
59+
- select:
60+
kind: NodeNetworkConfigurationPolicy
61+
fieldPaths:
62+
- spec.desiredState.interfaces.[name=octavia].vlan.id

0 commit comments

Comments
 (0)