Add pm-mapper deployment artifacts
[dcaegen2/services/pm-mapper.git] / dpo / blueprints / k8s-pm-mapper.yaml
1 #
2 # ============LICENSE_START=======================================================
3 #  Copyright (C) 2019 Nordix Foundation.
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 #
17 # SPDX-License-Identifier: Apache-2.0
18 # ============LICENSE_END=========================================================
19 #
20
21 tosca_definitions_version: cloudify_dsl_1_3
22
23 imports:
24   - "http://www.getcloudify.org/spec/cloudify/3.4/types.yaml"
25   - "https://nexus.onap.org/service/local/repositories/raw/content/org.onap.dcaegen2.platform.plugins/R3/k8splugin/1.4.4/k8splugin_types.yaml"
26
27 inputs:
28   service_name:
29     type: string
30     description: Name of the serice
31     default: "pm-mapper"
32   tag_version:
33     type: string
34     description: Docker image to be used
35     default: "nexus3.onap.org:10001/onap/org.onap.dcaegen2.services.pm-mapper:1.0-SNAPSHOT"
36   replicas:
37     type: integer
38     description: Number of instances
39     default: 1
40   aaf_username:
41     type: string
42     description: AAF user name
43     default: "username"
44   aaf_password:
45     type: string
46     description: AAF password
47     default: "password"
48   client_role:
49     type: string
50     description: Client role to request secure access to topic
51     default: "ves-publisher"
52   client_id:
53     type: string
54     description: Client id for given AAF client
55     default: "ves-pub-1"
56   dmaap_dr_username:
57     type: string
58     description: dmaap datarouter user name
59     default: "username"
60   dmaap_dr_password:
61     type: string
62     description: dmaap datarouter password
63     default: "password"
64   dcae_location:
65     type: string
66     description: DCAE location for the subscriber, used to set up routing
67     default: "location"
68   subscriber_id:
69     type: string
70     description: Subscriber id in Data Router
71     default: ""
72   dmaap_buscontroller_service_host:
73     type: string
74     description: DMAAP Bus Controller host address
75     default: "dmaap-bc.onap.svc.cluster.local"
76   dmaap_buscontroller_service_port:
77     type: string
78     description: DMAAP bus Controller host port
79     default: "8080"
80   dmaap_dr_feed_id:
81     type: string
82     description: ID of the data router feed that the PM Mapper will subscribe to
83     default: "1"
84   dmaap_dr_service_host:
85     type: string
86     description: DMAAP Data Router host address
87     default: "dmaap-dr-node.onap.svc.cluster.local"
88   dmaap_dr_service_port:
89     type: string
90     description: DMAAP Data Router host port
91     default: "8443"
92   dmaap_mr_service_host:
93     type: string
94     description: DMAAP Data Router host address
95     default: "message-router.onap.svc.cluster.local"
96   dmaap_mr_service_port:
97     type: string
98     description: DMAAP Data Router host port
99     default: "3904"
100   dmaap_mr_topic_name:
101     type: string
102     description: Name of MR topic events will be published to
103     default: "pm-mapper-ves"
104   filter:
105     type: string
106     description: PM mapper filter on measInfo, measInfoId, measType, instanceId
107     default: "{ \"filters\":[]}"
108
109 node_templates:
110   pm-mapper:
111     interfaces:
112       cloudify.interfaces.lifecycle:
113         start:
114           inputs:
115             ports:
116               - '8080:0'
117     properties:
118       application_config:
119         buscontroller_feed_subscription_endpoint:
120           { concat: ["http://", { get_input: dmaap_buscontroller_service_host },
121                      ":", { get_input: dmaap_buscontroller_service_port}, "/webapi/dr_subs"]}
122         dmaap_dr_feed_id:
123           get_input: dmaap_dr_feed_id
124         dmaap_dr_delete_endpoint:
125           { concat: ["http://", { get_input: dmaap_dr_service_host },
126                      ":", { get_input: dmaap_dr_service_port}, "/delete"]}
127         filters:
128           get_input: filter
129         streams_subscribes:
130           dmaap_subscriber:
131             type:
132               "data_router"
133             dmaap_info:
134               username:
135                 get_input: dmaap_dr_username
136               password:
137                 get_input: dmaap_dr_password
138               location:
139                 get_input: dcae_location
140               subscriber_id:
141                 get_input: subscriber_id
142               delivery_url:
143                 { concat: ["http://", { get_input: service_name }, ".onap.svc.cluster.local",
144                            ":8081/delivery"]}
145         streams_publishes:
146           dmaap_publisher:
147             aaf_username:
148               get_input: aaf_username
149             aaf_password:
150               get_input: aaf_password
151             type:
152               "message_router"
153             dmaap_info:
154               client_role:
155                 get_input: client_role
156               client_id:
157                 get_input: client_id
158               topic_url:
159                 { concat: ["http://", { get_input: dmaap_mr_service_host },
160                            ":", { get_input: dmaap_mr_service_port }, "/events/", { get_input: dmaap_mr_topic_name }]}
161               location:
162                 get_input: dcae_location
163       docker_config:
164         healthcheck:
165           endpoint: /healthcheck
166           interval: 15s
167           timeout: 1s
168           type: http
169       image:
170         get_input: tag_version
171       replicas: { get_input: replicas }
172       name: { get_input: service_name }
173       dns_name: { get_input: service_name }
174       log_info:
175         log_directory: "/var/log/ONAP/dcaegen2/services/pm-mapper"
176     type: dcae.nodes.ContainerizedPlatformComponent