Merge "Moved elastic apps to OS::Neutron::LoadBalancer"

This commit is contained in:
Jenkins 2013-12-04 09:27:28 +00:00 committed by Gerrit Code Review
commit b15e79f351
6 changed files with 64 additions and 42 deletions

View File

@ -3,7 +3,7 @@
"Parameters": {
"KeyName": {
"Description": "Key Pair name for Load Balancer",
"Description": "Key Pair",
"Type": "String",
"Default": "$keyName"
}

View File

@ -1,22 +1,39 @@
{
"Resources" : {
"$lbName" : {
"Type" : "AWS::ElasticLoadBalancing::LoadBalancer",
"Properties" : {
"AvailabilityZones" : { "Fn::GetAZs" : "" },
"Instances" : [{"Ref": "$instanceName"}],
"Listeners" : [ {
"LoadBalancerPort" : "$lbPort",
"InstancePort" : "80",
"Protocol" : "HTTP"
}]
}
"Resources": {
"${lbName}-HealthMonitor": {
"Type": "OS::Neutron::HealthMonitor",
"Properties": {
"type": "HTTP",
"delay": 3,
"max_retries": 3,
"timeout": 10,
"http_method": "GET",
"expected_codes": "200",
"url_path": "/"
}
},
"Outputs": {
"LoadBalancerIP": {
"Value": { "Fn::GetAtt": [ "$lbName", "DNSName" ] },
"Description": ""
"${lbName}-Pool": {
"Type": "OS::Neutron::Pool",
"Properties": {
"protocol": "HTTP",
"subnet_id": {"Ref": "subnet"},
"lb_method": "ROUND_ROBIN",
"name": "${lbName}-Pool",
"vip": {
"name": "${lbName}-Pool-VIP",
"address": "$lbIp",
"protocol_port": "$lbPort"
},
"monitors": [{"Ref": "${lbName}-HealthMonitor"}]
}
},
"${lbName}-LoadBalancer": {
"Type": "OS::Neutron::LoadBalancer",
"Properties": {
"pool_id": {"Ref": "${lbName}-Pool"},
"protocol_port": "$lbPort",
"members": [{"Ref": "$instanceName"}]
}
}
}
}

View File

@ -1,13 +1,7 @@
{
"AWSTemplateFormatVersion": "2010-09-09",
"Parameters": {
"KeyName": {
"Description": "Key Pair name for Load Balancer",
"Type": "String",
"Default": "murano-lb-key"
}
},
"Parameters": {},
"Resources": {
"$instanceName": {

View File

@ -66,6 +66,11 @@ forms:
maxValue: 100
initial: 2
helpText: Enter an integer value between 2 and 100
- name: loadBalancerIp
type: clusterip
label: Load Balancer VIP
description: Specify IP number where Load Balancer will be running
helpText: Enter an free IP address from the subnet where instances will be created
- name: loadBalancerPort
type: integer
label: Load Balancer port

View File

@ -54,6 +54,11 @@ forms:
label: Instance Count
description: Several instances with IIS Service can be created at one time.
helpText: Enter an integer value between 2 and 100
- name: loadBalancerIp
type: clusterip
label: Load Balancer VIP
description: Specify IP number where Load Balancer will be running
helpText: Enter an free IP address from the subnet where instances will be created
- name: loadBalancerPort
type: integer
label: Load Balancer port

View File

@ -53,13 +53,14 @@
<parameter name="mappings">
<map>
<mapping name="instanceName"><select path="state.hostname"/></mapping>
<mapping name="lbIp"><select path="::loadBalancerIp"/></mapping>
<mapping name="lbPort"><select path="::loadBalancerPort"/></mapping>
<mapping name="lbName"><select path="::name"/></mapping>
</map>
</parameter>
<success>
<set path="temp.registeredWithLB"><true/></set>
<set path="::uri">http://<select source="outputs" path="LoadBalancerIP"/>:<select path="::loadBalancerPort"/></set>
<set path="::uri">http://<select path="::loadBalancerIp"/>:<select path="::loadBalancerPort"/></set>
</success>
<failure>
<report entity="unit" level="error">