Skip to content

Commit 8b60523

Browse files
abaysevallesp
authored andcommitted
[OSPRH-18411] Remove default bridged control plane network for HCI VA
1 parent 6a4fdd3 commit 8b60523

File tree

2 files changed

+127
-0
lines changed

2 files changed

+127
-0
lines changed
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
---
2+
# source: hci/network-values/values.yaml.j2
3+
{% set _ipv = cifmw_ci_gen_kustomize_values_ip_version_var_mapping %}
4+
{% set ns = namespace(interfaces={},
5+
ocp_index=0,
6+
lb_tools={}) %}
7+
data:
8+
{% for host in cifmw_networking_env_definition.instances.keys() -%}
9+
{% if host is match('^(ocp|crc).*') %}
10+
node_{{ ns.ocp_index }}:
11+
{% set ns.ocp_index = ns.ocp_index+1 %}
12+
name: {{ cifmw_networking_env_definition.instances[host]['hostname'] }}
13+
{% for network in cifmw_networking_env_definition.instances[host]['networks'].values() %}
14+
{% set ns.interfaces = ns.interfaces |
15+
combine({network.network_name: (network.parent_interface |
16+
default(network.interface_name)
17+
)
18+
},
19+
recursive=true) %}
20+
{{ network.network_name }}_ip: {{ network[_ipv.ip_vX] }}
21+
{% endfor %}
22+
{% endif %}
23+
{% endfor %}
24+
25+
{% for network in cifmw_networking_env_definition.networks.values() %}
26+
{% set ns.lb_tools = {} %}
27+
{{ network.network_name }}:
28+
dnsDomain: {{ network.search_domain }}
29+
{% if network.tools is defined and network.tools.keys() | length > 0 %}
30+
subnets:
31+
{% for tool in network.tools.keys() %}
32+
{% if tool is match('.*lb$') %}
33+
{% set _ = ns.lb_tools.update({tool: []}) %}
34+
{% endif %}
35+
{% endfor %}
36+
- allocationRanges:
37+
{% for range in network.tools.netconfig[_ipv.ipvX_ranges] %}
38+
- end: {{ range.end }}
39+
start: {{ range.start }}
40+
{% endfor %}
41+
cidr: {{ network[_ipv.network_vX] }}
42+
{% if network[_ipv.gw_vX] is defined %}
43+
gateway: {{ network[_ipv.gw_vX] }}
44+
{% endif %}
45+
name: subnet1
46+
{% if network.vlan_id is defined %}
47+
vlan: {{ network.vlan_id }}
48+
{% endif %}
49+
{% if ns.lb_tools | length > 0 %}
50+
lb_addresses:
51+
{% for tool in ns.lb_tools.keys() %}
52+
{% for lb_range in network.tools[tool][_ipv.ipvX_ranges] %}
53+
- {{ lb_range.start }}-{{ lb_range.end }}
54+
{% set _ = ns.lb_tools[tool].append(lb_range.start) %}
55+
{% endfor %}
56+
endpoint_annotations:
57+
{{ tool }}.universe.tf/address-pool: {{ network.network_name }}
58+
{{ tool }}.universe.tf/allow-shared-ip: {{ network.network_name }}
59+
{{ tool }}.universe.tf/loadBalancerIPs: {{ ','.join(ns.lb_tools[tool]) }}
60+
{% endfor %}
61+
{% endif %}
62+
{% endif %}
63+
prefix-length: {{ network[_ipv.network_vX] | ansible.utils.ipaddr('prefix') }}
64+
mtu: {{ network.mtu | default(1500) }}
65+
{% if network.vlan_id is defined %}
66+
vlan: {{ network.vlan_id }}
67+
{% if ns.interfaces[network.network_name] is defined %}
68+
iface: {{ network.network_name }}
69+
base_iface: {{ ns.interfaces[network.network_name] }}
70+
{% endif %}
71+
{% else %}
72+
{% if ns.interfaces[network.network_name] is defined %}
73+
iface: {{ ns.interfaces[network.network_name] }}
74+
{% endif %}
75+
{% endif %}
76+
{% if network.tools.multus is defined %}
77+
net-attach-def: |
78+
{
79+
"cniVersion": "0.3.1",
80+
"name": "{{ network.network_name }}",
81+
"type": "macvlan",
82+
{% if network.vlan_id is defined%}
83+
"master": "{{ network.network_name }}",
84+
{% else %}
85+
"master": "{{ ns.interfaces[network.network_name] }}",
86+
{% endif %}
87+
"ipam": {
88+
"type": "whereabouts",
89+
"range": "{{ network[_ipv.network_vX] }}",
90+
"range_start": "{{ network.tools.multus[_ipv.ipvX_ranges].0.start }}",
91+
"range_end": "{{ network.tools.multus[_ipv.ipvX_ranges].0.end }}"
92+
}
93+
}
94+
{% endif %}
95+
{% endfor %}
96+
97+
dns-resolver:
98+
config:
99+
server:
100+
- "{{ cifmw_networking_env_definition.networks.ctlplane[_ipv.gw_vX] }}"
101+
search: []
102+
options:
103+
- key: server
104+
values:
105+
- {{ cifmw_networking_env_definition.networks.ctlplane[_ipv.gw_vX] }}
106+
{% for nameserver in cifmw_ci_gen_kustomize_values_nameservers %}
107+
- key: server
108+
values:
109+
- {{ nameserver }}
110+
{% endfor %}
111+
112+
routes:
113+
config: []
114+
115+
# Hardcoding the last IP bit since we don't have support for endpoint_annotations in the networking_mapper output
116+
rabbitmq:
117+
endpoint_annotations:
118+
metallb.universe.tf/address-pool: internalapi
119+
metallb.universe.tf/loadBalancerIPs: {{ cifmw_networking_env_definition.networks['internalapi'][_ipv.network_vX] | ansible.utils.ipmath(85) }}
120+
rabbitmq-cell1:
121+
endpoint_annotations:
122+
metallb.universe.tf/address-pool: internalapi
123+
metallb.universe.tf/loadBalancerIPs: {{ cifmw_networking_env_definition.networks['internalapi'][_ipv.network_vX] | ansible.utils.ipmath(86) }}
124+
125+
lbServiceType: LoadBalancer
126+
storageClass: {{ cifmw_ci_gen_kustomize_values_storage_class }}

scenarios/reproducers/va-hci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ cifmw_libvirt_manager_configuration:
6565
- ocppr
6666
- ocpbm
6767
- osp_trunk
68+
- osp_trunk
6869
compute:
6970
uefi: "{{ cifmw_use_uefi }}"
7071
root_part_id: "{{ cifmw_root_partition_id }}"

0 commit comments

Comments
 (0)