Skip to content

Commit 1faee45

Browse files
committed
Add load balancer for Neutron LBaaSv2 API
1 parent 54dd01b commit 1faee45

7 files changed

+343
-0
lines changed

loadbalancer_dedicated.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,15 @@ parameters:
108108
constraints:
109109
- custom_constraint: neutron.subnet
110110

111+
member_count:
112+
type: number
113+
111114
members:
112115
type: comma_delimited_list
113116

117+
member_ips:
118+
type: comma_delimited_list
119+
114120
master_hostname:
115121
type: string
116122

loadbalancer_external.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,15 @@ parameters:
110110
constraints:
111111
- custom_constraint: neutron.subnet
112112

113+
member_count:
114+
type: number
115+
113116
members:
114117
type: comma_delimited_list
115118

119+
member_ips:
120+
type: comma_delimited_list
121+
116122
master_hostname:
117123
type: string
118124

loadbalancer_neutron.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,15 @@ parameters:
109109
constraints:
110110
- custom_constraint: neutron.subnet
111111

112+
member_count:
113+
type: number
114+
112115
members:
113116
type: comma_delimited_list
114117

118+
member_ips:
119+
type: comma_delimited_list
120+
115121
master_hostname:
116122
type: string
117123

loadbalancer_neutron_v2.yaml

Lines changed: 257 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,257 @@
1+
heat_template_version: 2016-10-14
2+
3+
description: >
4+
A template which provides a creates a loadbalancer using neutron's LBaaS.
5+
6+
parameters:
7+
8+
# What version of OpenShift Container Platform to install
9+
# This value is used to select the RPM repo for the OCP release to install
10+
ocp_version:
11+
type: string
12+
description: >
13+
The version of OpenShift Container Platform to deploy
14+
15+
key_name:
16+
description: >
17+
A pre-submitted SSH key to access the VM hosts
18+
type: string
19+
constraints:
20+
- custom_constraint: nova.keypair
21+
22+
image:
23+
type: string
24+
default: ''
25+
26+
flavor:
27+
description: >
28+
Define the hardware characteristics for the VMs: CPU, Memory, base disk
29+
type: string
30+
constraints:
31+
- custom_constraint: nova.flavor
32+
33+
hostname:
34+
description: >
35+
The load balancer hostname portion of the FQDN
36+
type: string
37+
constraints:
38+
- allowed_pattern: '[a-z0-9\-\.]*'
39+
description: Hostname must contain only characters [a-z0-9\-\.].
40+
41+
stack_name:
42+
description: Top level stack name.
43+
type: string
44+
45+
domain_name:
46+
description: >
47+
All VMs will be placed in this domain
48+
type: string
49+
50+
app_subdomain:
51+
type: string
52+
53+
rhn_username:
54+
description: >
55+
A valid user with entitlements to RHEL and OpenShift software repos
56+
type: string
57+
58+
rhn_password:
59+
description: >
60+
The password for the RHN user
61+
type: string
62+
hidden: true
63+
64+
# Red Hat satellite subscription parameters
65+
sat6_hostname:
66+
type: string
67+
description: >
68+
The hostname of the Satellite 6 server which will provide software updates
69+
default: ''
70+
71+
sat6_organization:
72+
type: string
73+
description: >
74+
An organization string provided by Sat6 to group subscriptions
75+
default: ''
76+
77+
sat6_activationkey:
78+
type: string
79+
description: >
80+
An activation key string provided by Sat6 to enable subscriptions
81+
82+
rhn_pool:
83+
description: >
84+
A subscription pool containing the RHEL and OpenShift software repos
85+
OPTIONAL
86+
type: string
87+
hidden: true
88+
89+
extra_rhn_pools:
90+
type: comma_delimited_list
91+
description: List of rhn pools which will be installed on each node.
92+
default: ''
93+
94+
ssh_user:
95+
description: >
96+
The user for SSH access to the VM hosts
97+
type: string
98+
99+
ansible_public_key:
100+
description: >
101+
The SSH public key that Ansible will use to access master and node hosts
102+
This will be placed on each VM host in /root/.ssh/authorized_keys
103+
type: string
104+
105+
fixed_subnet:
106+
description: >
107+
The name or ID of the internal IPv4 space
108+
type: string
109+
constraints:
110+
- custom_constraint: neutron.subnet
111+
112+
member_count:
113+
type: number
114+
115+
members:
116+
type: comma_delimited_list
117+
118+
member_ips:
119+
type: comma_delimited_list
120+
121+
master_hostname:
122+
type: string
123+
124+
floatingip_id:
125+
type: string
126+
127+
floatingip:
128+
type: string
129+
130+
fixed_network:
131+
description: >
132+
The name or ID of the internal network
133+
type: string
134+
constraints:
135+
- custom_constraint: neutron.network
136+
137+
fixed_subnet:
138+
description: >
139+
The name or ID of the internal IPv4 space
140+
type: string
141+
constraints:
142+
- custom_constraint: neutron.subnet
143+
144+
extra_repository_urls:
145+
type: comma_delimited_list
146+
description: List of repository URLs which will be installed on each node.
147+
default: ''
148+
149+
extra_docker_repository_urls:
150+
type: comma_delimited_list
151+
description: List of docker repository URLs which will be installed on each node, if a repo is insecure use '#insecure' suffix.
152+
default: ''
153+
154+
stack_name:
155+
type: string
156+
default: ''
157+
158+
bastion_node:
159+
type: string
160+
description: >
161+
The name or ID of the bastion instance.
162+
default: ''
163+
164+
dns_servers:
165+
type: comma_delimited_list
166+
description: address of dns nameservers reachable in your environment
167+
168+
dns_update_key:
169+
type: string
170+
hidden: true
171+
172+
ca_cert:
173+
type: string
174+
description: Certificate Authority Certificate to be added to trust chain
175+
176+
resources:
177+
lb:
178+
type: OS::Neutron::LBaaS::LoadBalancer
179+
properties:
180+
vip_subnet: {get_param: fixed_subnet}
181+
182+
lb_listener:
183+
type: OS::Neutron::LBaaS::Listener
184+
properties:
185+
protocol: HTTPS
186+
protocol_port: 8443
187+
loadbalancer: {get_resource: lb}
188+
189+
lb_pool:
190+
type: OS::Neutron::LBaaS::Pool
191+
properties:
192+
name: lb_pool
193+
description: Load balancer for OpenShift hosts.
194+
protocol: HTTPS
195+
listener: {get_resource: lb_listener}
196+
lb_algorithm: ROUND_ROBIN
197+
session_persistence:
198+
type: SOURCE_IP
199+
200+
lb_members:
201+
type: OS::Heat::ResourceGroup
202+
properties:
203+
count: {get_param: member_count}
204+
resource_def:
205+
type: loadbalancer_neutron_v2_member.yaml
206+
properties:
207+
addresses: {get_param: member_ips}
208+
index: "%index%"
209+
pool: {get_resource: lb_pool}
210+
protocol_port: 8443
211+
subnet: {get_param: fixed_subnet}
212+
213+
lb_monitor:
214+
type: OS::Neutron::LBaaS::HealthMonitor
215+
properties:
216+
type: TCP
217+
delay: 15
218+
max_retries: 5
219+
timeout: 10
220+
pool: {get_resource: lb_pool}
221+
222+
floating_ip_assoc:
223+
type: OS::Neutron::FloatingIPAssociation
224+
properties:
225+
port_id: {get_attr: [lb, vip_port_id]}
226+
floatingip_id: {get_param: floatingip_id}
227+
228+
outputs:
229+
console_url:
230+
description: URL of the OpenShift web console
231+
value:
232+
str_replace:
233+
template: "https://%stack_name%-%hostname%.%domainname%:8443/console/"
234+
params:
235+
'%stack_name%': {get_param: stack_name}
236+
'%hostname%': {get_param: hostname}
237+
'%domainname%': {get_param: domain_name}
238+
239+
api_url:
240+
description: URL entrypoint to the OpenShift API
241+
value:
242+
str_replace:
243+
template: "https://%stack_name%-%hostname%.%domainname%:8443/"
244+
params:
245+
'%stack_name%': {get_param: stack_name}
246+
'%hostname%': {get_param: hostname}
247+
'%domainname%': {get_param: domain_name}
248+
249+
hostname:
250+
description: Loadbalancer hostname
251+
value:
252+
str_replace:
253+
template: "%stack_name%-%hostname%.%domainname%"
254+
params:
255+
'%stack_name%': {get_param: stack_name}
256+
'%hostname%': {get_param: hostname}
257+
'%domainname%': {get_param: domain_name}

loadbalancer_neutron_v2_member.yaml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
heat_template_version: 2016-10-14
2+
3+
description: >
4+
A template which provides a neutron’s LBaaS loadbalancer member
5+
6+
parameters:
7+
8+
addresses:
9+
type: comma_delimited_list
10+
11+
index:
12+
type: number
13+
14+
pool:
15+
type: string
16+
constraints:
17+
- custom_constraint: neutron.lbaas.pool
18+
19+
protocol_port:
20+
type: number
21+
constraints:
22+
- range:
23+
min: 1
24+
max: 65535
25+
26+
subnet:
27+
type: string
28+
constraints:
29+
- custom_constraint: neutron.subnet
30+
31+
weight:
32+
type: number
33+
constraints:
34+
- range:
35+
min: 0
36+
max: 256
37+
default: 1
38+
39+
resources:
40+
lb_member:
41+
type: OS::Neutron::LBaaS::PoolMember
42+
properties:
43+
address: {get_param: [addresses, {get_param: index}]}
44+
pool: {get_param: pool}
45+
protocol_port: {get_param: protocol_port}
46+
subnet: {get_param: subnet}
47+
weight: {get_param: weight}
48+
49+
outputs:
50+
address:
51+
description: The IP address of the pool member
52+
value: {get_attr: [lb_member, address]}
53+
54+
pool_id:
55+
description: The ID of the pool to which the pool member belongs
56+
value: {get_attr: [lb_member, pool_id]}
57+
58+
show:
59+
description: Detailed information about resource
60+
value: {get_attr: [lb_member, show]}

loadbalancer_none.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,15 @@ parameters:
106106
constraints:
107107
- custom_constraint: neutron.subnet
108108

109+
member_count:
110+
type: number
111+
109112
members:
110113
type: comma_delimited_list
111114

115+
member_ips:
116+
type: comma_delimited_list
117+
112118
master_hostname:
113119
type: string
114120

openshift.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,7 +1012,9 @@ resources:
10121012
stack_name: {get_param: 'OS::stack_name'}
10131013
ansible_public_key: {get_attr: [ansible_keys, public_key]}
10141014
fixed_subnet: {get_resource: fixed_subnet}
1015+
member_count: {get_param: master_count}
10151016
members: {get_attr: [openshift_masters, host]}
1017+
member_ips: {get_attr: [openshift_masters, ip_address]}
10161018
master_hostname: {get_attr: [openshift_masters, resource.0.hostname]}
10171019
floatingip_id: {get_resource: lb_floating_ip}
10181020
floatingip: {get_attr: [lb_floating_ip, floating_ip_address]}

0 commit comments

Comments
 (0)