Skip to content

Commit 508fa7e

Browse files
committed
(multiple) Add SKMO OVN Octavia support and fix multi-namespace deploy issues
Add Octavia network-values fixes, federation ordering, SKMO EDPM stale deployment hooks, and va-multi-skmo reproducer updates. Signed-off-by: Ade Lee <alee@redhat.com> Assisted-by: Claude Opus 4.6
1 parent e986def commit 508fa7e

6 files changed

Lines changed: 150 additions & 32 deletions

File tree

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
- name: Read NodeSet status
3+
kubernetes.core.k8s_info:
4+
api_version: dataplane.openstack.org/v1beta1
5+
kind: OpenStackDataPlaneNodeSet
6+
name: "{{ skmo_edpm_target.nodeset }}"
7+
namespace: "{{ skmo_edpm_target.namespace }}"
8+
register: _osdpns
9+
10+
- name: Delete stale OpenStackDataPlaneDeployment
11+
kubernetes.core.k8s:
12+
state: absent
13+
api_version: dataplane.openstack.org/v1beta1
14+
kind: OpenStackDataPlaneDeployment
15+
name: "{{ skmo_edpm_target.deployment }}"
16+
namespace: "{{ skmo_edpm_target.namespace }}"
17+
wait: true
18+
wait_timeout: 600
19+
when:
20+
- _osdpns.resources | length > 0
21+
- _osdpns.resources[0].status.configHash is defined
22+
- _osdpns.resources[0].status.configHash | length > 0
23+
- _osdpns.resources[0].status.deployedConfigHash is not defined or
24+
_osdpns.resources[0].status.configHash != _osdpns.resources[0].status.deployedConfigHash
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
# Delete OpenStackDataPlaneDeployment when NodeSet config drifted.
3+
# After status.deployed=true the deployment controller does not re-run ansible
4+
# until the CR is recreated, even if osdpns configHash changed.
5+
- name: Recreate stale EDPM deployments when NodeSet config changed
6+
hosts: "{{ cifmw_target_hook_host | default('localhost') }}"
7+
gather_facts: false
8+
vars:
9+
skmo_edpm_targets:
10+
- namespace: openstack
11+
nodeset: openstack-edpm
12+
deployment: edpm-deployment
13+
- namespace: openstack2
14+
nodeset: openstack-edpm
15+
deployment: edpm-deployment
16+
tasks:
17+
- name: Recreate stale EDPM deployment in {{ skmo_edpm_target.namespace }}
18+
ansible.builtin.include_tasks: recreate-edpm-deployment-if-stale-target.yaml
19+
loop: "{{ skmo_edpm_targets }}"
20+
loop_control:
21+
label: "{{ item.namespace }}"
22+
vars:
23+
skmo_edpm_target: "{{ item }}"

roles/ci_gen_kustomize_values/templates/multi-namespace/network-values/values.yaml.j2

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,31 @@ data:
7373
iface: {{ ns.interfaces[network.network_name] }}
7474
{% endif %}
7575
{% endif %}
76-
{% if network.tools.multus is defined %}
76+
{% if network.tools.multus is defined and network.network_name == "octavia" and cifmw_architecture_scenario == 'multi-namespace-skmo' %}
77+
net-attach-def: |
78+
{
79+
"cniVersion": "0.3.1",
80+
"name": "octavia",
81+
"type": "bridge",
82+
"bridge": "octbr",
83+
"ipam": {
84+
"type": "whereabouts",
85+
"range": "{{ network[_ipv.network_vX] }}",
86+
{% if _ipv.ipvX_routes in network.tools.multus and network.tools.multus[_ipv.ipvX_routes] | length > 0 %}
87+
"routes": [
88+
{% for route in network.tools.multus[_ipv.ipvX_routes] %}
89+
{
90+
"dst": "{{ route.destination }}",
91+
"gw": "{{ route.gateway }}"
92+
}{% if not loop.last %},{% endif %}
93+
{% endfor %}
94+
],
95+
{% endif %}
96+
"range_start": "{{ network.tools.multus[_ipv.ipvX_ranges].0.start }}",
97+
"range_end": "{{ network.tools.multus[_ipv.ipvX_ranges].0.end }}"
98+
}
99+
}
100+
{% elif network.tools.multus is defined %}
77101
net-attach-def: |
78102
{
79103
"cniVersion": "0.3.1",
@@ -124,3 +148,6 @@ data:
124148

125149
lbServiceType: LoadBalancer
126150
storageClass: {{ cifmw_ci_gen_kustomize_values_storage_class }}
151+
152+
# Required when SKMO enables octavia NNCP bridge on OCP masters
153+
bridgeName: ospbr

roles/ci_gen_kustomize_values/templates/multi-namespace/network-values2/values.yaml.j2

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ data:
3232
{% endif %}
3333
{% endfor %}
3434

35-
{% for network in cifmw_networking_env_definition.networks.values() if "2" in network %}
35+
{% for network in cifmw_networking_env_definition.networks.values() if "2" in network.network_name or (cifmw_architecture_scenario == 'multi-namespace-skmo' and network.network_name == 'octavia') %}
3636
{% set ns.lb_tools = {} %}
3737
{{ network.network_name | replace("2", "") }}:
3838
dnsDomain: {{ network.search_domain }}
@@ -53,7 +53,7 @@ data:
5353
gateway: {{ network[_ipv.gw_vX] }}
5454
{% endif %}
5555
name: subnet1
56-
{% if network.vlan_id is defined %}
56+
{% if network.vlan_id is defined and network.network_name != 'external2' %}
5757
vlan: {{ network.vlan_id }}
5858
{% endif %}
5959
{% if ns.lb_tools | length > 0 %}
@@ -83,7 +83,31 @@ data:
8383
iface: {{ ns.interfaces[network.network_name] }}
8484
{% endif %}
8585
{% endif %}
86-
{% if network.tools.multus is defined %}
86+
{% if network.tools.multus is defined and network.network_name == "octavia" and cifmw_architecture_scenario == 'multi-namespace-skmo' %}
87+
net-attach-def: |
88+
{
89+
"cniVersion": "0.3.1",
90+
"name": "octavia",
91+
"type": "bridge",
92+
"bridge": "octbr",
93+
"ipam": {
94+
"type": "whereabouts",
95+
"range": "{{ network[_ipv.network_vX] }}",
96+
{% if _ipv.ipvX_routes in network.tools.multus and network.tools.multus[_ipv.ipvX_routes] | length > 0 %}
97+
"routes": [
98+
{% for route in network.tools.multus[_ipv.ipvX_routes] %}
99+
{
100+
"dst": "{{ route.destination }}",
101+
"gw": "{{ route.gateway }}"
102+
}{% if not loop.last %},{% endif %}
103+
{% endfor %}
104+
],
105+
{% endif %}
106+
"range_start": "{{ network.tools.multus[_ipv.ipvX_ranges].0.start }}",
107+
"range_end": "{{ network.tools.multus[_ipv.ipvX_ranges].0.end }}"
108+
}
109+
}
110+
{% elif network.tools.multus is defined %}
87111
net-attach-def: |
88112
{
89113
"cniVersion": "0.3.1",
@@ -134,3 +158,5 @@ data:
134158

135159
lbServiceType: LoadBalancer
136160
storageClass: {{ cifmw_ci_gen_kustomize_values_storage_class }}
161+
162+
bridgeName: ospbr

roles/federation/tasks/run_openstack_setup.yml

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -73,26 +73,6 @@
7373
remote_path: "/home/cloud-admin/{{ cifmw_federation_rules_file }}"
7474
local_path: "{{ [ ansible_user_dir, 'ci-framework-data', 'tmp', cifmw_federation_rules_file ] | path_join }}"
7575

76-
- name: Check if federation mapping already exists
77-
environment:
78-
KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}"
79-
PATH: "{{ cifmw_path }}"
80-
ansible.builtin.command:
81-
cmd: >-
82-
oc exec -n {{ cifmw_federation_run_osp_cmd_namespace }} -t openstackclient --
83-
openstack mapping show {{ cifmw_federation_mapping_name }} -f value -c id
84-
register: _federation_mapping_check
85-
failed_when: false
86-
changed_when: false
87-
88-
- name: Run federation mapping create
89-
when: _federation_mapping_check.rc != 0
90-
vars:
91-
_osp_cmd: "openstack mapping create
92-
--rules {{ cifmw_federation_rules_file }}
93-
{{ cifmw_federation_mapping_name }}"
94-
ansible.builtin.include_tasks: run_osp_cmd.yml
95-
9676
- name: Check if federation group already exists
9777
environment:
9878
KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}"
@@ -135,6 +115,26 @@
135115
{{ cifmw_federation_project_name }}"
136116
ansible.builtin.include_tasks: run_osp_cmd.yml
137117

118+
- name: Check if federation mapping already exists
119+
environment:
120+
KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}"
121+
PATH: "{{ cifmw_path }}"
122+
ansible.builtin.command:
123+
cmd: >-
124+
oc exec -n {{ cifmw_federation_run_osp_cmd_namespace }} -t openstackclient --
125+
openstack mapping show {{ cifmw_federation_mapping_name }} -f value -c id
126+
register: _federation_mapping_check
127+
failed_when: false
128+
changed_when: false
129+
130+
- name: Run federation mapping create
131+
when: _federation_mapping_check.rc != 0
132+
vars:
133+
_osp_cmd: "openstack mapping create
134+
--rules {{ cifmw_federation_rules_file }}
135+
{{ cifmw_federation_mapping_name }}"
136+
ansible.builtin.include_tasks: run_osp_cmd.yml
137+
138138
- name: Run federation role add (safe to repeat - role add is idempotent)
139139
environment:
140140
KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}"

scenarios/reproducers/va-multi-skmo.yml

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,25 @@ cifmw_networking_definition:
319319
ranges:
320320
- start: 100
321321
end: 250
322-
vlan: 32
322+
# No vlan: existing leaf NetConfig external subnet was created without VLAN;
323+
# NetConfig webhook rejects adding vlan to an established subnet.
324+
mtu: 1500
325+
octavia:
326+
network: "172.23.0.0/24"
327+
vlan: 23
323328
mtu: 1500
329+
tools:
330+
multus:
331+
ranges:
332+
- start: 30
333+
end: 70
334+
routes:
335+
- destination: "172.24.0.0/16"
336+
gateway: "172.23.0.150"
337+
netconfig:
338+
ranges:
339+
- start: 100
340+
end: 250
324341

325342
group-templates:
326343
ocps:
@@ -362,6 +379,8 @@ cifmw_networking_definition:
362379
trunk-parent: ctlplane
363380
storage:
364381
trunk-parent: ctlplane
382+
octavia:
383+
trunk-parent: ctlplane
365384
compute2s:
366385
network-template:
367386
range:
@@ -375,6 +394,8 @@ cifmw_networking_definition:
375394
trunk-parent: ctlplane2
376395
storage2:
377396
trunk-parent: ctlplane2
397+
octavia:
398+
trunk-parent: ctlplane2
378399
instances:
379400
controller-0:
380401
networks:
@@ -403,10 +424,7 @@ pre_admin_setup:
403424
cifmw_os_net_setup_public_end: "192.168.133.250"
404425
cifmw_os_net_setup_public_gateway: "192.168.133.1"
405426

406-
post_tests:
407-
- name: Run tempest against openstack2 namespace
408-
type: playbook
409-
source: "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/ci-framework/playbooks/multi-namespace/ns2_validation.yaml"
410-
extra_vars:
411-
cifmw_test_operator_tempest_name: tempest-tests2
412-
cifmw_test_operator_namespace: openstack2
427+
# Tempest runs via ci-framework-jobs scenario vars (05-tests.yaml), not post_tests hooks.
428+
# Zuul: integration-uni-base variable_files_dirs loads scenarios/uni/va-multi-namespace-skmo/.
429+
# Local reproducer: pass -e @.../ci-framework-jobs/scenarios/uni/va-multi-namespace-skmo/05-tests.yaml
430+
post_tests: []

0 commit comments

Comments
 (0)