Skip to content

Commit 9f534cd

Browse files
authored
Merge pull request #2620 from rackerlabs/ironic-tbn-configmap-generator
feat(ironic): generate TBN ConfigMap from a plain file and default portgroup mode to LACP
2 parents 40fd689 + 6d04502 commit 9f534cd

4 files changed

Lines changed: 50 additions & 69 deletions

File tree

‎components/ironic/cm-trait-based-networking.yaml‎

Lines changed: 0 additions & 67 deletions
This file was deleted.

‎components/ironic/kustomization.yaml‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ resources:
77
- ironic-rabbitmq-queue.yaml
88
- dnsmasq-pvc.yaml
99
- dnsmasq-ss.yaml
10-
- cm-trait-based-networking.yaml
1110
- ironic-ks-user-baremetal.yaml
1211
# less than ideal addition but necessary so that we can have the ironic.conf.d loading
1312
# working due to the way the chart hardcodes the config-file parameter which then
@@ -20,6 +19,12 @@ resources:
2019
- pr-resource-availability.yaml
2120

2221
configMapGenerator:
22+
- name: ironic-trait-based-networking
23+
files:
24+
- trait_based_networking.yaml
25+
options:
26+
# The conductor's Helm values also reference this ConfigMap by name.
27+
disableNameSuffixHash: true
2328
- name: ironic-oidc-cert-fetch
2429
files:
2530
- refresh-oidc-cert.py
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Trait Based Networking (TBN) config
2+
3+
# Match each parent VIF's role tag to its NIC category.
4+
CUSTOM_NETDEV_ROLE_ATTACH:
5+
order: 1
6+
actions:
7+
- action: attach_port
8+
filter: port.category == 'outside' && vif.tags == 'outside'
9+
max_count: 1
10+
- action: attach_port
11+
filter: port.category == 'inside' && vif.tags == 'inside'
12+
max_count: 1
13+
14+
# Attaches a single category=storage port for a storage VIF. Single-port
15+
# only for now (A/B grouping is deferred). Require it on a flavor with:
16+
# openstack flavor set --property trait:CUSTOM_STORAGE_SWITCH=required <flavor>
17+
CUSTOM_STORAGE_SWITCH:
18+
order: 1
19+
actions:
20+
- action: attach_port
21+
filter: port.category == 'storage' && network.tags == 'storage'
22+
max_count: 1
23+
24+
# Default Trait Based Networking (TBN) config.
25+
# category=network ports auto-attach first attempting any static portgroups
26+
# then they attempt to bond (portgroup) two ports together and lastly
27+
# fallback to attaching just a single port.
28+
CUSTOM_DEFAULT_TBN_TRAIT:
29+
actions:
30+
- action: attach_portgroup
31+
filter: port.is_portgroup && port.category == 'network'
32+
max_count: 1
33+
# Group 2 free ports with category=network into a new dynamic portgroup,
34+
# then attach that portgroup to the network being requested.
35+
- action: group_and_attach_ports
36+
filter: port.category == 'network' && vif.tags == 'bond-lacp'
37+
min_count: 2
38+
max_count: 2
39+
- action: attach_port
40+
filter: port.category == 'network'
41+
max_count: 1

‎components/ironic/values.yaml‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ conf:
8484
enabled_power_interfaces: redfish,idrac-redfish,fake
8585
enabled_raid_interfaces: redfish,idrac-redfish,agent,no-raid
8686
enabled_vendor_interfaces: redfish,idrac-redfish,no-vendor
87+
# default bonding mode for portgroups (LACP)
88+
default_portgroup_mode: 802.3ad
8789
# the service account belongs to the service project but our nodes
8890
# will live in the infra domain in the baremetal project so the
8991
# service account needs to have permissions outside of just the
@@ -105,7 +107,7 @@ conf:
105107
sync_power_state_interval: 300
106108
sync_power_state_workers: 20
107109
# Trait Based Networking (TBN): dynamically portgroup category=network
108-
# ports at vif_attach time. See trait-based-networking-cm.yaml for the
110+
# ports at vif_attach time. See trait_based_networking.yaml for the
109111
# trait definitions.
110112
enable_trait_based_networking: true
111113
trait_based_networking_config_file: /etc/ironic/trait-based-networking/trait_based_networking.yaml

0 commit comments

Comments
 (0)