Merge "Script for integration with MR"
[integration.git] / deployment / heat / onap-oom / onap-oom.yaml
1 heat_template_version: 2015-10-15
2 description: ONAP on Kubernetes using OOM
3
4 parameters:
5   lab_name:
6     type: string
7
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   public_net_name:
19     type: string
20     description: The name of the Public network referred by public_net_id
21
22   oam_network_cidr:
23     type: string
24     description: CIDR of the OAM ONAP network
25
26   keystone_url:
27     type: string
28     description: URL of OpenStack Keystone
29
30   openstack_tenant_id:
31     type: string
32     description: OpenStack tenant ID
33
34   openstack_tenant_name:
35     type: string
36     description: OpenStack tenant name (matching with the openstack_tenant_id)
37
38   openstack_username:
39     type: string
40     description: OpenStack username
41
42   openstack_api_key:
43     type: string
44     description: OpenStack password or API Key
45
46   ubuntu_1404_image:
47     type: string
48     description: Name of the Ubuntu 14.04 image
49
50   ubuntu_1604_image:
51     type: string
52     description: Name of the Ubuntu 16.04 image
53
54   centos_7_image:
55     type: string
56     description: the id/name of the CentOS 7 VM imange
57
58   rancher_vm_flavor:
59     type: string
60     description: Name of the Ubuntu 14.04 image
61
62   k8s_vm_flavor:
63     type: string
64     description: Name of the Ubuntu 14.04 image
65
66   dns_forwarder:
67     type: string
68     description: the forwarder address for setting up ONAP's private DNS server
69
70   external_dns:
71     type: string
72     description: Public IP of the external DNS for ONAP network
73
74   dnsaas_proxy_enable:
75     type: string
76     description: whether to enable DNSaaS proxy via multicloud
77
78   dnsaas_region:
79     type: string
80     description: the region of the cloud instance providing the Designate DNS as a Service
81
82   dnsaas_proxied_keystone_url_path:
83     type: string
84     description: the proxy keystone URL path for DCAE to use (via MultiCloud)
85
86   dnsaas_keystone_url:
87     type: string
88     description: the keystone URL of the cloud instance providing the Designate DNS as a Service
89
90   dnsaas_username:
91     type: string
92     description: the username of the cloud instance providing the Designate DNS as a Service
93
94   dnsaas_password:
95     type: string
96     description: the password of the cloud instance providing the Designate DNS as a Service
97
98   dnsaas_tenant_id:
99     type: string
100     description: the ID of the tenant in the cloud instance providing the Designate DNS as a Service
101
102   dnsaas_tenant_name:
103     type: string
104     description: the name of the tenant in the cloud instance providing the Designate DNS as a Service
105
106 resources:
107   random-str:
108     type: OS::Heat::RandomString
109     properties:
110       length: 4
111
112   # ONAP security group
113   onap_sg:
114     type: OS::Neutron::SecurityGroup
115     properties:
116       name:
117         str_replace:
118           template: base_rand
119           params:
120             base: onap_sg
121             rand: { get_resource: random-str }
122       description: security group used by ONAP
123       rules:
124         # All egress traffic
125         - direction: egress
126           ethertype: IPv4
127         - direction: egress
128           ethertype: IPv6
129         # ingress traffic
130         # ICMP
131         - protocol: icmp
132         - protocol: udp
133           port_range_min: 1
134           port_range_max: 65535
135         - protocol: tcp
136           port_range_min: 1
137           port_range_max: 65535
138
139
140   # ONAP management private network
141   oam_network:
142     type: OS::Neutron::Net
143     properties:
144       name:
145         str_replace:
146           template: oam_network_rand
147           params:
148             rand: { get_resource: random-str }
149
150   oam_subnet:
151     type: OS::Neutron::Subnet
152     properties:
153       name:
154         str_replace:
155           template: oam_network_rand
156           params:
157             rand: { get_resource: random-str }
158       network_id: { get_resource: oam_network }
159       cidr: { get_param: oam_network_cidr }
160       dns_nameservers: [ get_param: dns_forwarder ]
161
162   router:
163     type: OS::Neutron::Router
164     properties:
165       external_gateway_info:
166         network: { get_param: public_net_id }
167
168   router_interface:
169     type: OS::Neutron::RouterInterface
170     properties:
171       router_id: { get_resource: router }
172       subnet_id: { get_resource: oam_subnet }
173
174   rancher_private_port:
175     type: OS::Neutron::Port
176     properties:
177       network: { get_resource: oam_network }
178       fixed_ips: [{"subnet": { get_resource: oam_subnet }}]
179       security_groups:
180       - { get_resource: onap_sg }
181
182   rancher_floating_ip:
183     type: OS::Neutron::FloatingIP
184     properties:
185       floating_network_id: { get_param: public_net_id }
186       port_id: { get_resource: rancher_private_port }
187
188   rancher_vm:
189     type: OS::Nova::Server
190     properties:
191       name: rancher
192       image: { get_param: ubuntu_1604_image }
193       flavor: { get_param: rancher_vm_flavor }
194       key_name: onap_key
195       networks:
196       - port: { get_resource: rancher_private_port }
197       user_data_format: RAW
198       user_data:
199         str_replace:
200           params:
201             __docker_proxy__: { get_param: docker_proxy }
202             __apt_proxy__: { get_param: apt_proxy }
203           template:
204             get_file: rancher_vm_entrypoint.sh
205
206   k8s_private_port:
207     type: OS::Neutron::Port
208     properties:
209       network: { get_resource: oam_network }
210       fixed_ips: [{"subnet": { get_resource: oam_subnet }}]
211       security_groups:
212       - { get_resource: onap_sg }
213
214   k8s_floating_ip:
215     type: OS::Neutron::FloatingIP
216     properties:
217       floating_network_id: { get_param: public_net_id }
218       port_id: { get_resource: k8s_private_port }
219
220   k8s_vm:
221     type: OS::Nova::Server
222     properties:
223       name: k8s
224       image: { get_param: ubuntu_1604_image }
225       flavor: { get_param: k8s_vm_flavor }
226       key_name: onap_key
227       networks:
228       - port: { get_resource: k8s_private_port }
229       user_data_format: RAW
230       user_data:
231         str_replace:
232           params:
233             __lab_name__: { get_param: lab_name }
234             __docker_proxy__: { get_param: docker_proxy }
235             __apt_proxy__: { get_param: apt_proxy }
236             __rancher_ip_addr__: { get_attr: [rancher_floating_ip, floating_ip_address] }
237             __k8s_ip_addr__: { get_attr: [k8s_floating_ip, floating_ip_address] }
238             __openstack_tenant_id__: { get_param: openstack_tenant_id }
239             __openstack_tenant_name__: { get_param: openstack_tenant_name }
240             __openstack_username__: { get_param: openstack_username }
241             __openstack_api_key__: { get_param : openstack_api_key }
242             __public_net_id__: { get_param: public_net_id }
243             __public_net_name__: { get_param: public_net_name }
244             __oam_network_id__: { get_resource: oam_network }
245             __oam_subnet_id__: { get_resource: oam_subnet }
246             __oam_network_cidr__: { get_param: oam_network_cidr }
247             __ubuntu_1404_image__: { get_param: ubuntu_1404_image }
248             __ubuntu_1604_image__: { get_param: ubuntu_1604_image }
249             __centos_7_image__: { get_param: centos_7_image }
250             __keystone_url__: { get_param: keystone_url }
251             __dns_forwarder__: { get_param: dns_forwarder }
252             __external_dns__: { get_param: external_dns }
253             __dnsaas_proxy_enable__: { get_param: dnsaas_proxy_enable }
254             __dnsaas_proxied_keystone_url_path__: { get_param: dnsaas_proxied_keystone_url_path }
255             __dnsaas_keystone_url__: { get_param: dnsaas_keystone_url }
256             __dnsaas_region__: { get_param: dnsaas_region }
257             __dnsaas_tenant_id__: { get_param: dnsaas_tenant_id }
258             __dnsaas_tenant_name__: { get_param: dnsaas_tenant_name }
259             __dnsaas_username__: { get_param: dnsaas_username }
260             __dnsaas_password__: { get_param: dnsaas_password }
261           template:
262             get_file: k8s_vm_entrypoint.sh
263
264 outputs:
265   rancher_vm_ip:
266     description: The IP address of the rancher instance
267     value: { get_attr: [rancher_floating_ip, floating_ip_address] }
268
269   k8s_vm_ip:
270     description: The IP address of the k8s instance
271     value: { get_attr: [k8s_floating_ip, floating_ip_address] }