-
Notifications
You must be signed in to change notification settings - Fork 46
/
Copy pathcloudstack-blueprint.yaml
223 lines (177 loc) · 7.3 KB
/
cloudstack-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
210
211
212
213
214
215
216
217
218
219
220
221
222
tosca_definitions_version: cloudify_dsl_1_4
imports:
- http://www.getcloudify.org/spec/cloudify/7.1.0.dev1/types.yaml
- http://www.getcloudify.org/spec/cloudstack-plugin/1.3.1/plugin.yaml
- http://www.getcloudify.org/spec/diamond-plugin/1.3.17/plugin.yaml
- types/nodecellar.yaml
- types/cloudstack-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:
image:
description: >
Image to be used when launching application VMs
size:
description: >
The image size of the application VMs
agent_user:
description: >
User for connecting to application VMs
cloudstack_zone:
description: >
The CloudStack zone the application will be installed in
cloudstack_network_service_offering:
description: >
The CloudStack serviceoffering of the application network created by the blueprint
management_network_resource_id:
description: >
The name of the cloudify management network created during the manager bootstrap process
nodecellar_network_resource_id:
description: >
The name of the dedicated application network to be created.
default: nodecellar_network
node_templates:
nodecellar:
type: nodecellar.nodes.NodecellarApplicationModule
relationships:
################################
# Setting the mongo connection
################################
- type: node_connected_to_mongo
target: mongod
################################
# Setting the nodejs connection
################################
- type: node_contained_in_nodejs
target: nodejs
mongod:
type: nodecellar.nodes.MonitoredMongoDatabase
relationships:
- type: cloudify.relationships.contained_in
target: mongod_host
nodejs:
type: nodecellar.nodes.NodeJSServer
relationships:
- type: cloudify.relationships.contained_in
target: nodejs_host
mongod_host:
type: nodecellar.nodes.MonitoredServer
relationships:
###########################################################
# We need the network to be created before the VM, since
# the VM will attempt to connect to all connected
# network nodes.
###########################################################
- type: cloudify.relationships.depends_on
target: nodecellar_network
###########################################################
# We need this relationship in order to retrieve the
# management network id when creating agent VM's
###########################################################
- type: cloudify.relationships.connected_to
target: management_network
nodejs_host:
type: nodecellar.nodes.MonitoredServer
properties:
portmaps:
- protocol: TCP
private_port: { get_property: [ nodecellar, port ] }
private_end_port: { get_property: [ nodecellar, port ] }
public_port: { get_property: [ nodecellar, port ] }
public_end_port: { get_property: [ nodecellar, port ] }
open_firewall: True
- protocol: TCP
private_port: 8081
private_end_port: 8081
public_port: 8081
public_end_port: 8081
open_firewall: False
relationships:
###########################################################
# We need the network to be created before the VM, since
# the VM will attempt to connect to all connected
# network nodes.
###########################################################
- type: cloudify.relationships.connected_to
target: nodecellar_network
###########################################################
# We need this relationship in order to retrieve the
# management network id when creating agent VM's
###########################################################
- type: cloudify.relationships.connected_to
target: management_network
###########################################################
# Attach the ip to the nodejs host
###########################################################
- type: cloudify.cloudstack.virtual_machine_connected_to_floating_ip
target: nodecellar_ip
###########################################################
# This node represents the existing management
# network created by the bootstrap process.
# Agent VM's will be connected to this network,
# making them accessible from the management machine.
###########################################################
management_network:
type: cloudify.cloudstack.nodes.Network
properties:
resource_id: { get_input: management_network_resource_id }
use_external_resource: True
network:
service_offering: { get_input: cloudstack_network_service_offering }
zone: { get_input: cloudstack_zone }
###########################################################
# A new network dedicated for the application. This will
# be the default network for hosts.
###########################################################
nodecellar_network:
type: cloudify.cloudstack.nodes.Network
properties:
resource_id: { get_input: nodecellar_network_resource_id }
network:
service_offering: { get_input: cloudstack_network_service_offering }
zone: { get_input: cloudstack_zone }
gateway: 10.4.1.1
netmask: 255.255.255.0
firewall:
###########################################################
# Allow incoming traffic to the application to pass
# the firewall
# be the default network for hosts.
###########################################################
- type: ingress
protocol: TCP
cidr: 0.0.0.0/0
ports: [{ get_property: [ nodecellar, port ] }]
###########################################################
# Allow outgoing traffic so that hosts can download
# resources from the internet.
###########################################################
- type: egress
protocol: TCP
cidr: 0.0.0.0/0
ports: [80, 443]
###########################################################
# An 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.cloudstack.nodes.FloatingIP
relationships:
###########################################################
# Notice we are assigning an IP from the dedicated
# application network
###########################################################
- type: cloudify.cloudstack.floating_ip_connected_to_network
target: nodecellar_network
outputs:
endpoint:
description: Web application endpoint
value:
ip_address: { get_attribute: [ nodecellar_ip, floating_ip_address ] }
port: { get_property: [ nodecellar, port ] }