-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprilohy.tex
executable file
·507 lines (476 loc) · 14.6 KB
/
prilohy.tex
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
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
\pagenumbering{Roman}
\addcontentsline{toc}{part}{Přílohy}\thispagestyle{empty} \renewcommand{\appendixname}{P\v{r}iloha}%%přílohy, číslování římskými
\part*{Přílohy} %% rename
\appendix
\chapter{Heat template Lbaas - HAproxy}
\begin{lstlisting}
heat_template_version: 2013-05-23
description: LBAAS Template
parameters:
key_name:
type: string
instance_flavor:
type: string
description: Instance type for servers
default: m1.small
constraints:
- allowed_values: [m1.tiny, m1.small, m1.medium, m1.large]
description: instance_type must be a valid instance type
instance_image:
type: string
description: Image name to use for the servers.
default: ubuntu-14-04-x64
public_net_id:
type: string
description: ID or name of public network for which floating IP addresses will be allocated
router_name:
type: string
description: Name of router to be created
default: test-router
lb_name:
type: string
description: Name of balancer to be created
default: test-lb
public_net_name:
type: string
description: Name of public network to be created
default: public-net
public_net_cidr:
type: string
description: Public network address (CIDR notation)
default: 10.10.20.0/24
public_net_pool_start:
type: string
description: Start of public network IP address allocation pool
default: 10.10.20.100
public_net_pool_end:
type: string
description: End of public network IP address allocation pool
default: 10.10.20.200
private_net_name:
type: string
description: Name of private network to be created
default: private-net
private_net_cidr:
type: string
description: Private network address (CIDR notation)
default: 10.10.10.0/24
private_net_pool_start:
type: string
description: Start of private network IP address allocation pool
default: 10.10.10.100
private_net_pool_end:
type: string
description: End of private network IP address allocation pool
default: 10.10.10.200
resources:
http_security_group:
type: OS::Neutron::SecurityGroup
properties:
name: http
rules:
- direction: ingress
remote_mode: remote_ip_prefix
remote_ip_prefix: 0.0.0.0/0
port_range_min: 80
port_range_max: 80
protocol: tcp
public_net:
type: OS::Neutron::Net
properties:
admin_state_up: True
name: { get_param: public_net_name }
shared: False
public_subnet:
type: OS::Neutron::Subnet
properties:
allocation_pools:
- start: { get_param: public_net_pool_start }
end: { get_param: public_net_pool_end }
cidr: { get_param: public_net_cidr }
enable_dhcp: True
ip_version: 4
name: { get_param: public_net_name }
network_id: { get_resource: public_net }
private_net:
type: OS::Neutron::Net
properties:
admin_state_up: True
name: { get_param: private_net_name }
shared: False
private_subnet:
type: OS::Neutron::Subnet
properties:
allocation_pools:
- start: { get_param: private_net_pool_start }
end: { get_param: private_net_pool_end }
cidr: { get_param: private_net_cidr }
enable_dhcp: True
ip_version: 4
name: { get_param: private_net_name }
network_id: { get_resource: private_net }
router:
type: OS::Neutron::Router
properties:
name: { get_param: router_name }
external_gateway_info:
network: { get_param: public_net_id }
router_interface:
type: OS::Neutron::RouterInterface
properties:
router_id: { get_resource: router }
subnet_id: { get_resource: private_subnet }
lb_ping_healt_monitor:
type: OS::Neutron::HealthMonitor
properties:
admin_state_up: True
delay: 5
max_retries: 1
timeout: 5
type: PING
lb_pool:
type: OS::Neutron::Pool
properties:
admin_state_up: True
lb_method: ROUND_ROBIN
name: { get_param: lb_name }
protocol: HTTP
monitors:
- { get_resource: lb_ping_healt_monitor }
subnet_id: { get_resource: private_subnet }
vip:
protocol_port: 80
# address: { get_param: public_net_ip }
admin_state_up: True
subnet: { get_resource: public_subnet }
instance_01:
type: OS::Nova::Server
properties:
image: { get_param: instance_image }
flavor: { get_param: instance_flavor }
key_name: { get_param: key_name }
name: test-web01
networks:
- network: { get_resource: private_net }
security_groups:
- default
- { get_resource: http_security_group }
user_data_format: RAW
user_data: |
#!/bin/bash -v
apt-get install apache2 -yy
echo "Instance 01" > /var/www/html/index.html
lb_pool_member_instance_01:
type: OS::Neutron::PoolMember
properties:
address: { get_attr: [ instance_01 , first_address ] }
admin_state_up: True
pool_id: { get_resource: lb_pool }
protocol_port: 80
weight: 1
instance_02:
type: OS::Nova::Server
properties:
image: { get_param: instance_image }
flavor: { get_param: instance_flavor }
key_name: { get_param: key_name }
name: test-web02
networks:
- network: { get_resource: private_net }
security_groups:
- default
- { get_resource: http_security_group }
user_data_format: RAW
user_data: |
#!/bin/bash -v
apt-get install apache2 -yy
echo "Instance 02" > /var/www/html/index.html
lb_pool_member_instance_02:
type: OS::Neutron::PoolMember
properties:
address: { get_attr: [ instance_02 , first_address ] }
admin_state_up: True
pool_id: { get_resource: lb_pool }
protocol_port: 80
weight: 1
lb:
type: OS::Neutron::LoadBalancer
properties:
members:
- { get_resource: instance_01 }
- { get_resource: instance_02 }
pool_id: { get_resource: lb_pool }
protocol_port: 80
lb_floating:
type: OS::Neutron::FloatingIP
properties:
floating_network_id: {get_param: public_net_id}
port_id: {get_attr: [lb_pool, vip, port_id]}
\end{lstlisting}
\chapter{Enviroment file pro LbaaS - HAproxy}
\begin{lstlisting}
parameters:
instance_flavor: m1.small
instance_image: ubuntu-14-04-x64
key_name: rav_key
public_net_id: 22d00df7-b1ca-41a1-a615-89c3bdde6c10
\end{lstlisting}
\chapter{Heat template FwaaS}
\begin{lstlisting}
heat_template_version: 2013-05-23
description: >
HOT template to creates two virtual network with one subnet each.
Create a service instance
Creates a network policy for applying service between two VNs created before.
Attach the network policy to two virtual networks
parameters:
policy_name:
type: string
description: Policy Name
direction:
type: string
description: Direction of Policy
start_src_ports:
type: number
description: Start of src port
end_src_ports:
type: number
description: End of src port
start_dst_ports:
type: number
description: Start of dst port
end_dst_ports:
type: number
description: End of dst port
private_net_1_name:
type: string
description: Name of private network to be created
private_net_1_cidr:
type: string
description: Private network address (CIDR notation)
private_net_1_gateway:
type: string
description: Private network gateway address
private_net_1_pool_start:
type: string
description: Start of private network IP address allocation pool
private_net_1_pool_end:
type: string
description: End of private network IP address allocation pool
public_net:
type: string
description: Name of private network to be created
private_instance_name:
type: string
default: TestService1
description: service instance name
private_availability_zone:
type: string
default: ""
description: availability zone in form of Zone:Host
max_instances:
type: number
description: maximum number of instances to be spawned
template_name:
type: string
description: Name of service template
template_mode:
type: string
description: service mode
template_type:
type: string
description: service type
template_image:
type: string
description: Name of the image
template_flavor:
type: string
description: Flavor
service_interface_type_list:
type: string
description: List of interface types
shared_ip_list:
type: string
description: List of shared ip enabled-disabled
static_routes_list:
type: string
description: List of static routes enabled-disabled
scaling:
type: string
description: Indicates whether service scaling is enabled
availability_zone:
type: string
description: Indicates availability zone is enabled
ordered_interfaces:
type: string
description: Indicates service interfaces are ordered
key_name:
type: string
instance_flavor:
type: string
description: Instance type for servers
default: m1.small
constraints:
- allowed_values: [m1.tiny, m1.small, m1.medium, m1.large]
description: instance_type must be a valid instance type
instance_image:
type: string
description: Image name to use for the servers.
default: ubuntu-14-04-x64
resources:
private_net_1:
type: OS::Neutron::Net
properties:
name: { get_param: private_net_1_name }
private_subnet_1:
type: OS::Neutron::Subnet
depends_on: private_net_1
properties:
network_id: { get_resource: private_net_1 }
cidr: { get_param: private_net_1_cidr }
gateway_ip: { get_param: private_net_1_gateway }
allocation_pools:
- start: { get_param: private_net_1_pool_start }
end: { get_param: private_net_1_pool_end }
service_instance:
type: OS::Contrail::ServiceInstance
depends_on: [private_subnet_1]
properties:
name: { get_param: private_instance_name }
service_template: { get_resource: service_template}
availability_zone: { get_param: private_availability_zone}
scale_out:
max_instances: { get_param: max_instances }
interface_list: [
{
virtual_network: "auto"
},
{
virtual_network: {get_param: public_net}
},
{
virtual_network: {get_resource: private_net_1}
}
]
private_policy:
type: OS::Contrail::NetworkPolicy
depends_on: [ private_net_1, service_instance ]
properties:
name: { get_param: policy_name }
entries:
policy_rule: [
{
"direction": { get_param: direction },
"protocol": "any",
"src_ports": [{"start_port": {get_param: start_src_ports}, "end_port": {get_param: end_src_ports}}],
"dst_ports": [{"start_port": {get_param: start_dst_ports}, "end_port": {get_param: end_dst_ports}}],
"dst_addresses": [{ "virtual_network": {get_param: public_net}}],
"action_list": {"apply_service": [{get_resource: service_instance}]},
"src_addresses": [{ "virtual_network": {get_resource: private_net_1}}]
},
]
service_template:
type: OS::Contrail::ServiceTemplate
properties:
name: { get_param: template_name }
service_mode: { get_param: template_mode }
service_type: { get_param: template_type }
image_name: { get_param: template_image }
service_scaling: { get_param: scaling }
availability_zone_enable: { get_param: availability_zone }
ordered_interfaces: { get_param: ordered_interfaces }
flavor: { get_param: template_flavor }
service_interface_type_list: { "Fn::Split" : [ ",", Ref: service_interface_type_list ] }
shared_ip_list: { "Fn::Split" : [ ",", Ref: shared_ip_list ] }
static_routes_list: { "Fn::Split" : [ ",", Ref: static_routes_list ] }
private_policy_attach_net1:
type: OS::Contrail::AttachPolicy
depends_on: [ private_net_1, private_policy ]
properties:
network: { get_resource: private_net_1 }
policy: { get_attr: [private_policy, fq_name] }
private_policy_attach_net2:
type: OS::Contrail::AttachPolicy
depends_on: [private_policy ]
properties:
network: { get_param: public_net }
policy: { get_attr: [private_policy, fq_name] }
test_instance_01:
type: OS::Nova::Server
properties:
image: { get_param: instance_image }
flavor: { get_param: instance_flavor }
key_name: { get_param: key_name }
name: test-web01
networks:
- network: { get_resource: private_net_1 }
security_groups:
- default
user_data_format: RAW
user_data: |
#!/bin/bash -v
apt-get install apache2 -yy
echo "Instance 01" > /var/www/html/index.html
\end{lstlisting}
\chapter{Enviroment file pro LbaaS - Pfsense}
\begin{lstlisting}
parameters:
private_instance_name: test-firewall
max_instances: 1
policy_name: contrail_policy1
direction: "<>"
start_src_ports: -1
end_src_ports: -1
start_dst_ports: -1
end_dst_ports: -1
private_availability_zone: ""
private_net_1_name: contrail_net1
private_net_1_cidr: 1.1.1.0/24
private_net_1_pool_end: 1.1.1.254
private_net_1_gateway: .1.1.1
private_net_1_pool_start: 1.1.1.1
public_net: 22d00df7-b1ca-41a1-a615-89c3bdde6c10
template_name: test-fw-template2
template_mode: in-network
template_type: firewall
template_image: Pfsense
template_flavor: m1.medium
service_interface_type_list: management,right,left
shared_ip_list: False,False,False
static_routes_list: False,False,False
scaling: "True"
availability_zone: "True"
ordered_interfaces: "True"
key_name: rav_key
\end{lstlisting}
\chapter{Enviroment file pro LbaaS - Fortigate VM}
\begin{lstlisting}
parameters:
private_instance_name: test-firewall2
max_instances: 1
policy_name: contrail_policy2
direction: "<>"
start_src_ports: -1
end_src_ports: -1
start_dst_ports: -1
end_dst_ports: -1
private_availability_zone: ""
private_net_1_name: contrail_net2
private_net_1_cidr: 2.2.2.0/24
private_net_1_pool_end: 2.2.2.254
private_net_1_gateway: 2.2.2.1
private_net_1_pool_start: 2.2.2.1
public_net: 22d00df7-b1ca-41a1-a615-89c3bdde6c10
template_name: test-fw-template2
template_mode: in-network
template_type: firewall
template_image: vsrx-15.1
template_flavor: m1.medium
service_interface_type_list: management,right,left
shared_ip_list: False,False,False
static_routes_list: False,False,False
scaling: "True"
availability_zone: "True"
ordered_interfaces: "True"
key_name: rav_key
\end{lstlisting}