Skip to content

Commit

Permalink
Migrate from deprecated Neutron LBaaS API to LBaaSv2
Browse files Browse the repository at this point in the history
  • Loading branch information
L3n41c committed Feb 9, 2018
1 parent 54dd01b commit 8d86d0d
Show file tree
Hide file tree
Showing 6 changed files with 103 additions and 14 deletions.
3 changes: 3 additions & 0 deletions loadbalancer_dedicated.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ parameters:
constraints:
- custom_constraint: neutron.subnet

member_count:
type: number

members:
type: comma_delimited_list

Expand Down
3 changes: 3 additions & 0 deletions loadbalancer_external.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ parameters:
constraints:
- custom_constraint: neutron.subnet

member_count:
type: number

members:
type: comma_delimited_list

Expand Down
45 changes: 32 additions & 13 deletions loadbalancer_neutron.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ parameters:
constraints:
- custom_constraint: neutron.subnet

member_count:
type: number

members:
type: comma_delimited_list

Expand Down Expand Up @@ -169,38 +172,54 @@ parameters:

resources:
lb:
type: OS::Neutron::LoadBalancer
type: OS::Neutron::LBaaS::LoadBalancer
properties:
vip_subnet: {get_param: fixed_subnet}

lb_listener:
type: OS::Neutron::LBaaS::Listener
properties:
protocol: HTTPS
protocol_port: 8443
pool_id: {get_resource: lb_pool}
members: {get_param: members}
loadbalancer: {get_resource: lb}

lb_pool:
type: OS::Neutron::Pool
type: OS::Neutron::LBaaS::Pool
properties:
name: lb_pool
description: Load balancer for OpenShift hosts.
protocol: HTTPS
subnet_id: {get_param: fixed_subnet}
lb_method: ROUND_ROBIN
monitors: [{get_resource: lb_monitor}]
vip:
protocol_port: 8443
session_persistence:
type: SOURCE_IP
listener: {get_resource: lb_listener}
lb_algorithm: ROUND_ROBIN
session_persistence:
type: SOURCE_IP

lb_members:
type: OS::Heat::ResourceGroup
properties:
count: {get_param: member_count}
resource_def:
type: loadbalancer_neutron_member.yaml
properties:
addresses: {get_param: members}
index: "%index%"
pool: {get_resource: lb_pool}
protocol_port: 8443
subnet: {get_param: fixed_subnet}

lb_monitor:
type: OS::Neutron::HealthMonitor
type: OS::Neutron::LBaaS::HealthMonitor
properties:
type: TCP
delay: 15
max_retries: 5
timeout: 10
pool: {get_resource: lb_pool}

floating_ip_assoc:
type: OS::Neutron::FloatingIPAssociation
properties:
port_id: {get_attr: [lb_pool, vip, port_id]}
port_id: {get_attr: [lb, vip_port_id]}
floatingip_id: {get_param: floatingip_id}

outputs:
Expand Down
60 changes: 60 additions & 0 deletions loadbalancer_neutron_member.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
heat_template_version: 2016-10-14

description: >
A template which provides a neutron’s LBaaS loadbalancer member
parameters:

addresses:
type: comma_delimited_list

index:
type: number

pool:
type: string
constraints:
- custom_constraint: neutron.lbaas.pool

protocol_port:
type: number
constraints:
- range:
min: 1
max: 65535

subnet:
type: string
constraints:
- custom_constraint: neutron.subnet

weight:
type: number
constraints:
- range:
min: 0
max: 256
default: 1

resources:
lb_member:
type: OS::Neutron::LBaaS::PoolMember
properties:
address: {get_param: [addresses, {get_param: index}]}
pool: {get_param: pool}
protocol_port: {get_param: protocol_port}
subnet: {get_param: subnet}
weight: {get_param: weight}

outputs:
address:
description: The IP address of the pool member
value: {get_attr: [lb_member, address]}

pool_id:
description: The ID of the pool to which the pool member belongs
value: {get_attr: [lb_member, pool_id]}

show:
description: Detailed information about resource
value: {get_attr: [lb_member, show]}
3 changes: 3 additions & 0 deletions loadbalancer_none.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ parameters:
constraints:
- custom_constraint: neutron.subnet

member_count:
type: number

members:
type: comma_delimited_list

Expand Down
3 changes: 2 additions & 1 deletion openshift.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1012,7 +1012,8 @@ resources:
stack_name: {get_param: 'OS::stack_name'}
ansible_public_key: {get_attr: [ansible_keys, public_key]}
fixed_subnet: {get_resource: fixed_subnet}
members: {get_attr: [openshift_masters, host]}
member_count: {get_param: master_count}
members: {get_attr: [openshift_masters, ip_address]}
master_hostname: {get_attr: [openshift_masters, resource.0.hostname]}
floatingip_id: {get_resource: lb_floating_ip}
floatingip: {get_attr: [lb_floating_ip, floating_ip_address]}
Expand Down

0 comments on commit 8d86d0d

Please sign in to comment.