[DCAE] INFO.yaml update
[dcaegen2/platform/blueprints.git] / blueprints / k8s-heartbeat.yaml
1 # ============LICENSE_START====================================================
2 # =============================================================================
3 # Copyright (C) 2019-2021 AT&T
4 # Copyright (C) 2020 Wipro Limited
5 # =============================================================================
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
9 #
10 #      http://www.apache.org/licenses/LICENSE-2.0
11 #
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17 # ============LICENSE_END======================================================
18
19 tosca_definitions_version: cloudify_dsl_1_3
20
21 imports:
22   - https://www.getcloudify.org/spec/cloudify/4.5.5/types.yaml
23   - plugin:k8splugin?version=>=3.4.3,<4.0.0
24   - plugin:pgaas?version=1.3.0
25
26
27 inputs:
28   tag_version:
29     type: string
30     default: 'nexus3.onap.org:10001/onap/org.onap.dcaegen2.services.heartbeat:2.3.1'
31   heartbeat_name:
32     type: string
33     default: 'dcae-heartbeat-service'
34   replicas:
35     type: integer
36     description: number of instances
37     default: 1
38   host_port:
39     type: integer
40     description: Network port that the platform service is expecting to expose on the host
41     default: 30223
42   container_port:
43     type: integer
44     description: Network port that the platform service exposes in the container
45     default: 10002
46   consul_host:
47     type: string
48     description: Consul endpoint address
49     default: 'consul-server.onap'
50   consul_port:
51     type: integer
52     description: Consul endpoint port
53     default: 8500
54   CBS_polling_allowed:
55     type: string
56     default: 'True'
57   CBS_polling_interval:
58     type: string
59     default: '300'
60   consumerID:
61     type: string
62     default: '1'
63   groupID:
64     type: string
65     default: 'hbgrpID'
66   namespace:
67     type: string
68     default: 'onap'
69   pgaas_cluster_name:
70     type: string
71     description: pg cluster
72     default: "dcae-pg-primary.onap"
73   pg_dbName:
74     type: string
75     default: 'heartbeat'
76   ves_heartbeat_publish_url:
77     type: string
78     default: 'http://message-router.onap.svc.cluster.local:3904/events/unauthenticated.SEC_HEARTBEAT_OUTPUT'
79   dcae_CL_publish_url:
80     type: string
81     default: 'http://message-router.onap.svc.cluster.local:3904/events/unauthenticated.DCAE_CL_OUTPUT'
82 node_templates:
83   hbpgaas:
84     type: dcae.nodes.pgaas.database
85     properties:
86       writerfqdn: { get_input: pgaas_cluster_name }
87       name: { get_input: pg_dbName}
88       use_existing: false
89
90   heartbeat:
91     interfaces:
92       cloudify.interfaces.lifecycle:
93         start:
94           inputs:
95             envs:
96               CBS_polling_allowed:
97                 get_input: CBS_polling_allowed
98               CBS_polling_interval: "300"
99               consumerID: "1"
100               groupID:
101                 get_input: groupID
102               pg_ipAddress:
103                 { get_attribute: [ hbpgaas, admin, host ] }
104               pg_passwd:
105                 { get_attribute: [ hbpgaas, admin, password ] }
106               pg_portNum:
107                 { get_attribute: [ hbpgaas, admin, port ] }
108               pg_userName:
109                 { get_attribute: [ hbpgaas, admin, user ] }
110               pg_dbName:
111                 get_input: pg_dbName
112             ports:
113               - "10002:0"
114
115     properties:
116       application_config:
117         CBS_polling_allowed:
118           get_input: CBS_polling_allowed
119         CBS_polling_interval:
120           get_input: CBS_polling_interval
121         consumerID:
122           get_input: consumerID
123         groupID:
124           get_input: groupID
125         pg_ipAddress:
126           { get_attribute: [ hbpgaas, admin, host ] }
127         pg_passwd:
128            { get_attribute: [ hbpgaas, admin, password ] }
129         pg_portNum:
130            { get_attribute: [ hbpgaas, admin, port ] }
131         pg_userName:
132            { get_attribute: [ hbpgaas, admin, user ] }
133         pg_dbName:
134           get_input: pg_dbName
135         heartbeat_config: '{"vnfs": [{"eventName": "Heartbeat_vDNS","heartbeatcountmissed": 3,"heartbeatinterval": 60,"closedLoopControlName": "ControlLoopEvent1",     "policyVersion": "1.0.0.5",     "policyName":"vFireWall","policyScope": "resource=sampleResource,type=sampletype,CLName=sampleCLName","target_type": "VNF",        "target": "genVnfName", "version": "1.0"}, {"eventName": "Heartbeat_vFW","heartbeatcountmissed": 3,     "heartbeatinterval": 60,"closedLoopControlName": "ControlLoopEvent1","policyVersion": "1.0.0.5","policyName": "vFireWall","policyScope": "resource=sampleResource,type=sampletype,CLName=sampleCLName",    "target_type":"VNF",    "target": "genVnfName",    "version": "1.0"}, {"eventName": "Heartbeat_xx","heartbeatcountmissed": 3,      "heartbeatinterval": 60,"closedLoopControlName": "ControlLoopEvent1","policyVersion": "1.0.0.5","policyName": "vFireWall",      "policyScope": "resource=sampleResource,type=sampletype,CLName=sampleCLName","target_type": "VNF","target": "genVnfName","version": "1.0"}]}'
136         streams_publishes:
137           dcae_cl_out:
138             dmaap_info:
139              topic_url:
140                   get_input: dcae_CL_publish_url
141             type: message_router
142         streams_subscribes:
143             ves-heartbeat:
144               dmaap_info:
145                 topic_url:
146                   get_input: ves_heartbeat_publish_url
147               type: message_router
148       docker_config:
149         healthcheck:
150           type: http
151           endpoint: /
152           interval: 15s
153           timeout: 1s
154       service_component_type:
155           get_input: heartbeat_name
156       image: { get_input: tag_version }
157       replicas: { get_input: replicas }
158       log_info:
159           log_directory: '/var/log/ONAP/dcae-heartbeat-services'
160     type: dcae.nodes.ContainerizedServiceComponent
161     relationships:
162     - type: cloudify.relationships.depends_on
163       target: hbpgaas
164