41523a2b887ec836641fd6d0626cddfc436dfeb5
[dcaegen2/platform/blueprints.git] / blueprints / k8s-slice-analysis-ms.yaml
1  #
2  #============LICENSE_START=======================================================
3  #Copyright (C) 2020 Wipro Limited.
4  #==============================================================================
5  #Licensed under the Apache License, Version 2.0 (the "License");
6  #you may not use this file except in compliance with the License.
7  #You may obtain a copy of the License at
8  #
9  #    http://www.apache.org/licenses/LICENSE-2.0
10  #
11  #Unless required by applicable law or agreed to in writing, software
12  #distributed under the License is distributed on an "AS IS" BASIS,
13  #WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  #See the License for the specific language governing permissions and
15  #limitations under the License.
16  #============LICENSE_END=========================================================
17
18 tosca_definitions_version: cloudify_dsl_1_3
19 imports:
20   - https://www.getcloudify.org/spec/cloudify/4.5.5/types.yaml
21   - plugin:k8splugin?version=3.4.2
22   - plugin:pgaas?version=1.3.0
23 inputs:
24   replicas:
25     type: integer
26     description: replica count for deployment
27     default: 1
28   tag_version:
29     type: string
30     description: docker image name and version
31     default: "nexus3.onap.org:10001/onap/org.onap.dcaegen2.services.components.slice-analysis-ms:1.0.1"
32   pgaas_cluster_name:
33     type: string
34     description: pg cluster
35     default: "dcae-pg-primary.onap"
36   database_name:
37     type: string
38     description: database name
39     default: "sliceanalysisms"
40   aaf_username:
41     type: string
42     description: aaf username
43     default: "dcae@dcae.onap.org"
44   aaf_password:
45     type: string
46     description: aaf password
47     default: "demo123456!"
48   dmaap_polling_interval:
49     type: integer
50     description: dmaap polling interval
51     default: 20
52   cbs_polling_interval:
53     type: integer
54     description: cbs polling interval
55     default: 60
56   dmaap_polling_timeout:
57     type: integer
58     description: dmaap polling timeout
59     default: 60
60   namespace:
61     type: string
62     description: namespace
63     default: "onap"
64   dmaap:
65     type: string
66     description: dmaap server
67     default: "message-router"
68   buffer_time:
69     type: integer
70     description: buffer time
71     default: 60
72   cg:
73     type: string
74     description: consumer group
75     default: "sliceanalysisms-cg"
76   cid:
77     type: string
78     description: consumer id
79     default: "sliceanalysisms-cid"
80   config_db:
81     type: string
82     description: config db location
83     default: "http://config-db:8080"
84   log_path:
85     type: string
86     description: log location in host
87     default: "/dockerdata-nfs/slice-analysis-ms"
88   performance_management_topic_url:
89     type: string
90     description: performance measurement topic url
91     default: "https://message-router.onap.svc.cluster.local:3905/events/org.onap.dmaap.mr.PERFORMANCE_MEASUREMENTS"
92   intelligent_slicing_topic_url:
93     type: string
94     description: aai event topic url
95     default: "https://message-router.onap.svc.cluster.local:3905/events/unauthenticated.ML_RESPONSE_TOPIC"
96   dcae_cl_response_topic_url:
97     type: string
98     description: dcae control loop response topic url
99     default: "https://message-router.onap.svc.cluster.local:3905/events/DCAE_CL_RSP"
100   dcae_cl_topic_url:
101     type: string
102     description: dcae control loop topic url
103     default: "https://message-router.onap.svc.cluster.local:3905/events/unauthenticated.DCAE_CL_OUTPUT"
104   samples:
105     type: integer
106     description: number of samples to be considered for processing
107     default: 3
108   minimumPercentageChange:
109     type: integer
110     description: minimum change above which control loop should be triggered
111     default: 5
112   initialDelaySeconds:
113     type: integer
114     description: delay for the consumer thread
115     default: 120000
116 node_templates:
117   pgaasvm:
118     type: dcae.nodes.pgaas.database
119     properties:
120       writerfqdn: { get_input: pgaas_cluster_name }
121       name: { get_input: database_name }
122       use_existing: false
123
124   sliceanalysisms:
125     type: dcae.nodes.ContainerizedServiceComponent
126     interfaces:
127       cloudify.interfaces.lifecycle:
128         start:
129           inputs:
130             envs:
131               STANDALONE: "false"
132             ports:
133               - "8080:0"
134             volumes:
135               - host:
136                   path: { get_input: log_path }
137                 container:
138                   bind: /home/sliceanalysisms/logs
139                   mode: rw
140     properties:
141       image:
142         get_input: tag_version
143       service_component_type: 'dcae-slice-analysis-ms'
144       service_id: 'sliceanalysisms'
145       always_pull_image: true
146       replicas: {get_input: replicas}
147       docker_config:
148         healthcheck:
149           endpoint: /healthcheck
150           interval: 15s
151           timeout: 1s
152           type: http
153       tls_info:
154         cert_directory: '/opt/app/sliceanalysisms/etc/cert/'
155         use_tls: true
156       application_config:
157         aafUsername: { get_input: aaf_username }
158         aafPassword: { get_input: aaf_password }
159         trust_store_path: '/opt/app/sliceanalysisms/etc/cert/trust.jks'
160         trust_store_pass_path: '/opt/app/sliceanalysisms/etc/cert/trust.pass'
161         streams_subscribes:
162           performance_management_topic:
163             aaf_username: { get_input: aaf_username }
164             aaf_password: { get_input: aaf_password }
165             dmaap_info:
166               topic_url: { get_input: performance_management_topic_url }
167             type: message-router
168           intelligent_slicing_topic:
169             aaf_username: { get_input: aaf_username }
170             aaf_password: { get_input: aaf_password }
171             dmaap_info:
172               topic_url: { get_input: intelligent_slicing_topic_url }
173             type: message-router
174           dcae_cl_response_topic:
175             aaf_username: { get_input: aaf_username }
176             aaf_password: { get_input: aaf_password }
177             dmaap_info:
178               topic_url: { get_input: dcae_cl_response_topic_url }
179             type: message-router
180         streams_publishes:
181           CL_topic:
182             aaf_username: { get_input: aaf_username }
183             aaf_password: { get_input: aaf_password }
184             dmaap_info:
185               topic_url: { get_input: dcae_cl_topic_url }
186             type: message-router
187         postgres.host: { get_attribute: [ pgaasvm, admin, host ] }
188         postgres.port: { get_attribute: [ pgaasvm, admin, port ] }
189         postgres.username: { get_attribute: [ pgaasvm, admin, user ] }
190         postgres.password: { get_attribute: [ pgaasvm, admin, password ] }
191         sliceanalysisms.pollingInterval: { get_input: dmaap_polling_interval}
192         sliceanalysisms.pollingTimeout: { get_input: dmaap_polling_timeout }
193         cbsPollingInterval: { get_input: cbs_polling_interval }
194         sliceanalysisms.dmaap.server:
195           - { get_input: dmaap }
196         sliceanalysisms.cg: { get_input: cg }
197         sliceanalysisms.cid: { get_input: cid }
198         sliceanalysisms.configDb.service: { get_input: config_db }
199         sliceanalysisms.samples: { get_input: samples }
200         sliceanalysisms.minPercentageChange: { get_input: minimumPercentageChange }
201         sliceanalysisms.initialDelaySeconds: { get_input: initialDelaySeconds }
202     relationships:
203       - type: cloudify.relationships.depends_on
204         target: pgaasvm