Skip to content

Commit 087ee63

Browse files
authored
Merge pull request stackhpc#22 from stackhpc/router_ports
Add support for ports configured for hosts acting as routers.
2 parents ab1ec52 + f332c23 commit 087ee63

File tree

8 files changed

+52
-2
lines changed

8 files changed

+52
-2
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,24 @@ Heat stack.
104104
This is the default.
105105
* `Cluster::NodeNet1WithFIP`: A single network with floating IP allocated
106106
and associated with the port.
107+
* `Cluster::NodeNet1WithPreallocatedFIP`: A single network with floating IP
108+
(taken from a pre-allocated and supplied list) and associated with the port.
107109
* `Cluster::NodeNet2`: Two network interfaces. The first two networks listed
108110
in `cluster_net` are used.
109111
* `Cluster::NodeNet3`: Three network interfaces. The first three networks listed
110112
in `cluster_net` are used.
111113

114+
* `router_networks`: An optional list of IP subnet CIDRs that should be added as
115+
permitted networks. This is needed if a port is associated with a gateway node that
116+
is performing IP routing between subnets. These should match the format of `allowed_address_pairs`
117+
[https://docs.openstack.org/heat/rocky/template_guide/openstack.html#OS::Neutron::Port-prop-allowed_address_pairs here].
118+
A simple, permissive configuration for `router_networks` would be:
119+
120+
```
121+
router_networks:
122+
- ip_address: "0.0.0.0/0"
123+
```
124+
112125
`cluster_inventory`: After deployment, an inventory file is generated,
113126
which can be used in subsequent Ansible-driven configuration.
114127

files/resources/cluster-group.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ parameters:
4242
- "Cluster::NodeNet"
4343
- "Cluster::NodeNet1"
4444
- "Cluster::NodeNet1WithFIP"
45+
- "Cluster::NodeNet1WithPreallocatedFIP"
4546
- "Cluster::NodeNet2"
4647
- "Cluster::NodeNet3"
4748
group_idx:
@@ -75,6 +76,11 @@ conditions:
7576
expression: $.data.cluster_group.containsKey('nodenet_fips')
7677
data:
7778
cluster_group: { get_param: [cluster_groups, {get_param: group_idx}] }
79+
router_networks_set:
80+
yaql:
81+
expression: $.data.cluster_group.containsKey('router_networks')
82+
data:
83+
cluster_group: { get_param: [cluster_groups, {get_param: group_idx}] }
7884

7985
resources:
8086
port_group:
@@ -94,6 +100,11 @@ resources:
94100
- nodenet_fips_set
95101
- { get_param: [cluster_groups, {get_param: group_idx}, nodenet_fips ] }
96102
- []
103+
router_networks:
104+
if:
105+
- router_networks_set
106+
- { get_param: [cluster_groups, {get_param: group_idx}, router_networks ] }
107+
- []
97108
node_idx: "%index%"
98109

99110
node_group:

files/resources/nodenet-1.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ parameters:
1616
type: json
1717
label: List of UUIDs of prealloacted floating IPs
1818
default: []
19+
router_networks:
20+
type: json
21+
label: Permit host to route IP traffic from specific networks through this port
22+
default: []
1923

2024
conditions:
2125
security_groups_set:

files/resources/nodenet-2-w-fip.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ parameters:
1616
type: json
1717
label: List of UUIDs of prealloacted floating IPs
1818
default: []
19+
router_networks:
20+
type: json
21+
label: Permit host to route IP traffic from specific networks through this port
22+
default: []
1923

2024
conditions:
2125
security_groups_set:

files/resources/nodenet-2.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ parameters:
1919
type: json
2020
label: List of UUIDs of prealloacted floating IPs
2121
default: []
22+
router_networks:
23+
type: json
24+
label: Permit host to route IP traffic from specific networks through this port
25+
default: []
2226

2327
conditions:
2428
security_groups_set:

files/resources/nodenet-3.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ parameters:
1919
type: json
2020
label: List of UUIDs of prealloacted floating IPs
2121
default: []
22+
router_networks:
23+
type: json
24+
label: Permit host to route IP traffic from specific networks through this port
25+
default: []
2226

2327
conditions:
2428
security_groups_set:

files/resources/nodenet-w-fip.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
heat_template_version: pike
2+
heat_template_version: queens
33

44
description: >
55
Heat stack template for a stack containing one Neutron port which is on
@@ -16,6 +16,10 @@ parameters:
1616
type: json
1717
label: List of UUIDs of prealloacted floating IPs
1818
default: []
19+
router_networks:
20+
type: json
21+
label: Permit host to route IP traffic from specific networks through this port
22+
default: []
1923

2024
conditions:
2125
security_groups_set:
@@ -34,6 +38,7 @@ resources:
3438
- security_groups_set
3539
- { get_param: [ cluster_net, 0, security_groups ] }
3640
- []
41+
allowed_address_pairs: { get_param: router_networks }
3742
fixed_ips:
3843
- subnet_id: { get_param: [ cluster_net, 0, subnet ] }
3944

files/resources/nodenet-w-prealloc-fip.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
heat_template_version: pike
2+
heat_template_version: queens
33

44
description: >
55
Heat stack template for a stack containing one Neutron port which is on
@@ -16,6 +16,10 @@ parameters:
1616
cluster_net:
1717
type: json
1818
label: Network names and subnets to which the nodes should be attached
19+
router_networks:
20+
type: json
21+
label: Permit host to route IP traffic from specific networks through this port
22+
default: []
1923

2024
conditions:
2125
security_groups_set:
@@ -34,6 +38,7 @@ resources:
3438
- security_groups_set
3539
- { get_param: [ cluster_net, 0, security_groups ] }
3640
- []
41+
allowed_address_pairs: { get_param: router_networks }
3742
fixed_ips:
3843
- subnet_id: { get_param: [ cluster_net, 0, subnet ] }
3944

0 commit comments

Comments
 (0)