-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathservice_chain.yaml
247 lines (213 loc) · 6.97 KB
/
service_chain.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
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
tosca_definitions_version: cloudify_dsl_1_3
imports:
- http://www.getcloudify.org/spec/cloudify/4.5/types.yaml
- plugin:cloudify-opencontrail-plugin?version=1.0.5.dev1
inputs:
opencontrail_user:
type: string
default: { get_secret: opencontrail_user }
opencontrail_password:
type: string
default: { get_secret: opencontrail_password }
opencontrail_tenant:
type: string
default: { get_secret: opencontrail_tenant }
opencontrail_ip:
type: string
default: { get_secret: opencontrail_ip }
opencontrail_port:
type: string
default: { get_secret: opencontrail_port }
mgmt_network_name:
type: string
default: 'management_network'
mgmt_subnet_cidr:
type: string
default: '192.168.0.0/24'
mgmt_ip:
type: string
default: '192.168.0.2'
left_network_name:
type: string
default: 'left_network'
left_subnet_cidr:
type: string
default: '192.168.1.0/24'
left_ip:
type: string
default: '192.168.1.2'
right_network_name:
type: string
default: 'right_network'
right_subnet_cidr:
type: string
default: '192.168.2.0/24'
right_ip:
type: string
default: '192.168.2.2'
service_template_name:
type: string
default: template1
service_instance_name:
type: string
default: instance1
port_tuple_name:
type: string
default: tuple1
dsl_definitions:
api_configs: &api_configs
- user: { get_input: opencontrail_user }
password: { get_input: opencontrail_password }
tenant: { get_input: opencontrail_tenant }
ip: { get_input: opencontrail_ip }
port: { get_input: opencontrail_port }
node_templates:
mgmt_network:
type: cloudify.nodes.opencontrail.VirtualNetwork
properties:
api_configs: *api_configs
name: { get_input: mgmt_network_name }
subnet_cidr: { get_input: mgmt_subnet_cidr }
left_network:
type: cloudify.nodes.opencontrail.VirtualNetwork
properties:
api_configs: *api_configs
name: { get_input: left_network_name }
subnet_cidr: { get_input: left_subnet_cidr }
route_target: ~
relationships:
- type: cloudify.relationships.depends_on
target: mgmt_network
right_network:
type: cloudify.nodes.opencontrail.VirtualNetwork
properties:
api_configs: *api_configs
name: { get_input: right_network_name }
subnet_cidr: { get_input: right_subnet_cidr }
route_target: ~
relationships:
- type: cloudify.relationships.depends_on
target: left_network
mgmt_interface:
type: cloudify.nodes.opencontrail.VirtualMachineInterface
properties:
api_configs: *api_configs
relationships:
- type: cloudify.relationships.connected_to
target: mgmt_network
left_interface:
type: cloudify.nodes.opencontrail.VirtualMachineInterface
properties:
api_configs: *api_configs
relationships:
- type: cloudify.relationships.connected_to
target: left_network
- type: cloudify.relationships.depends_on
target: mgmt_interface
right_interface:
type: cloudify.nodes.opencontrail.VirtualMachineInterface
properties:
api_configs: *api_configs
relationships:
- type: cloudify.relationships.connected_to
target: right_network
- type: cloudify.relationships.depends_on
target: left_interface
mgmt_instance_ip:
type: cloudify.nodes.opencontrail.InstanceIP
properties:
api_configs: *api_configs
ip: { get_input: mgmt_ip }
relationships:
- type: cloudify.relationships.depends_on
target: mgmt_network
- type: cloudify.relationships.depends_on
target: mgmt_interface
left_instance_ip:
type: cloudify.nodes.opencontrail.InstanceIP
properties:
api_configs: *api_configs
ip: { get_input: left_ip }
relationships:
- type: cloudify.relationships.depends_on
target: left_network
- type: cloudify.relationships.depends_on
target: left_interface
right_instance_ip:
type: cloudify.nodes.opencontrail.InstanceIP
properties:
api_configs: *api_configs
ip: { get_input: right_ip }
relationships:
- type: cloudify.relationships.depends_on
target: right_network
- type: cloudify.relationships.depends_on
target: right_interface
service_template:
type: cloudify.nodes.opencontrail.ServiceTemplate
properties:
api_configs: *api_configs
name: { get_input: service_template_name }
service_mode: 'in-network'
service_type: 'firewall'
interface_types:
- 'management'
- 'left'
- 'right'
service_virtualization_type: 'virtual-machine'
service_instance:
type: cloudify.nodes.opencontrail.ServiceInstance
properties:
api_configs: *api_configs
name: { get_input: service_instance_name }
relationships:
- type: cloudify.relationships.depends_on
target: service_template
- type: cloudify.relationships.opencontrail.service_instance_uses_virtual_network
target: mgmt_network
- type: cloudify.relationships.opencontrail.service_instance_uses_ipstance_ip
target: mgmt_instance_ip
source_interfaces:
cloudify.interfaces.relationship_lifecycle:
preconfigure:
inputs:
interface_type: 'management'
- type: cloudify.relationships.opencontrail.service_instance_uses_virtual_network
target: left_network
- type: cloudify.relationships.opencontrail.service_instance_uses_ipstance_ip
target: left_instance_ip
source_interfaces:
cloudify.interfaces.relationship_lifecycle:
preconfigure:
inputs:
interface_type: 'left'
- type: cloudify.relationships.opencontrail.service_instance_uses_virtual_network
target: right_network
- type: cloudify.relationships.opencontrail.service_instance_uses_ipstance_ip
target: right_instance_ip
source_interfaces:
cloudify.interfaces.relationship_lifecycle:
preconfigure:
inputs:
interface_type: 'right'
port_tuple:
type: cloudify.nodes.opencontrail.PortTuple
properties:
api_configs: *api_configs
name: { get_input: port_tuple_name }
relationships:
- type: cloudify.relationships.contained_in
target: service_instance
- type: cloudify.relationships.opencontrail.port_tuple_uses_virtual_machine_interface
target: mgmt_interface
- type: cloudify.relationships.opencontrail.port_tuple_uses_virtual_machine_interface
target: left_interface
- type: cloudify.relationships.opencontrail.port_tuple_uses_virtual_machine_interface
target: right_interface
capabilities:
service_instance:
value: { get_attribute: [service_instance, object_reference] }
service_template:
value: { get_attribute: [service_template, object_reference] }
port_tuple:
value: { get_attribute: [port_tuple, object_reference] }