-
Notifications
You must be signed in to change notification settings - Fork 46
/
Copy pathvcloud-blueprint.yaml
209 lines (174 loc) · 6.15 KB
/
vcloud-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
197
198
199
200
201
202
203
204
205
206
207
208
209
tosca_definitions_version: cloudify_dsl_1_4
description: >
This Blueprint installs the nodecellar application
on an vcloud environment.
imports:
- http://www.getcloudify.org/spec/cloudify/7.1.0.dev1/types.yaml
- http://www.getcloudify.org/spec/tosca-vcloud-plugin/1.3.1/plugin.yaml
- http://www.getcloudify.org/spec/diamond-plugin/1.3.17/plugin.yaml
- types/nodecellar.yaml
- types/vcloud-types.yaml
#####################################################################################
# inputs section allows the user to use same
# blueprint for creating different deployments, each one
# with its own parameters.
# to specify deployment inputs run:
# - cfy deployments create -b <blueprint_id> <deployment_id> -i inputs.json
#####################################################################################
inputs:
template:
type: string
agent_user:
description: >
User for connecting to agent VM's
type: string
default: ubuntu
agent_public_key:
type: string
catalog:
type: string
server_cpu:
default: 2
description: >
cpu count for each server
server_memory:
default: 4096
description: >
memory amount for each server
edge_gateway:
type: string
default: gateway
description: >
For 'ondemand' service type, the value of edge_gateway
is always 'gateway'
management_network_name:
description: >
Name of the existing network that's being used for Cloudify management
type: string
node_templates:
nodecellar:
type: nodecellar.nodes.NodecellarApplicationModule
properties:
port: 8080
relationships:
################################
# Setting the mongo connection
################################
- type: node_connected_to_mongo
target: mongod
################################
# Setting the nodejs connection
################################
- type: node_contained_in_nodejs
target: nodejs
nodejs:
type: nodecellar.nodes.NodeJSServer
relationships:
- type: cloudify.relationships.contained_in
target: nodejs_host
mongod:
type: nodecellar.nodes.MongoDatabase
properties:
port: 27017
interfaces:
cloudify.interfaces.lifecycle:
###########################################################
# The MongoDBCollector depends on a python library called
# pymongo. We install this library in the 'configure'
# lifecycle hook of this node.
###########################################################
configure: scripts/mongo/install-pymongo.sh
###########################################################
# Notice that this node defines an additional collector
# to collect data on the MongoDB.
###########################################################
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
nodejs_host:
type: nodecellar.nodes.MonitoredServer
relationships:
###########################################################
# Attaching a floating ip to the nodejs host
###########################################################
- target: nodecellar_ip
type: cloudify.vcloud.server_connected_to_floating_ip
- target: ssh_keypair
type: cloudify.vcloud.server_connected_to_keypair
- target: nodejs_security_group
type: cloudify.vcloud.server_connected_to_security_group
mongod_host:
type: nodecellar.nodes.MonitoredServer
relationships:
- target: ssh_keypair
type: cloudify.vcloud.server_connected_to_keypair
- target: mongod_security_group
type: cloudify.vcloud.server_connected_to_security_group
ssh_keypair:
type: cloudify.vcloud.nodes.KeyPair
properties:
public_key:
user: { get_input: agent_user }
key: { get_input: agent_public_key }
nodejs_security_group:
type: cloudify.vcloud.nodes.SecurityGroup
properties:
security_group:
name: nodejsvcloud_security_group
edge_gateway: { get_input: edge_gateway }
rules:
- source: external
destination: internal
destination_port: 8080
action: allow
description: >
http to nodejs node
protocol: TCP
- source: host
destination: any
action: allow
description: >
backward network connection for nodejs updates
protocol: any
mongod_security_group:
type: cloudify.vcloud.nodes.SecurityGroup
properties:
security_group:
name: mongodvcloud_security_group
edge_gateway: { get_input: edge_gateway }
rules:
- source: host
destination: any
action: allow
description: >
backward network connection for mongod updates
protocol: any
###########################################################
# A floating ip to be attached to the nodejs host, since
# eventually we want to be able to access it
# from any machine, on any network.
###########################################################
nodecellar_ip:
type: cloudify.vcloud.nodes.FloatingIP
properties:
floatingip:
edge_gateway: { get_input: edge_gateway }
###########################################################
# This outputs section exposes the application endpoint.
# You can access it by running:
# - cfy deployments -d <deployment_id> outputs
###########################################################
outputs:
endpoint:
description: Web application endpoint
value:
ip_address: { get_attribute: [ nodecellar_ip, public_ip ] }
port: { get_property: [ nodecellar, port ] }