removing proxy sample
[oom.git] / kubernetes / config / docker / init / src / config / dcaegen2 / heat / onap_dcae.yaml
1 ##########################################################################
2 #
3 #==================LICENSE_START==========================================
4 #
5 #
6 # Copyright (c) 2017 AT&T Intellectual Property. All rights reserved.
7 #
8 # Licensed under the Apache License, Version 2.0 (the "License");
9 # you may not use this file except in compliance with the License.
10 # You may obtain a copy of the License at
11 #        http://www.apache.org/licenses/LICENSE-2.0
12 #
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # See the License for the specific language governing permissions and
17 # limitations under the License.
18 #
19 #==================LICENSE_END============================================
20 #
21 # ECOMP is a trademark and service mark of AT&T Intellectual Property.
22 #
23 ##########################################################################
24
25 heat_template_version: 2015-10-15
26
27 description: Heat template to install ONAP components
28
29 ##############
30 #            #
31 # PARAMETERS #
32 #            #
33 ##############
34
35 parameters:
36
37   ##############################################
38   #                                            #
39   # Parameters used across all ONAP components #
40   #                                            #
41   ##############################################
42
43   public_net_id:
44     type: string
45     description: The ID of the Public network for floating IP address allocation
46
47   public_net_name:
48     type: string
49     description: The name of the Public network referred by public_net_id
50
51   ubuntu_1404_image:
52     type: string
53     description: Name of the Ubuntu 14.04 image
54
55   ubuntu_1604_image:
56     type: string
57     description: Name of the Ubuntu 16.04 image
58
59   flavor_small:
60     type: string
61     description: Name of the Small Flavor supported by the cloud provider
62
63   flavor_medium:
64     type: string
65     description: Name of the Medium Flavor supported by the cloud provider
66
67   flavor_large:
68     type: string
69     description: Name of the Large Flavor supported by the cloud provider
70
71   vm_base_name:
72     type: string
73     description: Base name of ONAP VMs
74
75   key_name:
76     type: string
77     description: Public/Private key pair name
78
79   pub_key:
80     type: string
81     description: Public key to be installed on the compute instance
82
83   nexus_repo:
84     type: string
85     description: Complete URL for the Nexus repository.
86
87   nexus_docker_repo:
88     type: string
89     description: Complete URL for the Nexus repository for docker images.
90
91   nexus_username:
92     type: string
93     description: Nexus Repository username
94
95   nexus_password:
96     type: string
97     description: Nexus Repository Password
98
99   artifacts_version:
100     type: string
101     description: Artifacts version of ONAP components
102
103   openstack_tenant_id:
104     type: string
105     description: OpenStack tenant ID
106
107   openstack_tenant_name:
108     type: string
109     description: OpenStack tenant name (matching with the openstack_tenant_id)
110
111   openstack_username:
112     type: string
113     description: OpenStack username
114
115   openstack_api_key:
116     type: string
117     description: OpenStack password or API Key
118
119   keystone_url:
120     type: string
121     description: URL of OpenStack Keystone
122
123   cloud_env:
124     type: string
125     description: Cloud Provider Name in lower case
126
127   openstack_region:
128     type: string
129     description: Region where the DCAE controller will spin the VMs
130
131   ######################
132   #                    #
133   # Network parameters #
134   #                    #
135   ######################
136
137   dns_list:
138     type: comma_delimited_list
139     description: List of External DNS for OAM ONAP network
140
141   external_dns:
142     type: string
143     description: Public IP of the external DNS for ONAP network
144
145   dns_forwarder:
146     type: string
147     description: the forwarder address for setting up ONAP's private DNS server
148
149   oam_network_cidr:
150     type: string
151     description: CIDR of the OAM ONAP network
152
153   ### Private IP addresses ###
154   dns_ip_addr:
155     type: string
156   dcae_ip_addr:
157     type: string
158   aai1_k8s_ip_addr:
159     type: string
160   aai2_k8s_ip_addr:
161     type: string
162   mr_k8s_ip_addr:
163     type: string
164   policy_k8s_ip_addr:
165     type: string
166   sdc_k8s_ip_addr:
167     type: string
168   openo_k8s_ip_addr:
169     type: string
170
171   ###########################
172   #                         #
173   # Parameters used by DCAE #
174   #                         #
175   ###########################
176
177   dnsaas_config_enabled:
178     type: string
179     description: whether the DNSaaS configuration section is enabled
180
181   dnsaas_region:
182     type: string
183     description: the region of the cloud instance providing the Designate DNS as a Service
184
185   dnsaas_keystone_url:
186     type: string
187     description: the keystone URL of the cloud instance providing the Designate DNS as a Service
188
189   dnsaas_username:
190     type: string
191     description: the username of the cloud instance providing the Designate DNS as a Service
192
193   dnsaas_password:
194     type: string
195     description: the password of the cloud instance providing the Designate DNS as a Service
196
197   dnsaas_tenant_name:
198     type: string
199     description: the name of the tenant in the cloud instance providing the Designate DNS as a Service
200
201   dcae_keystone_url:
202     type: string
203     description: the keystone URL for DCAE to use (via MultiCloud)
204
205   dcae_private_key:
206     type: string
207     description: the private key of the key-apir used between the DCAE bootstrap container and DCAE VMs
208
209   dcae_public_key:
210     type: string
211     description: the prublic key of the key-apir used between the DCAE bootstrap container and DCAE VMs
212
213   dcae_centos_7_image:
214     type: string
215     description: the id/name of the CentOS 7 VM imange
216
217   dcae_domain:
218     type: string
219     description: the top level domain to register DCAE VMs (the zone will be random-str.dcae_domain)
220
221   dcae_docker:
222     type: string
223
224
225 #############
226 #           #
227 # RESOURCES #
228 #           #
229 #############
230
231 resources:
232   random-str:
233     type: OS::Heat::RandomString
234     properties:
235       length: 4
236
237   # Public key used to access ONAP components
238   vm_key:
239     type: OS::Nova::KeyPair
240     properties:
241       name:
242         str_replace:
243           template: base_rand
244           params:
245             base: { get_param: key_name }
246             rand: { get_resource: random-str }
247       public_key: { get_param: pub_key }
248       save_private_key: false
249
250
251   # ONAP security group
252   onap_sg:
253     type: OS::Neutron::SecurityGroup
254     properties:
255       name:
256         str_replace:
257           template: base_rand
258           params:
259             base: onap_sg
260             rand: { get_resource: random-str }
261       description: security group used by ONAP
262       rules:
263         # All egress traffic
264         - direction: egress
265           ethertype: IPv4
266         - direction: egress
267           ethertype: IPv6
268         # ingress traffic
269         # ICMP
270         - protocol: icmp
271         - protocol: udp
272           port_range_min: 1
273           port_range_max: 65535
274         - protocol: tcp
275           port_range_min: 1
276           port_range_max: 65535
277
278   # ONAP management private network
279   oam_onap:
280     type: OS::Neutron::Net
281     properties:
282       name:
283         str_replace:
284           template: oam_onap_rand
285           params:
286             rand: { get_resource: random-str }
287
288   oam_onap_subnet:
289     type: OS::Neutron::Subnet
290     properties:
291       name:
292         str_replace:
293           template: oam_onap_rand
294           params:
295             rand: { get_resource: random-str }
296       network_id: { get_resource: oam_onap }
297       cidr: { get_param: oam_network_cidr }
298       dns_nameservers: { get_param: dns_list }
299
300   router:
301     type: OS::Neutron::Router
302     properties:
303       external_gateway_info:
304         network: { get_param: public_net_id }
305
306   router_interface:
307     type: OS::Neutron::RouterInterface
308     properties:
309       router_id: { get_resource: router }
310       subnet_id: { get_resource: oam_onap_subnet }
311
312   # DCAE GEN 2 Controller instantiation
313   dcae_c_private_port:
314     type: OS::Neutron::Port
315     properties:
316       network: { get_resource: oam_onap }
317       fixed_ips: [{"subnet": { get_resource: oam_onap_subnet }, "ip_address": { get_param: dcae_ip_addr }}]
318       security_groups:
319       - { get_resource: onap_sg }
320
321   dcae_c_floating_ip:
322     type: OS::Neutron::FloatingIP
323     properties:
324       floating_network_id: { get_param: public_net_id }
325       port_id: { get_resource: dcae_c_private_port }
326
327   dcae_c_vm:
328     type: OS::Nova::Server
329     properties:
330       image: { get_param: ubuntu_1604_image }
331       flavor: { get_param: flavor_small }
332       name:
333         str_replace:
334           template: base-dcae-bootstrap
335           params:
336             base: { get_param: vm_base_name }
337       key_name: { get_resource: vm_key }
338       networks:
339         - port: { get_resource: dcae_c_private_port }
340       #security_groups:
341       #  - { get_resource: onap_sg }
342       user_data_format: RAW
343       user_data:
344         str_replace:
345           params:
346             __rand_str__: { get_resource: random-str }
347             # repo related
348             __artifacts_version__: { get_param: artifacts_version }
349             __docker_version__: { get_param: dcae_docker }
350             __nexus_repo__: { get_param: nexus_repo }
351             __nexus_docker_repo__: { get_param: nexus_docker_repo }
352             __nexus_username__: { get_param: nexus_username }
353             __nexus_password__: { get_param: nexus_password }
354             # conf for the ONAP environment where the DCAE bootstrap vm/conatiner runs
355             __mac_addr__: { get_attr: [dcae_c_private_port, mac_address] }
356             __dcae_ip_addr__: { get_param: dcae_ip_addr }
357             __dcae_float_ip__: { get_attr: [dcae_c_floating_ip, floating_ip_address] }
358             __dns_ip_addr__: { get_param: dns_ip_addr }
359             __external_dns__: { get_param: external_dns }
360             __dns_forwarder__: { get_param: dns_forwarder }
361             __dcae_domain__: { get_param: dcae_domain }
362             # conf for VMs DCAE is to bringup
363             __openstack_keystone_url__: { get_param: keystone_url }
364             __dcae_keystone_url__: { get_param: dcae_keystone_url }
365             __dcaeos_cloud_env__: { get_param: cloud_env }
366             __dcaeos_keystone_url__: { get_param: dcae_keystone_url }
367             __dcaeos_region__: { get_param: openstack_region }
368             __dcaeos_tenant_id__: { get_param: openstack_tenant_id }
369             __dcaeos_tenant_name__: { get_param: openstack_tenant_name }
370             __dcaeos_security_group__:
371               str_replace:
372                 template: 'onap_sg_rand'
373                 params:
374                   rand: { get_resource: random-str }
375             #__dcaeos_security_group__: { get_attr: [onap_sg, name] }
376             __dcaeos_username__: { get_param: openstack_username }
377             __dcaeos_password__: { get_param: openstack_api_key }
378             __dcaeos_key_name__: { get_resource: vm_key }
379             __dcaeos_public_key__: { get_param: dcae_public_key }
380             __dcaeos_private_key__: { get_param: dcae_private_key }
381             __dcaeos_private_network_name__: { get_attr: [oam_onap, name] }
382             __dcaeos_public_network_name__: { get_param: public_net_name }
383             __dcaeos_ubuntu_1604_image__: { get_param: ubuntu_1604_image }
384             __dcaeos_centos_7_image__: { get_param: dcae_centos_7_image }
385             __dcaeos_flavor_id__: { get_param: flavor_medium }
386             __dcaeos_flavor_id_cdap__: { get_param: flavor_large }
387             __dcaeos_dnsaas_config_enabled__: { get_param: dnsaas_config_enabled }
388             __dcaeos_dnsaas_region__: { get_param: dnsaas_region }
389             __dcaeos_dnsaas_keystone_url__: { get_param: dnsaas_keystone_url }
390             __dnsaas_tenant_name__: { get_param: dnsaas_tenant_name }
391             __dcaeos_dnsaas_username__: { get_param: dnsaas_username }
392             __dcaeos_dnsaas_password__: { get_param: dnsaas_password }
393             # fixed private IPs
394             __mr_ip_addr__:
395               str_replace:
396                 template: { get_param: mr_k8s_ip_addr }
397                 params:
398                   __rand_str__: { get_resource: random-str }
399             __policy_ip_addr__:
400               str_replace:
401                 template: { get_param: policy_k8s_ip_addr }
402                 params:
403                   __rand_str__: { get_resource: random-str }
404             __sdc_ip_addr__:
405               str_replace:
406                 template: { get_param: sdc_k8s_ip_addr }
407                 params:
408                   __rand_str__: { get_resource: random-str }
409             __openo_ip_addr__:
410               str_replace:
411                 template: { get_param: openo_k8s_ip_addr }
412                 params:
413                   __rand_str__: { get_resource: random-str }
414             __aai1_ip_addr__:
415               str_replace:
416                 template: { get_param: aai1_k8s_ip_addr }
417                 params:
418                   __rand_str__: { get_resource: random-str }
419             __aai2_ip_addr__:
420               str_replace:
421                 template: { get_param: aai2_k8s_ip_addr }
422                 params:
423                   __rand_str__: { get_resource: random-str }
424             # floating IPs
425             __dns_floating_ip_addr__: { get_param: dns_ip_addr }
426             __aai1_floating_ip_addr__:
427               str_replace:
428                 template: { get_param: aai1_k8s_ip_addr }
429                 params:
430                   __rand_str__: { get_resource: random-str }
431             __aai2_floating_ip_addr__:
432               str_replace:
433                 template: { get_param: aai1_k8s_ip_addr }
434                 params:
435                   __rand_str__: { get_resource: random-str }
436             __mrouter_floating_ip_addr__:
437               str_replace:
438                 template: { get_param: mr_k8s_ip_addr }
439                 params:
440                   __rand_str__: { get_resource: random-str }
441             __sdc_floating_ip_addr__:
442               str_replace:
443                 template: { get_param: sdc_k8s_ip_addr }
444                 params:
445                   __rand_str__: { get_resource: random-str }
446             __policy_floating_ip_addr__:
447               str_replace:
448                 template: { get_param: policy_k8s_ip_addr }
449                 params:
450                   __rand_str__: { get_resource: random-str }
451             __openo_floating_ip_addr__:
452               str_replace:
453                 template: { get_param: openo_k8s_ip_addr }
454                 params:
455                   __rand_str__: { get_resource: random-str }
456             __dcae_c_floating_ip_addr__: { get_attr: [dcae_c_floating_ip, floating_ip_address] }
457
458           template: |
459             #!/bin/bash
460
461             # Create configuration files
462             mkdir -p /opt/config
463             echo "__rand_str__" > /opt/config/dcae_zone.txt
464             echo "__rand_str__" > /opt/config/rand_str.txt
465             # repo related
466             echo "__docker_version__" > /opt/config/docker_version.txt
467             echo "__artifacts_version__" > /opt/config/artifacts_version.txt
468             echo "__nexus_repo__" > /opt/config/nexus_repo.txt
469             echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
470             echo "__nexus_username__" > /opt/config/nexus_username.txt
471             echo "__nexus_password__" > /opt/config/nexus_password.txt
472             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
473             # conf for the ONAP environment where the DCAE bootstrap vm/conatiner runs
474             echo "__mac_addr__" > /opt/config/mac_addr.txt
475             echo "__dcae_ip_addr__" > /opt/config/dcae_ip_addr.txt
476             echo "__dcae_float_ip__" > /opt/config/dcae_float_ip.txt
477             echo "__dns_ip_addr__" > /opt/config/dns_ip_addr.txt
478             echo "__external_dns__" > /opt/config/external_dns.txt
479             echo "__dns_forwarder__" > /opt/config/dns_forwarder.txt  
480             echo "__dcae_domain__" > /opt/config/dcae_domain.txt
481             # conf for the OpenStack env where DCAE is deployed
482             echo "__openstack_keystone_url__" > /opt/config/openstack_keystone_url.txt
483             echo "__dcaeos_cloud_env__" > /opt/config/cloud_env.txt
484             echo "__dcaeos_keystone_url__" > /opt/config/keystone_url.txt
485             echo "__dcaeos_region__" > /opt/config/openstack_region.txt
486             echo "__dcaeos_tenant_id__" > /opt/config/tenant_id.txt
487             echo "__dcaeos_tenant_name__" > /opt/config/tenant_name.txt
488             echo "__dcaeos_username__" > /opt/config/openstack_user.txt
489             echo "__dcaeos_password__" > /opt/config/openstack_password.txt
490             echo "__dcaeos_key_name__" > /opt/config/key_name.txt
491             echo "__dcaeos_public_key__" > /opt/config/pub_key.txt
492             echo "__dcaeos_private_key__" > /opt/config/priv_key
493             echo "__dcaeos_private_network_name__" > /opt/config/openstack_private_network_name.txt
494             echo "__dcaeos_public_network_name__" > /opt/config/public_net_name.txt
495             echo "__dcaeos_public_network_name__" > /opt/config/public_net_id.txt
496             echo "__dcaeos_ubuntu_1604_image__" > /opt/config/ubuntu_1604_image.txt
497             echo "__dcaeos_centos_7_image__" > /opt/config/centos_7_image.txt
498             echo "__dcaeos_security_group__" > /opt/config/security_group.txt
499             echo "__dcaeos_flavor_id__" > /opt/config/flavor_id.txt
500             echo "__dcaeos_flavor_id_cdap__" > /opt/config/flavor_id_cdap.txt
501             echo "__dcaeos_dnsaas_config_enabled__" > /opt/config/dnsaas_config_enabled.txt
502             echo "__dcaeos_dnsaas_region__" > /opt/config/dnsaas_region.txt
503             echo "__dcaeos_dnsaas_keystone_url__" > /opt/config/dnsaas_keystone_url.txt
504             echo "__dnsaas_tenant_name__" > /opt/config/dnsaas_tenant_name.txt
505             echo "__dcaeos_dnsaas_username__" > /opt/config/dnsaas_username.txt
506             echo "__dcaeos_dnsaas_password__" > /opt/config/dnsaas_password.txt
507             # fixed private IP addresses of other ONAP components
508             echo "__mr_ip_addr__" > /opt/config/mr_ip_addr.txt
509             echo "__policy_ip_addr__" > /opt/config/policy_ip_addr.txt
510             echo "__sdc_ip_addr__" > /opt/config/sdc_ip_addr.txt
511             echo "__openo_ip_addr__" > /opt/config/openo_ip_addr.txt
512             echo "__aai1_ip_addr__" > /opt/config/aai1_ip_addr.txt
513             echo "__aai2_ip_addr__" > /opt/config/aai2_ip_addr.txt
514             # floating IPs
515             echo "__dns_floating_ip_addr__" > /opt/config/dns_floating_ip_addr.txt
516             echo "__aai1_floating_ip_addr__" > /opt/config/aai1_floating_ip_addr.txt
517             echo "__aai2_floating_ip_addr__" > /opt/config/aai2_floating_ip_addr.txt
518             echo "__mrouter_floating_ip_addr__" > /opt/config/mrouter_floating_ip_addr.txt
519             echo "__sdc_floating_ip_addr__" > /opt/config/sdc_floating_ip_addr.txt
520             echo "__policy_floating_ip_addr__" > /opt/config/policy_floating_ip_addr.txt
521             echo "__openo_floating_ip_addr__" > /opt/config/openo_floating_ip_addr.txt
522             echo "__dcae_c_floating_ip_addr__" > /opt/config/dcae_c_floating_ip_addr.txt
523
524             # Download and run install script
525             curl -k __nexus_repo__/org.onap.demo/boot/__artifacts_version__/dcae2_install.sh -o /opt/dcae2_install.sh
526             cd /opt
527             chmod +x dcae2_install.sh
528             ./dcae2_install.sh > /tmp/dcae2_install.log 2>&1
529
530 outputs:
531   dcae_floating_ip:
532     description: DCAE Boostrap container external IP Address
533     value: { get_attr: [ dcae_c_floating_ip, floating_ip_address ] }
534   random_string:
535     description: Random generated string identifing this deployment
536     value: {get_attr: [random-str, value]}