-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathopenstack-nodecellar-example-blueprint.yaml
196 lines (173 loc) · 5.55 KB
/
openstack-nodecellar-example-blueprint.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
tosca_definitions_version: cloudify_dsl_1_0
imports:
- http://www.getcloudify.org/spec/openstack-plugin/1.1/plugin.yaml
- http://www.getcloudify.org/spec/diamond-plugin/1.1/plugin.yaml
- https://raw.githubusercontent.com/cloudify-cosmo/cloudify-nodecellar-example/3.1/types/nodecellar.yaml
- types/haproxy.yaml
inputs:
agent_user:
type: string
default: ubuntu
frontend_image_name:
type: string
default: Ubuntu Server 12.04.5 LTS (amd64 20140927) - Partner Image
frontend_flavor_name:
type: string
default: standard.medium
backend_image_name:
type: string
default: Ubuntu Server 12.04.5 LTS (amd64 20140927) - Partner Image
backend_flavor_name:
type: string
default: standard.medium
backend_app_port:
type: integer
default: 80
node_types:
nodecellar.nodes.MonitoredServer:
derived_from: cloudify.openstack.nodes.Server
properties:
cloudify_agent:
default:
user: { get_input: agent_user }
server:
default:
image_name: { get_input: backend_image_name }
flavor_name: { get_input: backend_flavor_name }
interfaces:
cloudify.interfaces.monitoring_agent:
install:
implementation: diamond.diamond_agent.tasks.install
inputs:
diamond_config:
default:
interval: 1
start: diamond.diamond_agent.tasks.start
stop: diamond.diamond_agent.tasks.stop
uninstall: diamond.diamond_agent.tasks.uninstall
cloudify.interfaces.monitoring:
start:
implementation: diamond.diamond_agent.tasks.add_collectors
inputs:
collectors_config:
default:
CPUCollector: {}
MemoryCollector: {}
LoadAverageCollector: {}
DiskUsageCollector:
config:
devices: x?vd[a-z]+[0-9]*$
NetworkCollector: {}
node_templates:
frontend_floatingip:
type: cloudify.openstack.nodes.FloatingIP
haproxy_frontend_security_group:
type: cloudify.openstack.nodes.SecurityGroup
properties:
security_group:
name: haproxy_frontend_security_group
rules:
- remote_ip_prefix: 0.0.0.0/0
port: { get_property: [ http_in, port ] }
- remote_ip_prefix: 0.0.0.0/0
port: 9000
haproxy_frontend_host:
type: nodecellar.nodes.MonitoredServer
relationships:
- type: cloudify.openstack.server_connected_to_floating_ip
target: frontend_floatingip
- type: cloudify.openstack.server_connected_to_security_group
target: haproxy_frontend_security_group
http_in:
type: haproxy.nodes.Proxy
properties:
default_backend: servers
global_maxconn: 256
mode: http
port: 80
timeout_connect: 5000
timeout_client: 50000
timeout_server: 50000
relationships:
- target: haproxy_frontend_host
type: cloudify.relationships.contained_in
- target: nodejs_host
type: haproxy_connected_to_vm
interfaces:
cloudify.interfaces.monitoring:
start:
implementation: diamond.diamond_agent.tasks.add_collectors
inputs:
collectors_config:
HAProxyCollector:
config:
enabled: True
url: http://127.0.0.1:9000/haproxy_stats;csv
nodecellar_security_group:
type: cloudify.openstack.nodes.SecurityGroup
properties:
security_group:
name: nodecellar_security_group
rules:
- remote_ip_prefix: 0.0.0.0/0
port: { get_property: [ nodecellar, port ] }
nodejs_host:
type: nodecellar.nodes.MonitoredServer
instances:
deploy: 2
relationships:
- target: nodecellar_security_group
type: cloudify.openstack.server_connected_to_security_group
nodejs:
type: nodecellar.nodes.NodeJSServer
relationships:
- type: cloudify.relationships.contained_in
target: nodejs_host
nodecellar:
type: nodecellar.nodes.NodecellarApplicationModule
properties:
port: { get_input: backend_app_port }
relationships:
- type: node_connected_to_mongo
target: mongod
- type: node_contained_in_nodejs
target: nodejs
mongod_host:
type: nodecellar.nodes.MonitoredServer
relationships:
- target: mongod_security_group
type: cloudify.openstack.server_connected_to_security_group
mongod:
type: nodecellar.nodes.MongoDatabase
properties:
port: 27017
interfaces:
cloudify.interfaces.lifecycle:
configure: scripts/mongo/install-pymongo.sh
cloudify.interfaces.monitoring:
start:
implementation: diamond.diamond_agent.tasks.add_collectors
inputs:
collectors_config:
MongoDBCollector:
config:
hosts: "localhost:27017"
relationships:
- type: cloudify.relationships.contained_in
target: mongod_host
mongod_security_group:
type: cloudify.openstack.nodes.SecurityGroup
properties:
security_group:
name: mongod_security_group
rules:
- remote_ip_prefix: 0.0.0.0/0
port: { get_property: [ mongod, port ] }
- remote_ip_prefix: 0.0.0.0/0
port: 28017
outputs:
endpoint:
description: Web application endpoint
value:
ip_address: { get_attribute: [ frontend_floatingip, floating_ip_address ] }
port: { get_input: backend_app_port }