-
Notifications
You must be signed in to change notification settings - Fork 141
Add uni04delta and uni04delta-adoption network-values templates #3532
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
rebtoor
wants to merge
1
commit into
openstack-k8s-operators:main
Choose a base branch
from
rebtoor:uni04delta
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
147 changes: 147 additions & 0 deletions
147
roles/ci_gen_kustomize_values/templates/uni04delta-adoption/network-values/values.yaml.j2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,147 @@ | ||
| --- | ||
| # source: uni04delta-adoption/network-values/values.yaml.j2 | ||
| {% set _ipv = cifmw_ci_gen_kustomize_values_ip_version_var_mapping %} | ||
| {% set ns = namespace(interfaces={}, | ||
| ocp_index=0, | ||
| lb_tools={}) %} | ||
| data: | ||
| {% for host in cifmw_networking_env_definition.instances.keys() -%} | ||
| {% if host is match('^(ocp|crc).*') %} | ||
| node_{{ ns.ocp_index }}: | ||
| {% set ns.ocp_index = ns.ocp_index+1 %} | ||
| name: {{ cifmw_networking_env_definition.instances[host]['hostname'] }} | ||
| {# FIXEME: (hjensas): We need to ensure the OCP cluster_name and base_domain is available here #} | ||
| {# Because devscripts use fqdn for node names when ipv6 #} | ||
| node_name: {{ cifmw_networking_env_definition.instances[host]['hostname'] }}.ocp.openstack.lab | ||
| {% for network in cifmw_networking_env_definition.instances[host]['networks'].values() %} | ||
| {% set ns.interfaces = ns.interfaces | | ||
| combine({network.network_name: (network.parent_interface | | ||
| default(network.interface_name) | ||
| ) | ||
| }, | ||
| recursive=true) %} | ||
| {{ network.network_name }}_ip: {{ network[_ipv.ip_vX] }} | ||
| {% endfor %} | ||
| {% endif %} | ||
| {% endfor %} | ||
|
|
||
| {% for network in cifmw_networking_env_definition.networks.values() %} | ||
| {% set ns.lb_tools = {} %} | ||
| {{ network.network_name }}: | ||
| dnsDomain: {{ network.search_domain }} | ||
| {% if network.tools is defined and network.tools.keys() | length > 0 %} | ||
| {% for tool in network.tools.keys() %} | ||
| {% if tool is match('.*lb$') %} | ||
| {% set _ = ns.lb_tools.update({tool: []}) %} | ||
| {% endif %} | ||
| {% endfor %} | ||
| {% if network.tools.netconfig is defined %} | ||
| subnets: | ||
| - name: subnet1 | ||
| cidr: {{ network[_ipv.network_vX] }} | ||
| gateway: {{ omit if network[_ipv.gw_vX] is not defined else network[_ipv.gw_vX] }} | ||
| vlan: {{ omit if network.vlan_id is not defined else network.vlan_id }} | ||
| allocationRanges: | ||
| {% for range in network.tools.netconfig[_ipv.ipvX_ranges] %} | ||
| - end: {{ range.end }} | ||
| start: {{ range.start }} | ||
| {% endfor %} | ||
| {% endif %} | ||
| {% if ns.lb_tools | length > 0 %} | ||
| lb_addresses: | ||
| {% for tool in ns.lb_tools.keys() %} | ||
| {% for lb_range in network.tools[tool][_ipv.ipvX_ranges] %} | ||
| - {{ lb_range.start }}-{{ lb_range.end }} | ||
| {% set _ = ns.lb_tools[tool].append(lb_range.start) %} | ||
| {% endfor %} | ||
| endpoint_annotations: | ||
| {{ tool }}.universe.tf/address-pool: {{ network.network_name }} | ||
| {{ tool }}.universe.tf/allow-shared-ip: {{ network.network_name }} | ||
| {{ tool }}.universe.tf/loadBalancerIPs: {{ ','.join(ns.lb_tools[tool]) }} | ||
| {% endfor %} | ||
| {% endif %} | ||
| {% endif %} | ||
| prefix-length: {{ network[_ipv.network_vX] | ansible.utils.ipaddr('prefix') }} | ||
| mtu: {{ network.mtu | default(1500) }} | ||
| {% if network.vlan_id is defined %} | ||
| vlan: {{ network.vlan_id }} | ||
| iface: {{ omit if ns.interfaces[network.network_name] is not defined else network.network_name }} | ||
| base_iface: {{ omit if ns.interfaces[network.network_name] is not defined else ns.interfaces[network.network_name] }} | ||
| {% elif network.network_name != "ironic" %} | ||
| iface: {{ omit if ns.interfaces[network.network_name] is not defined else ns.interfaces[network.network_name] }} | ||
| {% else %} | ||
| iface: {{ omit if ns.interfaces[network.network_name] is not defined else network.network_name }} | ||
| {% endif %} | ||
| {% if network.tools.multus is defined and network.network_name == "ctlplane" %} | ||
| net-attach-def: | | ||
| { | ||
| "cniVersion": "0.3.1", | ||
| "name": "{{ network.network_name }}", | ||
| "type": "macvlan", | ||
| "master": "ospbr", | ||
| "ipam": { | ||
| "type": "whereabouts", | ||
| "range": "{{ network[_ipv.network_vX] }}", | ||
| "range_start": "{{ network.tools.multus[_ipv.ipvX_ranges].0.start }}", | ||
| "range_end": "{{ network.tools.multus[_ipv.ipvX_ranges].0.end }}" | ||
| } | ||
| } | ||
| {% endif %} | ||
| {% if network.tools.multus is defined and network.network_name == "ironic" %} | ||
| net-attach-def: | | ||
| { | ||
| "cniVersion": "0.3.1", | ||
| "name": "ironic", | ||
| "type": "bridge", | ||
| "bridge": "ironic", | ||
| "ipam": { | ||
| "type": "whereabouts", | ||
| "range": "{{ network[_ipv.network_vX] }}", | ||
| "range_start": "{{ network.tools.multus[_ipv.ipvX_ranges].0.start }}", | ||
| "range_end": "{{ network.tools.multus[_ipv.ipvX_ranges].0.end }}" | ||
| } | ||
| } | ||
| {% endif %} | ||
| {% if network.tools.multus is defined and network.network_name not in ["ctlplane", "ironic"] %} | ||
| net-attach-def: | | ||
| { | ||
| "cniVersion": "0.3.1", | ||
| "name": "{{ network.network_name }}", | ||
| "type": "macvlan", | ||
| "master": "{{ network.network_name if network.vlan_id is defined else ns.interfaces[network.network_name] }}", | ||
| "ipam": { | ||
| "type": "whereabouts", | ||
| "range": "{{ network[_ipv.network_vX] }}", | ||
| "range_start": "{{ network.tools.multus[_ipv.ipvX_ranges].0.start }}", | ||
| "range_end": "{{ network.tools.multus[_ipv.ipvX_ranges].0.end }}" | ||
| } | ||
| } | ||
| {% endif %} | ||
| {% endfor %} | ||
| dns-resolver: | ||
| config: | ||
| server: | ||
| - "{{ cifmw_networking_env_definition.networks.ctlplane[_ipv.gw_vX] }}" | ||
| search: [] | ||
| options: | ||
| - key: server | ||
| values: | ||
| - {{ cifmw_networking_env_definition.networks.ctlplane[_ipv.gw_vX] }} | ||
| {% for nameserver in cifmw_ci_gen_kustomize_values_nameservers %} | ||
| - key: server | ||
| values: | ||
| - {{ nameserver }} | ||
| {% endfor %} | ||
|
|
||
| # Hardcoding the last IP bit since we don't have support for endpoint_annotations in the networking_mapper output | ||
| rabbitmq: | ||
| endpoint_annotations: | ||
| metallb.universe.tf/address-pool: internalapi | ||
| metallb.universe.tf/loadBalancerIPs: {{ cifmw_networking_env_definition.networks['internalapi'][_ipv.network_vX] | ansible.utils.ipmath(85) }} | ||
| rabbitmq-cell1: | ||
| endpoint_annotations: | ||
| metallb.universe.tf/address-pool: internalapi | ||
| metallb.universe.tf/loadBalancerIPs: {{ cifmw_networking_env_definition.networks['internalapi'][_ipv.network_vX] | ansible.utils.ipmath(86) }} | ||
|
|
||
| lbServiceType: LoadBalancer | ||
| storageClass: {{ cifmw_ci_gen_kustomize_values_storage_class }} | ||
147 changes: 147 additions & 0 deletions
147
roles/ci_gen_kustomize_values/templates/uni04delta/network-values/values.yaml.j2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,147 @@ | ||
| --- | ||
| # source: uni04delta/network-values/values.yaml.j2 | ||
| {% set _ipv = cifmw_ci_gen_kustomize_values_ip_version_var_mapping %} | ||
| {% set ns = namespace(interfaces={}, | ||
| ocp_index=0, | ||
| lb_tools={}) %} | ||
| data: | ||
| {% for host in cifmw_networking_env_definition.instances.keys() -%} | ||
| {% if host is match('^(ocp|crc).*') %} | ||
| node_{{ ns.ocp_index }}: | ||
| {% set ns.ocp_index = ns.ocp_index+1 %} | ||
| name: {{ cifmw_networking_env_definition.instances[host]['hostname'] }} | ||
| {# FIXEME: (hjensas): We need to ensure the OCP cluster_name and base_domain is available here #} | ||
| {# Because devscripts use fqdn for node names when ipv6 #} | ||
| node_name: {{ cifmw_networking_env_definition.instances[host]['hostname'] }}.ocp.openstack.lab | ||
| {% for network in cifmw_networking_env_definition.instances[host]['networks'].values() %} | ||
| {% set ns.interfaces = ns.interfaces | | ||
| combine({network.network_name: (network.parent_interface | | ||
| default(network.interface_name) | ||
| ) | ||
| }, | ||
| recursive=true) %} | ||
| {{ network.network_name }}_ip: {{ network[_ipv.ip_vX] }} | ||
| {% endfor %} | ||
| {% endif %} | ||
| {% endfor %} | ||
|
|
||
| {% for network in cifmw_networking_env_definition.networks.values() %} | ||
| {% set ns.lb_tools = {} %} | ||
| {{ network.network_name }}: | ||
| dnsDomain: {{ network.search_domain }} | ||
| {% if network.tools is defined and network.tools.keys() | length > 0 %} | ||
| {% for tool in network.tools.keys() %} | ||
| {% if tool is match('.*lb$') %} | ||
| {% set _ = ns.lb_tools.update({tool: []}) %} | ||
| {% endif %} | ||
| {% endfor %} | ||
| {% if network.tools.netconfig is defined %} | ||
| subnets: | ||
| - name: subnet1 | ||
| cidr: {{ network[_ipv.network_vX] }} | ||
| gateway: {{ omit if network[_ipv.gw_vX] is not defined else network[_ipv.gw_vX] }} | ||
| vlan: {{ omit if network.vlan_id is not defined else network.vlan_id }} | ||
| allocationRanges: | ||
| {% for range in network.tools.netconfig[_ipv.ipvX_ranges] %} | ||
| - end: {{ range.end }} | ||
| start: {{ range.start }} | ||
| {% endfor %} | ||
| {% endif %} | ||
| {% if ns.lb_tools | length > 0 %} | ||
| lb_addresses: | ||
| {% for tool in ns.lb_tools.keys() %} | ||
| {% for lb_range in network.tools[tool][_ipv.ipvX_ranges] %} | ||
| - {{ lb_range.start }}-{{ lb_range.end }} | ||
| {% set _ = ns.lb_tools[tool].append(lb_range.start) %} | ||
| {% endfor %} | ||
| endpoint_annotations: | ||
| {{ tool }}.universe.tf/address-pool: {{ network.network_name }} | ||
| {{ tool }}.universe.tf/allow-shared-ip: {{ network.network_name }} | ||
| {{ tool }}.universe.tf/loadBalancerIPs: {{ ','.join(ns.lb_tools[tool]) }} | ||
| {% endfor %} | ||
| {% endif %} | ||
| {% endif %} | ||
| prefix-length: {{ network[_ipv.network_vX] | ansible.utils.ipaddr('prefix') }} | ||
| mtu: {{ network.mtu | default(1500) }} | ||
| {% if network.vlan_id is defined %} | ||
| vlan: {{ network.vlan_id }} | ||
| iface: {{ omit if ns.interfaces[network.network_name] is not defined else network.network_name }} | ||
| base_iface: {{ omit if ns.interfaces[network.network_name] is not defined else ns.interfaces[network.network_name] }} | ||
| {% elif network.network_name != "ironic" %} | ||
| iface: {{ omit if ns.interfaces[network.network_name] is not defined else ns.interfaces[network.network_name] }} | ||
| {% else %} | ||
| iface: {{ omit if ns.interfaces[network.network_name] is not defined else network.network_name }} | ||
| {% endif %} | ||
| {% if network.tools.multus is defined and network.network_name == "ctlplane" %} | ||
| net-attach-def: | | ||
| { | ||
| "cniVersion": "0.3.1", | ||
| "name": "{{ network.network_name }}", | ||
| "type": "macvlan", | ||
| "master": "ospbr", | ||
| "ipam": { | ||
| "type": "whereabouts", | ||
| "range": "{{ network[_ipv.network_vX] }}", | ||
| "range_start": "{{ network.tools.multus[_ipv.ipvX_ranges].0.start }}", | ||
| "range_end": "{{ network.tools.multus[_ipv.ipvX_ranges].0.end }}" | ||
| } | ||
| } | ||
| {% endif %} | ||
| {% if network.tools.multus is defined and network.network_name == "ironic" %} | ||
| net-attach-def: | | ||
| { | ||
| "cniVersion": "0.3.1", | ||
| "name": "ironic", | ||
| "type": "bridge", | ||
| "bridge": "ironic", | ||
| "ipam": { | ||
| "type": "whereabouts", | ||
| "range": "{{ network[_ipv.network_vX] }}", | ||
| "range_start": "{{ network.tools.multus[_ipv.ipvX_ranges].0.start }}", | ||
| "range_end": "{{ network.tools.multus[_ipv.ipvX_ranges].0.end }}" | ||
| } | ||
| } | ||
| {% endif %} | ||
| {% if network.tools.multus is defined and network.network_name not in ["ctlplane", "ironic"] %} | ||
| net-attach-def: | | ||
| { | ||
| "cniVersion": "0.3.1", | ||
| "name": "{{ network.network_name }}", | ||
| "type": "macvlan", | ||
| "master": "{{ network.network_name if network.vlan_id is defined else ns.interfaces[network.network_name] }}", | ||
| "ipam": { | ||
| "type": "whereabouts", | ||
| "range": "{{ network[_ipv.network_vX] }}", | ||
| "range_start": "{{ network.tools.multus[_ipv.ipvX_ranges].0.start }}", | ||
| "range_end": "{{ network.tools.multus[_ipv.ipvX_ranges].0.end }}" | ||
| } | ||
| } | ||
| {% endif %} | ||
| {% endfor %} | ||
| dns-resolver: | ||
| config: | ||
| server: | ||
| - "{{ cifmw_networking_env_definition.networks.ctlplane[_ipv.gw_vX] }}" | ||
| search: [] | ||
| options: | ||
| - key: server | ||
| values: | ||
| - {{ cifmw_networking_env_definition.networks.ctlplane[_ipv.gw_vX] }} | ||
| {% for nameserver in cifmw_ci_gen_kustomize_values_nameservers %} | ||
| - key: server | ||
| values: | ||
| - {{ nameserver }} | ||
| {% endfor %} | ||
|
|
||
| # Hardcoding the last IP bit since we don't have support for endpoint_annotations in the networking_mapper output | ||
| rabbitmq: | ||
| endpoint_annotations: | ||
| metallb.universe.tf/address-pool: internalapi | ||
| metallb.universe.tf/loadBalancerIPs: {{ cifmw_networking_env_definition.networks['internalapi'][_ipv.network_vX] | ansible.utils.ipmath(85) }} | ||
| rabbitmq-cell1: | ||
| endpoint_annotations: | ||
| metallb.universe.tf/address-pool: internalapi | ||
| metallb.universe.tf/loadBalancerIPs: {{ cifmw_networking_env_definition.networks['internalapi'][_ipv.network_vX] | ansible.utils.ipmath(86) }} | ||
|
|
||
| lbServiceType: LoadBalancer | ||
| storageClass: {{ cifmw_ci_gen_kustomize_values_storage_class }} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.