655753556ca07fe5ff28a39edb1bd9342c81291e
[dcaegen2/platform/blueprints.git] / blueprints / k8s-holmes-engine.yaml
1 # -*- indent-tabs-mode: nil -*- # vi: set expandtab:
2 #
3 # ============LICENSE_START====================================================
4 # =============================================================================
5 # Copyright (c) 2017-2020 AT&T Intellectual Property. All rights reserved.
6 # Copyright (c) 2020 Nokia 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 #
12 #      http://www.apache.org/licenses/LICENSE-2.0
13 #
14 # Unless required by applicable law or agreed to in writing, software
15 # distributed under the License is distributed on an "AS IS" BASIS,
16 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 # See the License for the specific language governing permissions and
18 # limitations under the License.
19 # ============LICENSE_END=====================================================
20
21 tosca_definitions_version: cloudify_dsl_1_3
22 imports:
23 - https://www.getcloudify.org/spec/cloudify/4.5.5/types.yaml
24 - plugin:k8splugin?version=3.4.2
25 - plugin:dcaepolicyplugin?version=2.4.0
26 - plugin:pgaas?version=1.3.0
27 inputs:
28   dcae_CL_publish_url:
29     type: string
30     default: "http://message-router.onap:3904/events/unauthenticated.DCAE_CL_OUTPUT"
31   ves_fault_publish_url:
32     type: string
33     default: "http://message-router.onap:3904/events/unauthenticated.SEC_FAULT_OUTPUT"
34   msb_hostname:
35     type: string
36     default: "msb-iag.onap"
37   pgaas_cluster_name:
38     type: string
39     default: "dcae-pg-primary.onap"
40     # use the single-VM PG instance
41     #default: pgvm
42   database_name:
43     type: string
44     default: "holmes"
45   he_image:
46     type: string
47     default: "nexus3.onap.org:10001/onap/holmes/engine-management:1.2.9"
48   service_component_type:
49     type: string
50     default: "holmes-engine-mgmt"
51   service_id:
52     type: string
53     default: "holmes-engine-mgmt"
54   service_component_name_override:
55     type: string
56     default: "holmes-engine-mgmt"
57   dcae-analytics-holmes-engine-mgt_cpu_limit:
58     type: string
59     default: "500m"
60   dcae-analytics-holmes-engine-mgt_cpu_request:
61     type: string
62     default: "500m"
63   dcae-analytics-holmes-engine-mgt_memory_limit:
64     type: string
65     default: "1024Mi"
66   dcae-analytics-holmes-engine-mgt_memory_request:
67     type: string
68     default: "256Mi"
69 node_templates:
70   pgaasvm:
71     type: dcae.nodes.pgaas.database
72     properties:
73       #writerfqdn: { concat: [ { get_input: pgaas_cluster_name }, '-write.' ] }
74       writerfqdn: { get_input: pgaas_cluster_name }
75       name: { get_input: database_name }
76       use_existing: true
77
78   holmesengine:
79     type: dcae.nodes.ContainerizedServiceComponent
80     interfaces:
81       cloudify.interfaces.lifecycle:
82         start:
83           inputs:
84            envs:
85             URL_JDBC:
86                 { get_attribute: [ pgaasvm, admin, host ] }
87             JDBC_PASSWORD:
88                 { get_attribute: [ pgaasvm, admin, password ] }
89             JDBC_USERNAME:
90                 { get_attribute: [ pgaasvm, admin, user ] }
91             MSB_ADDR:
92                 get_input: msb_hostname
93            ports:
94              - '9102:0'
95     properties:
96       service_component_type: { get_input: service_component_type }
97       service_id: { get_input: service_id }
98       service_component_name_override: { get_input: service_component_name_override }
99       application_config:
100         msb.hostname:
101          get_input: msb_hostname
102         msb.uri: /api/microservices/v1/services
103         services_calls: {}
104         streams_publishes:
105           dcae_cl_out:
106             dmaap_info:
107              topic_url:
108                   get_input: dcae_CL_publish_url
109             type: message_router
110         streams_subscribes:
111           ves_fault:
112             dmaap_info:
113              topic_url:
114                   get_input: ves_fault_publish_url
115             type: message_router
116       image: { get_input: he_image }
117       # need to use truncated name!!
118       #service_component_type: dcae-analytics-holmes-engin-management
119       resource_config:
120         limits:
121           cpu:
122             get_input: dcae-analytics-holmes-engine-mgt_cpu_limit
123           memory:
124             get_input: dcae-analytics-holmes-engine-mgt_memory_limit
125         requests:
126           cpu:
127             get_input: dcae-analytics-holmes-engine-mgt_cpu_request
128           memory:
129             get_input: dcae-analytics-holmes-engine-mgt_memory_request
130     relationships:
131     - type: cloudify.relationships.depends_on
132       target: pgaasvm
133