-
Notifications
You must be signed in to change notification settings - Fork 0
/
lb.yaml
executable file
·90 lines (80 loc) · 2.31 KB
/
lb.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
heat_template_version: 2013-05-23
description: >
HOT template to deploy two servers and a load balancer
parameters:
key_name:
type: string
description: Name of keypair to assign to servers
image:
type: string
description: Name of image to use for servers
flavor:
type: string
description: Flavor to use for servers
net_id:
type: string
description: ID of Neutron network into which servers get deployed
subnet_id:
type: string
description: ID of Neutron sub network into which servers get deployed
resources:
server1:
type: OS::Nova::Server
properties:
name: Server1
image: { get_param: image }
flavor: { get_param: flavor }
key_name: { get_param: key_name }
networks:
- port: { get_resource: server1_port }
server1_port:
type: OS::Neutron::Port
properties:
network_id: { get_param: net_id }
fixed_ips:
- subnet_id: { get_param: subnet_id }
server2:
type: OS::Nova::Server
properties:
name: Server2
image: { get_param: image }
flavor: { get_param: flavor }
key_name: { get_param: key_name }
networks:
- port: { get_resource: server2_port }
server2_port:
type: OS::Neutron::Port
properties:
network_id: { get_param: net_id }
fixed_ips:
- subnet_id: { get_param: subnet_id }
monitor:
type: OS::Neutron::HealthMonitor
properties:
type: HTTP
delay: 3
max_retries: 5
timeout: 10
pool:
type: OS::Neutron::Pool
properties:
name: mypool
protocol: HTTP
subnet_id: { get_param: subnet_id }
lb_method: ROUND_ROBIN
monitors: [ { get_resource: monitor } ]
vip: {"address": 10.0.0.250, "protocol_port": 80}
mylb:
type: OS::Neutron::LoadBalancer
dependson: server1
properties:
members: [ { get_resource: server1 }, { get_resource: server2 } ]
pool_id: { get_resource: pool }
protocol_port: 80
outputs:
server1_provider_ip:
description: IP address of server1 in provider network
value: { get_attr: [ server1, first_address ] }
server2_provider_ip:
description: IP address of server2 in provider network
value: { get_attr: [ server2, first_address ] }