736dd18370ecf9faf35074eda1be81389ee27776
[integration.git] / deployment / heat / onap-oom / onap-oom.yaml
1 #
2 # Generated by scripts/gen-onap-oom-yaml.sh; MANUAL CHANGES WILL BE LOST
3 #
4 heat_template_version: 2015-10-15
5 description: ONAP on Kubernetes using OOM
6
7 parameters:
8   docker_proxy:
9     type: string
10
11   apt_proxy:
12     type: string
13
14   public_net_id:
15     type: string
16     description: The ID of the Public network for floating IP address allocation
17
18   oam_network_cidr:
19     type: string
20     description: CIDR of the OAM ONAP network
21
22   ubuntu_1604_image:
23     type: string
24     description: Name of the Ubuntu 16.04 image
25
26   rancher_vm_flavor:
27     type: string
28     description: VM flavor for Rancher
29
30   k8s_vm_flavor:
31     type: string
32     description: VM flavor for k8s hosts
33
34   integration_override_yaml:
35     type: string
36     description: Content for integration_override.yaml
37
38 resources:
39   random-str:
40     type: OS::Heat::RandomString
41     properties:
42       length: 4
43
44   # ONAP security group
45   onap_sg:
46     type: OS::Neutron::SecurityGroup
47     properties:
48       name:
49         str_replace:
50           template: base_rand
51           params:
52             base: onap_sg
53             rand: { get_resource: random-str }
54       description: security group used by ONAP
55       rules:
56         # All egress traffic
57         - direction: egress
58           ethertype: IPv4
59         - direction: egress
60           ethertype: IPv6
61         # ingress traffic
62         # ICMP
63         - protocol: icmp
64         - protocol: udp
65           port_range_min: 1
66           port_range_max: 65535
67         - protocol: tcp
68           port_range_min: 1
69           port_range_max: 65535
70
71
72   # ONAP management private network
73   oam_network:
74     type: OS::Neutron::Net
75     properties:
76       name:
77         str_replace:
78           template: oam_network_rand
79           params:
80             rand: { get_resource: random-str }
81
82   oam_subnet:
83     type: OS::Neutron::Subnet
84     properties:
85       name:
86         str_replace:
87           template: oam_network_rand
88           params:
89             rand: { get_resource: random-str }
90       network_id: { get_resource: oam_network }
91       cidr: { get_param: oam_network_cidr }
92       dns_nameservers: [ "8.8.8.8" ]
93
94   router:
95     type: OS::Neutron::Router
96     properties:
97       external_gateway_info:
98         network: { get_param: public_net_id }
99
100   router_interface:
101     type: OS::Neutron::RouterInterface
102     properties:
103       router_id: { get_resource: router }
104       subnet_id: { get_resource: oam_subnet }
105
106   rancher_private_port:
107     type: OS::Neutron::Port
108     properties:
109       network: { get_resource: oam_network }
110       fixed_ips: [{"subnet": { get_resource: oam_subnet }}]
111       security_groups:
112       - { get_resource: onap_sg }
113
114   rancher_floating_ip:
115     type: OS::Neutron::FloatingIP
116     properties:
117       floating_network_id: { get_param: public_net_id }
118       port_id: { get_resource: rancher_private_port }
119
120   rancher_vm:
121     type: OS::Nova::Server
122     properties:
123       name: rancher
124       image: { get_param: ubuntu_1604_image }
125       flavor: { get_param: rancher_vm_flavor }
126       key_name: onap_key
127       networks:
128       - port: { get_resource: rancher_private_port }
129       user_data_format: RAW
130       user_data:
131         str_replace:
132           template:
133             get_file: rancher_vm_entrypoint.sh
134           params:
135             __docker_proxy__: { get_param: docker_proxy }
136             __apt_proxy__: { get_param: apt_proxy }
137             __rancher_ip_addr__: { get_attr: [rancher_floating_ip, floating_ip_address] }
138             __integration_override_yaml__: { get_param: integration_override_yaml }
139             __oam_network_id__: { get_resource: oam_network }
140             __oam_subnet_id__: { get_resource: oam_subnet }
141             __k8s_vm_ips__: [
142               get_attr: [k8s_1_floating_ip, floating_ip_address],
143               get_attr: [k8s_2_floating_ip, floating_ip_address],
144               get_attr: [k8s_3_floating_ip, floating_ip_address],
145               get_attr: [k8s_4_floating_ip, floating_ip_address],
146               get_attr: [k8s_5_floating_ip, floating_ip_address],
147               get_attr: [k8s_6_floating_ip, floating_ip_address],
148               get_attr: [k8s_7_floating_ip, floating_ip_address],
149               get_attr: [k8s_8_floating_ip, floating_ip_address],
150               get_attr: [k8s_9_floating_ip, floating_ip_address],
151             ]
152   k8s_1_private_port:
153     type: OS::Neutron::Port
154     properties:
155       network: { get_resource: oam_network }
156       fixed_ips: [{"subnet": { get_resource: oam_subnet }}]
157       security_groups:
158       - { get_resource: onap_sg }
159
160   k8s_1_floating_ip:
161     type: OS::Neutron::FloatingIP
162     properties:
163       floating_network_id: { get_param: public_net_id }
164       port_id: { get_resource: k8s_1_private_port }
165
166   k8s_1_vm:
167     type: OS::Nova::Server
168     properties:
169       name: k8s_1
170       image: { get_param: ubuntu_1604_image }
171       flavor: { get_param: k8s_vm_flavor }
172       key_name: onap_key
173       networks:
174       - port: { get_resource: k8s_1_private_port }
175       user_data_format: RAW
176       user_data:
177         str_replace:
178           params:
179             __docker_proxy__: { get_param: docker_proxy }
180             __apt_proxy__: { get_param: apt_proxy }
181             __rancher_ip_addr__: { get_attr: [rancher_floating_ip, floating_ip_address] }
182           template:
183             get_file: k8s_vm_entrypoint.sh
184
185   k8s_2_private_port:
186     type: OS::Neutron::Port
187     properties:
188       network: { get_resource: oam_network }
189       fixed_ips: [{"subnet": { get_resource: oam_subnet }}]
190       security_groups:
191       - { get_resource: onap_sg }
192
193   k8s_2_floating_ip:
194     type: OS::Neutron::FloatingIP
195     properties:
196       floating_network_id: { get_param: public_net_id }
197       port_id: { get_resource: k8s_2_private_port }
198
199   k8s_2_vm:
200     type: OS::Nova::Server
201     properties:
202       name: k8s_2
203       image: { get_param: ubuntu_1604_image }
204       flavor: { get_param: k8s_vm_flavor }
205       key_name: onap_key
206       networks:
207       - port: { get_resource: k8s_2_private_port }
208       user_data_format: RAW
209       user_data:
210         str_replace:
211           params:
212             __docker_proxy__: { get_param: docker_proxy }
213             __apt_proxy__: { get_param: apt_proxy }
214             __rancher_ip_addr__: { get_attr: [rancher_floating_ip, floating_ip_address] }
215           template:
216             get_file: k8s_vm_entrypoint.sh
217
218   k8s_3_private_port:
219     type: OS::Neutron::Port
220     properties:
221       network: { get_resource: oam_network }
222       fixed_ips: [{"subnet": { get_resource: oam_subnet }}]
223       security_groups:
224       - { get_resource: onap_sg }
225
226   k8s_3_floating_ip:
227     type: OS::Neutron::FloatingIP
228     properties:
229       floating_network_id: { get_param: public_net_id }
230       port_id: { get_resource: k8s_3_private_port }
231
232   k8s_3_vm:
233     type: OS::Nova::Server
234     properties:
235       name: k8s_3
236       image: { get_param: ubuntu_1604_image }
237       flavor: { get_param: k8s_vm_flavor }
238       key_name: onap_key
239       networks:
240       - port: { get_resource: k8s_3_private_port }
241       user_data_format: RAW
242       user_data:
243         str_replace:
244           params:
245             __docker_proxy__: { get_param: docker_proxy }
246             __apt_proxy__: { get_param: apt_proxy }
247             __rancher_ip_addr__: { get_attr: [rancher_floating_ip, floating_ip_address] }
248           template:
249             get_file: k8s_vm_entrypoint.sh
250
251   k8s_4_private_port:
252     type: OS::Neutron::Port
253     properties:
254       network: { get_resource: oam_network }
255       fixed_ips: [{"subnet": { get_resource: oam_subnet }}]
256       security_groups:
257       - { get_resource: onap_sg }
258
259   k8s_4_floating_ip:
260     type: OS::Neutron::FloatingIP
261     properties:
262       floating_network_id: { get_param: public_net_id }
263       port_id: { get_resource: k8s_4_private_port }
264
265   k8s_4_vm:
266     type: OS::Nova::Server
267     properties:
268       name: k8s_4
269       image: { get_param: ubuntu_1604_image }
270       flavor: { get_param: k8s_vm_flavor }
271       key_name: onap_key
272       networks:
273       - port: { get_resource: k8s_4_private_port }
274       user_data_format: RAW
275       user_data:
276         str_replace:
277           params:
278             __docker_proxy__: { get_param: docker_proxy }
279             __apt_proxy__: { get_param: apt_proxy }
280             __rancher_ip_addr__: { get_attr: [rancher_floating_ip, floating_ip_address] }
281           template:
282             get_file: k8s_vm_entrypoint.sh
283
284   k8s_5_private_port:
285     type: OS::Neutron::Port
286     properties:
287       network: { get_resource: oam_network }
288       fixed_ips: [{"subnet": { get_resource: oam_subnet }}]
289       security_groups:
290       - { get_resource: onap_sg }
291
292   k8s_5_floating_ip:
293     type: OS::Neutron::FloatingIP
294     properties:
295       floating_network_id: { get_param: public_net_id }
296       port_id: { get_resource: k8s_5_private_port }
297
298   k8s_5_vm:
299     type: OS::Nova::Server
300     properties:
301       name: k8s_5
302       image: { get_param: ubuntu_1604_image }
303       flavor: { get_param: k8s_vm_flavor }
304       key_name: onap_key
305       networks:
306       - port: { get_resource: k8s_5_private_port }
307       user_data_format: RAW
308       user_data:
309         str_replace:
310           params:
311             __docker_proxy__: { get_param: docker_proxy }
312             __apt_proxy__: { get_param: apt_proxy }
313             __rancher_ip_addr__: { get_attr: [rancher_floating_ip, floating_ip_address] }
314           template:
315             get_file: k8s_vm_entrypoint.sh
316
317   k8s_6_private_port:
318     type: OS::Neutron::Port
319     properties:
320       network: { get_resource: oam_network }
321       fixed_ips: [{"subnet": { get_resource: oam_subnet }}]
322       security_groups:
323       - { get_resource: onap_sg }
324
325   k8s_6_floating_ip:
326     type: OS::Neutron::FloatingIP
327     properties:
328       floating_network_id: { get_param: public_net_id }
329       port_id: { get_resource: k8s_6_private_port }
330
331   k8s_6_vm:
332     type: OS::Nova::Server
333     properties:
334       name: k8s_6
335       image: { get_param: ubuntu_1604_image }
336       flavor: { get_param: k8s_vm_flavor }
337       key_name: onap_key
338       networks:
339       - port: { get_resource: k8s_6_private_port }
340       user_data_format: RAW
341       user_data:
342         str_replace:
343           params:
344             __docker_proxy__: { get_param: docker_proxy }
345             __apt_proxy__: { get_param: apt_proxy }
346             __rancher_ip_addr__: { get_attr: [rancher_floating_ip, floating_ip_address] }
347           template:
348             get_file: k8s_vm_entrypoint.sh
349
350   k8s_7_private_port:
351     type: OS::Neutron::Port
352     properties:
353       network: { get_resource: oam_network }
354       fixed_ips: [{"subnet": { get_resource: oam_subnet }}]
355       security_groups:
356       - { get_resource: onap_sg }
357
358   k8s_7_floating_ip:
359     type: OS::Neutron::FloatingIP
360     properties:
361       floating_network_id: { get_param: public_net_id }
362       port_id: { get_resource: k8s_7_private_port }
363
364   k8s_7_vm:
365     type: OS::Nova::Server
366     properties:
367       name: k8s_7
368       image: { get_param: ubuntu_1604_image }
369       flavor: { get_param: k8s_vm_flavor }
370       key_name: onap_key
371       networks:
372       - port: { get_resource: k8s_7_private_port }
373       user_data_format: RAW
374       user_data:
375         str_replace:
376           params:
377             __docker_proxy__: { get_param: docker_proxy }
378             __apt_proxy__: { get_param: apt_proxy }
379             __rancher_ip_addr__: { get_attr: [rancher_floating_ip, floating_ip_address] }
380           template:
381             get_file: k8s_vm_entrypoint.sh
382
383   k8s_8_private_port:
384     type: OS::Neutron::Port
385     properties:
386       network: { get_resource: oam_network }
387       fixed_ips: [{"subnet": { get_resource: oam_subnet }}]
388       security_groups:
389       - { get_resource: onap_sg }
390
391   k8s_8_floating_ip:
392     type: OS::Neutron::FloatingIP
393     properties:
394       floating_network_id: { get_param: public_net_id }
395       port_id: { get_resource: k8s_8_private_port }
396
397   k8s_8_vm:
398     type: OS::Nova::Server
399     properties:
400       name: k8s_8
401       image: { get_param: ubuntu_1604_image }
402       flavor: { get_param: k8s_vm_flavor }
403       key_name: onap_key
404       networks:
405       - port: { get_resource: k8s_8_private_port }
406       user_data_format: RAW
407       user_data:
408         str_replace:
409           params:
410             __docker_proxy__: { get_param: docker_proxy }
411             __apt_proxy__: { get_param: apt_proxy }
412             __rancher_ip_addr__: { get_attr: [rancher_floating_ip, floating_ip_address] }
413           template:
414             get_file: k8s_vm_entrypoint.sh
415
416   k8s_9_private_port:
417     type: OS::Neutron::Port
418     properties:
419       network: { get_resource: oam_network }
420       fixed_ips: [{"subnet": { get_resource: oam_subnet }}]
421       security_groups:
422       - { get_resource: onap_sg }
423
424   k8s_9_floating_ip:
425     type: OS::Neutron::FloatingIP
426     properties:
427       floating_network_id: { get_param: public_net_id }
428       port_id: { get_resource: k8s_9_private_port }
429
430   k8s_9_vm:
431     type: OS::Nova::Server
432     properties:
433       name: k8s_9
434       image: { get_param: ubuntu_1604_image }
435       flavor: { get_param: k8s_vm_flavor }
436       key_name: onap_key
437       networks:
438       - port: { get_resource: k8s_9_private_port }
439       user_data_format: RAW
440       user_data:
441         str_replace:
442           params:
443             __docker_proxy__: { get_param: docker_proxy }
444             __apt_proxy__: { get_param: apt_proxy }
445             __rancher_ip_addr__: { get_attr: [rancher_floating_ip, floating_ip_address] }
446           template:
447             get_file: k8s_vm_entrypoint.sh
448
449 outputs:
450   rancher_vm_ip:
451     description: The IP address of the rancher instance
452     value: { get_attr: [rancher_floating_ip, floating_ip_address] }
453
454   k8s_1_vm_ip:
455     description: The IP address of the k8s_1 instance
456     value: { get_attr: [k8s_1_floating_ip, floating_ip_address] }
457
458   k8s_2_vm_ip:
459     description: The IP address of the k8s_2 instance
460     value: { get_attr: [k8s_2_floating_ip, floating_ip_address] }
461
462   k8s_3_vm_ip:
463     description: The IP address of the k8s_3 instance
464     value: { get_attr: [k8s_3_floating_ip, floating_ip_address] }
465
466   k8s_4_vm_ip:
467     description: The IP address of the k8s_4 instance
468     value: { get_attr: [k8s_4_floating_ip, floating_ip_address] }
469
470   k8s_5_vm_ip:
471     description: The IP address of the k8s_5 instance
472     value: { get_attr: [k8s_5_floating_ip, floating_ip_address] }
473
474   k8s_6_vm_ip:
475     description: The IP address of the k8s_6 instance
476     value: { get_attr: [k8s_6_floating_ip, floating_ip_address] }
477
478   k8s_7_vm_ip:
479     description: The IP address of the k8s_7 instance
480     value: { get_attr: [k8s_7_floating_ip, floating_ip_address] }
481
482   k8s_8_vm_ip:
483     description: The IP address of the k8s_8 instance
484     value: { get_attr: [k8s_8_floating_ip, floating_ip_address] }
485
486   k8s_9_vm_ip:
487     description: The IP address of the k8s_9 instance
488     value: { get_attr: [k8s_9_floating_ip, floating_ip_address] }
489