Skip to content

Commit 25fa1a8

Browse files
evallespsdatko
authored andcommitted
Revert change to make preference nncp on worker nodes thatn master nodes
It seems these scenarios has master nodes and a single worker node which is tainted. This worker node is used for running tempest but nothing related with OCP. Problematic scenarios are those which has a worker node tainted for tempest, but the workload is set in master nodes. There's no reason to configure NNCP in master nodes when we have regular worker nodes, so we were assuming that in case of there's a worker node, then all NNCP goes to worker node, which is problematic when single worker node is tainted. So we need to enhance the templates to: * Check if there's a worker node, if so, check if those are tainted. * If not tainted, worker takes preference. * If tainted, master takes preference. * If there's no worker node, then we go with master nodes. * Same for SNO CRC scenarios. Adding also uni02beta that takes the template from common
1 parent e5b3610 commit 25fa1a8

File tree

6 files changed

+292
-18
lines changed

6 files changed

+292
-18
lines changed
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
---
2+
# source: uni02beta/edpm-nodeset-values/values.yaml.j2
3+
{% set _ipv = cifmw_ci_gen_kustomize_values_ip_version_var_mapping %}
4+
{% set instances_names = [] %}
5+
{% set _original_nodeset = (original_content.data | default({})).nodeset | default({}) %}
6+
{% set _original_nodes = _original_nodeset.nodes | default({}) %}
7+
{% set _original_services = _original_nodeset['services'] | default([]) %}
8+
{% set _vm_type = (_original_nodes.keys() | first).split('-')[1] %}
9+
{% for _inst in cifmw_networking_env_definition.instances.keys() %}
10+
{% if _inst.startswith(_vm_type) %}
11+
{% set _ = instances_names.append(_inst) %}
12+
{% endif %}
13+
{% endfor %}
14+
data:
15+
ssh_keys:
16+
authorized: {{ cifmw_ci_gen_kustomize_values_ssh_authorizedkeys | b64encode }}
17+
private: {{ cifmw_ci_gen_kustomize_values_ssh_private_key | b64encode }}
18+
public: {{ cifmw_ci_gen_kustomize_values_ssh_public_key | b64encode }}
19+
nodeset:
20+
ansible:
21+
ansibleUser: "zuul"
22+
ansibleVars:
23+
edpm_fips_mode: "{{ 'enabled' if cifmw_fips_enabled|default(false)|bool else 'check' }}"
24+
timesync_ntp_servers:
25+
- hostname: "{{ cifmw_ci_gen_kustomize_values_ntp_srv | default('pool.ntp.org') }}"
26+
edpm_network_config_os_net_config_mappings:
27+
{% for instance in instances_names %}
28+
edpm-{{ instance }}:
29+
{% if cifmw_baremetal_hosts is defined %}
30+
{% for interface in cifmw_baremetal_hosts[instance].nics %}
31+
nic{{ loop.index }}: "{{ interface.mac }}"
32+
{% endfor %}
33+
{% else %}
34+
{% if hostvars[instance] is defined %}
35+
nic1: "{{ hostvars[instance][_ipv.ansible_default_ipvX].macaddress }}"
36+
{% endif %}
37+
nic2: "{{ cifmw_networking_env_definition.instances[instance].networks.ctlplane.mac_addr }}"
38+
{% endif %}
39+
{% endfor %}
40+
{% if cifmw_ci_gen_kustomize_values_sshd_ranges | default([]) | length > 0 %}
41+
edpm_sshd_allowed_ranges:
42+
{% for range in cifmw_ci_gen_kustomize_values_sshd_ranges %}
43+
- "{{ range }}"
44+
{% endfor %}
45+
{% endif %}
46+
nodes:
47+
{% for instance in instances_names %}
48+
edpm-{{ instance }}:
49+
ansible:
50+
host: {{ cifmw_networking_env_definition.instances[instance].networks.ctlplane[_ipv.ip_vX] }}
51+
hostName: {{ instance }}
52+
networks:
53+
{% for net in cifmw_networking_env_definition.instances[instance].networks.keys() %}
54+
- name: {{ net }}
55+
subnetName: subnet1
56+
fixedIP: {{ cifmw_networking_env_definition.instances[instance].networks[net][_ipv.ip_vX] }}
57+
{% if net is match('ctlplane') %}
58+
defaultRoute: true
59+
{% endif %}
60+
{% endfor %}
61+
{% endfor %}
62+
{% if ('repo-setup' not in _original_services) and
63+
('repo-setup' in ci_gen_kustomize_edpm_nodeset_predeployed_services) %}
64+
services:
65+
- "repo-setup"
66+
{% for svc in _original_services %}
67+
- "{{ svc }}"
68+
{% endfor %}
69+
{% endif %}
70+
71+
{% if _vm_type.startswith('compute') %}
72+
nova:
73+
migration:
74+
ssh_keys:
75+
private: {{ cifmw_ci_gen_kustomize_values_migration_priv_key | b64encode }}
76+
public: {{ cifmw_ci_gen_kustomize_values_migration_pub_key | b64encode }}
77+
{% endif %}
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
---
2+
# source: uni02beta/edpm-values/values.yaml.j2
3+
{% set _ipv = cifmw_ci_gen_kustomize_values_ip_version_var_mapping %}
4+
{% set instances_names = [] %}
5+
{% set _original_nodeset = (original_content.data | default({})).nodeset | default({}) %}
6+
{% set _original_nodes = _original_nodeset.nodes | default({}) %}
7+
{% set _original_services = _original_nodeset['services'] | default([]) %}
8+
{% set _vm_type = (_original_nodes.keys() | first).split('-')[1] %}
9+
{% for _inst in cifmw_networking_env_definition.instances.keys() %}
10+
{% if _inst.startswith(_vm_type) %}
11+
{% set _ = instances_names.append(_inst) %}
12+
{% endif %}
13+
{% endfor %}
14+
data:
15+
ssh_keys:
16+
authorized: {{ cifmw_ci_gen_kustomize_values_ssh_authorizedkeys | b64encode }}
17+
private: {{ cifmw_ci_gen_kustomize_values_ssh_private_key | b64encode }}
18+
public: {{ cifmw_ci_gen_kustomize_values_ssh_public_key | b64encode }}
19+
{% if _vm_type.startswith('compute') %}
20+
nova:
21+
migration:
22+
ssh_keys:
23+
private: {{ cifmw_ci_gen_kustomize_values_migration_priv_key | b64encode }}
24+
public: {{ cifmw_ci_gen_kustomize_values_migration_pub_key | b64encode }}
25+
{% endif %}
26+
nodeset:
27+
ansible:
28+
ansibleUser: "zuul"
29+
ansibleVars:
30+
edpm_fips_mode: "{{ 'enabled' if cifmw_fips_enabled|default(false)|bool else 'check' }}"
31+
timesync_ntp_servers:
32+
- hostname: "{{ cifmw_ci_gen_kustomize_values_ntp_srv | default('pool.ntp.org') }}"
33+
edpm_network_config_os_net_config_mappings:
34+
{% for instance in instances_names %}
35+
edpm-{{ instance }}:
36+
{% if hostvars[instance] is defined %}
37+
nic1: "{{ hostvars[instance][_ipv.ansible_default_ipvX].macaddress }}"
38+
{% endif %}
39+
nic2: "{{ cifmw_networking_env_definition.instances[instance].networks.ctlplane.mac_addr }}"
40+
{% endfor %}
41+
{% if cifmw_ci_gen_kustomize_values_sshd_ranges | default([]) | length > 0 %}
42+
edpm_sshd_allowed_ranges:
43+
{% for range in cifmw_ci_gen_kustomize_values_sshd_ranges %}
44+
- "{{ range }}"
45+
{% endfor %}
46+
{% endif %}
47+
{% if ('repo-setup' not in (_original_nodeset['services'] | default([]))) and
48+
('repo-setup' in ci_gen_kustomize_edpm_nodeset_predeployed_services) %}
49+
services:
50+
- "repo-setup"
51+
{% for svc in _original_services %}
52+
- "{{ svc }}"
53+
{% endfor %}
54+
{% endif %}
55+
56+
nodes:
57+
{% for instance in instances_names %}
58+
edpm-{{ instance }}:
59+
ansible:
60+
host: {{ cifmw_networking_env_definition.instances[instance].networks.ctlplane[_ipv.ip_vX] }}
61+
hostName: {{ instance }}
62+
networks:
63+
{% for net in cifmw_networking_env_definition.instances[instance].networks.keys() %}
64+
- name: {{ net }}
65+
subnetName: subnet1
66+
{% if net is match('ctlplane') %}
67+
defaultRoute: true
68+
fixedIP: {{ cifmw_networking_env_definition.instances[instance].networks.ctlplane[_ipv.ip_vX] }}
69+
{% endif %}
70+
{% endfor %}
71+
{% endfor %}
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
---
2+
# source: uni02beta/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+
{% elif network.network_name == "ctlplane" %}
85+
"master": "ospbr",
86+
{% else %}
87+
"master": "{{ ns.interfaces[network.network_name] }}",
88+
{% endif %}
89+
"ipam": {
90+
"type": "whereabouts",
91+
"range": "{{ network[_ipv.network_vX] }}",
92+
"range_start": "{{ network.tools.multus[_ipv.ipvX_ranges].0.start }}",
93+
"range_end": "{{ network.tools.multus[_ipv.ipvX_ranges].0.end }}"
94+
}
95+
}
96+
{% endif %}
97+
{% endfor %}
98+
99+
dns-resolver:
100+
config:
101+
server:
102+
- "{{ cifmw_networking_env_definition.networks.ctlplane[_ipv.gw_vX] }}"
103+
search: []
104+
options:
105+
- key: server
106+
values:
107+
- {{ cifmw_networking_env_definition.networks.ctlplane[_ipv.gw_vX] }}
108+
{% for nameserver in cifmw_ci_gen_kustomize_values_nameservers %}
109+
- key: server
110+
values:
111+
- {{ nameserver }}
112+
{% endfor %}
113+
114+
routes:
115+
config: []
116+
117+
# Hardcoding the last IP bit since we don't have support for endpoint_annotations in the networking_mapper output
118+
rabbitmq:
119+
endpoint_annotations:
120+
metallb.universe.tf/address-pool: internalapi
121+
metallb.universe.tf/loadBalancerIPs: {{ cifmw_networking_env_definition.networks['internalapi'][_ipv.network_vX] | ansible.utils.ipmath(85) }}
122+
rabbitmq-cell1:
123+
endpoint_annotations:
124+
metallb.universe.tf/address-pool: internalapi
125+
metallb.universe.tf/loadBalancerIPs: {{ cifmw_networking_env_definition.networks['internalapi'][_ipv.network_vX] | ansible.utils.ipmath(86) }}
126+
127+
lbServiceType: LoadBalancer
128+
storageClass: {{ cifmw_ci_gen_kustomize_values_storage_class }}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# source: uni02beta/olm-values/values.yaml.j2
2+
data:
3+
openstack-operator-image: {{ cifmw_ci_gen_kustomize_values_ooi_image | default('quay.io/openstack-k8s-operators/openstack-operator-index:latest', true) }}
4+
{% if cifmw_ci_gen_kustomize_values_sub_channel is defined %}
5+
openstack-operator-channel: {{ cifmw_ci_gen_kustomize_values_sub_channel }}
6+
{% endif %}
7+
{% if cifmw_ci_gen_kustomize_values_deployment_version is defined %}
8+
{% if cifmw_ci_gen_kustomize_values_deployment_version not in ['v1.0.3', 'v1.0.6'] %}
9+
openstack-operator-version: openstack-operator.{{ cifmw_ci_gen_kustomize_values_deployment_version }}
10+
{% endif %}
11+
{% endif %}
12+
{% if cifmw_ci_gen_kustomize_values_installplan_approval is defined %}
13+
openstack-operator-installplanapproval: {{ cifmw_ci_gen_kustomize_values_installplan_approval }}
14+
{% endif %}

roles/ci_gen_kustomize_values/templates/uni04delta-ipv6-adoption/network-values/values.yaml.j2

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,9 @@
44
{% set ns = namespace(interfaces={},
55
ocp_index=0,
66
lb_tools={}) %}
7-
8-
{% if cifmw_networking_env_definition.instances.keys() | select('match', '^ocp-worker') | list | length > 0 %}
9-
{% set filter="^ocp-worker" %}
10-
{% elif cifmw_networking_env_definition.instances.keys() | select('match', 'crc') | list | length > 0 %}
11-
{% set filter="^crc" %}
12-
{% else %}
13-
{% set filter="^ocp" %}
14-
{% endif %}
157
data:
168
{% for host in cifmw_networking_env_definition.instances.keys() -%}
17-
{% if host is match(filter) %}
9+
{% if host is match('^(ocp|crc).*') %}
1810
node_{{ ns.ocp_index }}:
1911
{% set ns.ocp_index = ns.ocp_index+1 %}
2012
name: {{ cifmw_networking_env_definition.instances[host]['hostname'] }}

roles/ci_gen_kustomize_values/templates/uni04delta-ipv6/network-values/values.yaml.j2

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,9 @@
44
{% set ns = namespace(interfaces={},
55
ocp_index=0,
66
lb_tools={}) %}
7-
8-
{% if cifmw_networking_env_definition.instances.keys() | select('match', '^ocp-worker') | list | length > 0 %}
9-
{% set filter="^ocp-worker" %}
10-
{% elif cifmw_networking_env_definition.instances.keys() | select('match', 'crc') | list | length > 0 %}
11-
{% set filter="^crc" %}
12-
{% else %}
13-
{% set filter="^ocp" %}
14-
{% endif %}
157
data:
168
{% for host in cifmw_networking_env_definition.instances.keys() -%}
17-
{% if host is match(filter) %}
9+
{% if host is match('^(ocp|crc).*') %}
1810
node_{{ ns.ocp_index }}:
1911
{% set ns.ocp_index = ns.ocp_index+1 %}
2012
name: {{ cifmw_networking_env_definition.instances[host]['hostname'] }}

0 commit comments

Comments
 (0)