| heat_template_version: 2015-04-30 |
| |
| description: | |
| Template which tests Neutron load balancing requests to members of |
| Heat AutoScalingGroup. |
| Instances must be running some webserver on a given app_port |
| producing HTTP response that is different between servers |
| but stable over time for given server. |
| |
| parameters: |
| flavor: |
| type: string |
| image: |
| type: string |
| net: |
| type: string |
| subnet: |
| type: string |
| public_net: |
| type: string |
| app_port: |
| type: number |
| default: 8080 |
| lb_port: |
| type: number |
| default: 80 |
| timeout: |
| type: number |
| default: 600 |
| |
| resources: |
| |
| sec_group: |
| type: OS::Neutron::SecurityGroup |
| properties: |
| rules: |
| - remote_ip_prefix: 0.0.0.0/0 |
| protocol: tcp |
| port_range_min: { get_param: app_port } |
| port_range_max: { get_param: app_port } |
| |
| asg: |
| type: OS::Heat::AutoScalingGroup |
| properties: |
| desired_capacity: 1 |
| max_size: 2 |
| min_size: 1 |
| resource: |
| type: OS::Test::NeutronAppServer |
| properties: |
| image: { get_param: image } |
| flavor: { get_param: flavor } |
| net: { get_param: net} |
| sec_group: { get_resource: sec_group } |
| app_port: { get_param: app_port } |
| pool_id: { get_resource: pool } |
| timeout: { get_param: timeout } |
| |
| scale_up: |
| type: OS::Heat::ScalingPolicy |
| properties: |
| adjustment_type: change_in_capacity |
| auto_scaling_group_id: { get_resource: asg } |
| scaling_adjustment: 1 |
| |
| scale_down: |
| type: OS::Heat::ScalingPolicy |
| properties: |
| adjustment_type: change_in_capacity |
| auto_scaling_group_id: { get_resource: asg } |
| scaling_adjustment: -1 |
| |
| health_monitor: |
| type: OS::Neutron::HealthMonitor |
| properties: |
| delay: 3 |
| type: HTTP |
| timeout: 3 |
| max_retries: 3 |
| |
| pool: |
| type: OS::Neutron::Pool |
| properties: |
| lb_method: ROUND_ROBIN |
| protocol: HTTP |
| subnet: { get_param: subnet } |
| monitors: |
| - { get_resource: health_monitor } |
| vip: |
| protocol_port: { get_param: lb_port } |
| |
| floating_ip: |
| type: OS::Neutron::FloatingIP |
| properties: |
| floating_network: { get_param: public_net } |
| port_id: |
| { get_attr: [pool, vip, 'port_id'] } |
| |
| loadbalancer: |
| type: OS::Neutron::LoadBalancer |
| properties: |
| pool_id: { get_resource: pool } |
| protocol_port: { get_param: app_port } |
| |
| outputs: |
| lburl: |
| description: URL of the loadbalanced app |
| value: |
| str_replace: |
| template: http://IP_ADDRESS:PORT |
| params: |
| IP_ADDRESS: { get_attr: [ floating_ip, floating_ip_address ] } |
| PORT: { get_param: lb_port } |