3e46d131c522a407c0077d08936f81d829b0b73f
[dcaegen2/platform/blueprints.git] / blueprints / k8s-pmsh.yaml
1 #
2 # ============LICENSE_START=======================================================
3 #  Copyright (C) 2020 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/4.5.5/types.yaml'
25   - plugin:k8splugin?version=>=3.4.3,<4.0.0
26   - plugin:pgaas?version=1.3.0
27 inputs:
28   tag_version:
29     type: string
30     description: Docker image to be used
31     default: 'nexus3.onap.org:10001/onap/org.onap.dcaegen2.services.pmsh:1.1.2'
32   replicas:
33     type: integer
34     description: Number of instances
35     default: 1
36   operational_policy_name:
37     type: string
38     default: 'pmsh-operational-policy'
39   control_loop_name:
40     type: string
41     default: 'pmsh-control-loop'
42   pmsh_publish_topic_name:
43     type: string
44     default: 'unauthenticated.DCAE_CL_OUTPUT'
45   policy_feedback_topic_name:
46     type: string
47     default: 'unauthenticated.PMSH_CL_INPUT'
48   aai_notification_topic_name:
49     type: string
50     default: 'AAI-EVENT'
51   publisher_client_role:
52     type: string
53     description: Client role to request secure access to topic
54     default: 'org.onap.dcae.pmPublisher'
55   subscriber_client_role:
56     type: string
57     description: Client role to request secure access to topic
58     default: 'org.onap.dcae.pmSubscriber'
59   dcae_location:
60     type: string
61     description: DCAE location for the subscriber, used to set up routing
62     default: 'san-francisco'
63   cpu_limit:
64     type: string
65     default: '1000m'
66   cpu_request:
67     type: string
68     default: '1000m'
69   memory_limit:
70     type: string
71     default: '1024Mi'
72   memory_request:
73     type: string
74     default: '1024Mi'
75   pgaas_cluster_name:
76     type: string
77     default: 'dcae-pg-primary.onap'
78   enable_tls:
79     type: boolean
80     default: true
81   protocol:
82     type: string
83     description: PMSH protocol. If enable_tls is false, set to http
84     default: 'https'
85 node_templates:
86   pgaasvm:
87     type: dcae.nodes.pgaas.database
88     properties:
89       writerfqdn: { get_input: pgaas_cluster_name }
90       name: 'pmsh'
91   pmsh:
92     type: dcae.nodes.ContainerizedServiceComponentUsingDmaap
93     interfaces:
94       cloudify.interfaces.lifecycle:
95         create:
96           inputs:
97             ports:
98               - '8443:0'
99             envs:
100               PMSH_PG_URL:
101                 { get_attribute: [ pgaasvm, admin, host ] }
102               PMSH_PG_PASSWORD:
103                 { get_attribute: [ pgaasvm, admin, password ] }
104               PMSH_PG_USERNAME:
105                 { get_attribute: [ pgaasvm, admin, user ] }
106               PMSH_DB_NAME:
107                 { get_attribute: [ pgaasvm, admin, database ] }
108
109     relationships:
110       - type: cloudify.relationships.depends_on
111         target: pgaasvm
112
113     properties:
114       service_component_type: 'dcae-pmsh'
115       service_component_name_override: 'dcae-pmsh'
116       application_config:
117         enable_tls: { get_input: enable_tls }
118         aaf_identity: 'dcae@dcae.onap.org'
119         aaf_password: 'demo123456!'
120         operational_policy_name: { get_input: operational_policy_name }
121         control_loop_name: { get_input: control_loop_name }
122         cert_path: '/opt/app/pmsh/etc/certs/cert.pem'
123         key_path: '/opt/app/pmsh/etc/certs/key.pem'
124         ca_cert_path: '/opt/app/pmsh/etc/certs/cacert.pem'
125         streams_publishes:
126           policy_pm_publisher:
127             type: message_router
128             dmaap_info:
129               topic_url: {concat: ["https://message-router:3905/events/", { get_input: pmsh_publish_topic_name }]}
130         streams_subscribes:
131           policy_pm_subscriber:
132             type: message_router
133             dmaap_info:
134               topic_url: {concat: ["https://message-router:3905/events/", { get_input: policy_feedback_topic_name }]}
135           aai_subscriber:
136             type: message_router
137             dmaap_info:
138               topic_url: {concat: ["https://message-router:3905/events/", { get_input: aai_notification_topic_name }]}
139       resource_config:
140         limits:
141           cpu: { get_input: cpu_limit }
142           memory: { get_input: memory_limit }
143         requests:
144           cpu: { get_input: cpu_request }
145           memory: { get_input: memory_request }
146       docker_config:
147         healthcheck:
148           endpoint: /healthcheck
149           interval: 15s
150           timeout: 1s
151           type: { get_input: protocol }
152       image: { get_input: tag_version }
153       replicas: { get_input: replicas }
154       log_info:
155         log_directory: '/var/log/ONAP/dcaegen2/services/pmsh'
156       tls_info:
157         cert_directory: '/opt/app/pmsh/etc/certs'
158         use_tls: { get_input: enable_tls }