diff --git a/loadbalancer_dedicated.yaml b/loadbalancer_dedicated.yaml index 83f1e80..c4387bc 100644 --- a/loadbalancer_dedicated.yaml +++ b/loadbalancer_dedicated.yaml @@ -108,6 +108,9 @@ parameters: constraints: - custom_constraint: neutron.subnet + member_count: + type: number + members: type: comma_delimited_list diff --git a/loadbalancer_external.yaml b/loadbalancer_external.yaml index 20c19ea..c752afb 100644 --- a/loadbalancer_external.yaml +++ b/loadbalancer_external.yaml @@ -110,6 +110,9 @@ parameters: constraints: - custom_constraint: neutron.subnet + member_count: + type: number + members: type: comma_delimited_list diff --git a/loadbalancer_neutron.yaml b/loadbalancer_neutron.yaml index 068f4b9..caae732 100644 --- a/loadbalancer_neutron.yaml +++ b/loadbalancer_neutron.yaml @@ -109,6 +109,9 @@ parameters: constraints: - custom_constraint: neutron.subnet + member_count: + type: number + members: type: comma_delimited_list @@ -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: diff --git a/loadbalancer_neutron_member.yaml b/loadbalancer_neutron_member.yaml new file mode 100644 index 0000000..6afbe48 --- /dev/null +++ b/loadbalancer_neutron_member.yaml @@ -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]} diff --git a/loadbalancer_none.yaml b/loadbalancer_none.yaml index dec5d47..f2d2c5c 100644 --- a/loadbalancer_none.yaml +++ b/loadbalancer_none.yaml @@ -106,6 +106,9 @@ parameters: constraints: - custom_constraint: neutron.subnet + member_count: + type: number + members: type: comma_delimited_list diff --git a/openshift.yaml b/openshift.yaml index ffba279..324a0f9 100644 --- a/openshift.yaml +++ b/openshift.yaml @@ -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]}