[DCAE] Update k8s blueprint to support 1.3.1 Version of PMSH MS
[dcaegen2/platform/blueprints.git] / blueprints / k8s-pmsh.yaml
1 #
2 # ============LICENSE_START=======================================================
3 #  Copyright (C) 2020-2021 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.3.1'
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         pmsh_policy:
126           subscription:
127             subscriptionName: ExtraPM-All-gNB-R2B
128             administrativeState: LOCKED
129             fileBasedGP: 15
130             fileLocation: "/pm/pm.xml"
131             nfFilter: { "nfNames": [ "^pnf.*","^vnf.*" ],"modelInvariantIDs": [ ],"modelVersionIDs": [ ],"modelNames": [ ] }
132             measurementGroups: [ { "measurementGroup": { "measurementTypes": [ { "measurementType": "countera" },{ "measurementType": "counterb" } ],"managedObjectDNsBasic": [ { "DN": "dna" },{ "DN": "dnb" } ] } },{ "measurementGroup": { "measurementTypes": [ { "measurementType": "counterc" },{ "measurementType": "counterd" } ],"managedObjectDNsBasic": [ { "DN": "dnc" },{ "DN": "dnd" } ] } } ]
133         streams_publishes:
134           policy_pm_publisher:
135             type: message_router
136             dmaap_info:
137               topic_url: {concat: ["https://message-router:3905/events/", { get_input: pmsh_publish_topic_name }]}
138         streams_subscribes:
139           policy_pm_subscriber:
140             type: message_router
141             dmaap_info:
142               topic_url: {concat: ["https://message-router:3905/events/", { get_input: policy_feedback_topic_name }]}
143           aai_subscriber:
144             type: message_router
145             dmaap_info:
146               topic_url: {concat: ["https://message-router:3905/events/", { get_input: aai_notification_topic_name }]}
147       resource_config:
148         limits:
149           cpu: { get_input: cpu_limit }
150           memory: { get_input: memory_limit }
151         requests:
152           cpu: { get_input: cpu_request }
153           memory: { get_input: memory_request }
154       docker_config:
155         healthcheck:
156           endpoint: /healthcheck
157           interval: 15s
158           timeout: 1s
159           type: { get_input: protocol }
160       image: { get_input: tag_version }
161       replicas: { get_input: replicas }
162       log_info:
163         log_directory: '/var/log/ONAP/dcaegen2/services/pmsh'
164       tls_info:
165         cert_directory: '/opt/app/pmsh/etc/certs'
166         use_tls: { get_input: enable_tls }