196450029aac486a7b3dae927e38dbbe481d8e4a
[dcaegen2/platform/blueprints.git] / blueprints / k8s-tca.yaml-template
1 #
2 # ============LICENSE_START====================================================
3 # =============================================================================
4 # Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
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 description: >
22   This blueprint deploys/manages the TCA module as a Docker container
23
24 imports:
25   - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml
26   - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/k8splugin/1.4.12/k8splugin_types.yaml
27 inputs:
28   aaiEnrichmentHost:
29     type: string
30     default: "aai.onap.svc.cluster.local"
31   aaiEnrichmentPort:
32     type: string
33     default: "8443"
34   enableAAIEnrichment:
35     type: string
36     default: true
37   dmaap_host:
38     type: string
39     default: message-router.onap.svc.cluster.local
40   dmaap_port:
41     type: string
42     default: "3904"
43   enableRedisCaching:
44     type: string
45     default: false
46   redisHosts:
47     type: string
48     default: dcae-redis.onap.svc.cluster.local:6379
49   tag_version:
50     type: string
51     default: "{{ ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_releases }}/onap/org.onap.dcaegen2.deployments.tca-cdap-container:1.0.0"
52   consul_host:
53     type: string
54     default: consul-server.onap.svc.cluster.local
55   consul_port:
56     type: string
57     default: "8500"
58   cbs_host:
59     type: string
60     default: "config-binding-service.dcae.svc.cluster.local"
61   cbs_port:
62     type: string
63     default: "10000"
64   policy_id:
65     type: string
66     default: "none"
67   external_port:
68     type: string
69     description: Kubernetes node port on which CDAPgui is exposed
70     default: "32010"
71
72 node_templates:
73   tca_k8s:
74     type: dcae.nodes.ContainerizedPlatformComponent
75     properties:
76         name: 'dcae-tca-analytics'
77         dns_name: 'dcae-tca-analytics'
78         image:
79           get_input: tag_version
80         log_info:
81           log_directory: "/opt/app/TCAnalytics/logs"
82         application_config:
83             app_config:
84                 appDescription: DCAE Analytics Threshold Crossing Alert Application
85                 appName: dcae-tca
86                 tcaAlertsAbatementTableName: TCAAlertsAbatementTable
87                 tcaAlertsAbatementTableTTLSeconds: '1728000'
88                 tcaSubscriberOutputStreamName: TCASubscriberOutputStream
89                 tcaVESAlertsTableName: TCAVESAlertsTable
90                 tcaVESAlertsTableTTLSeconds: '1728000'
91                 tcaVESMessageStatusTableName: TCAVESMessageStatusTable
92                 tcaVESMessageStatusTableTTLSeconds: '86400'
93                 thresholdCalculatorFlowletInstances: '2'
94             app_preferences:
95                 aaiEnrichmentHost:
96                     get_input: aaiEnrichmentHost
97                 aaiEnrichmentIgnoreSSLCertificateErrors: 'true'
98                 aaiEnrichmentPortNumber: '8443'
99                 aaiEnrichmentProtocol: https
100                 aaiEnrichmentUserName: dcae@dcae.onap.org
101                 aaiEnrichmentUserPassword: demo123456!
102                 aaiVMEnrichmentAPIPath: /aai/v11/search/nodes-query
103                 aaiVNFEnrichmentAPIPath: /aai/v11/network/generic-vnfs/generic-vnf
104                 enableAAIEnrichment:
105                     get_input: enableAAIEnrichment
106                 enableRedisCaching:
107                     get_input: enableRedisCaching
108                 redisHosts:
109                     get_input: redisHosts
110                 enableAlertCEFFormat: 'false'
111                 publisherContentType: application/json
112                 publisherHostName:
113                     get_input: dmaap_host
114                 publisherHostPort:
115                     get_input: dmaap_port
116                 publisherMaxBatchSize: '1'
117                 publisherMaxRecoveryQueueSize: '100000'
118                 publisherPollingInterval: '20000'
119                 publisherProtocol: http
120                 publisherTopicName: unauthenticated.DCAE_CL_OUTPUT
121                 subscriberConsumerGroup: OpenDCAE-c12
122                 subscriberConsumerId: c12
123                 subscriberContentType: application/json
124                 subscriberHostName:
125                     get_input: dmaap_host
126                 subscriberHostPort:
127                     get_input: dmaap_port
128                 subscriberMessageLimit: '-1'
129                 subscriberPollingInterval: '30000'
130                 subscriberProtocol: http
131                 subscriberTimeoutMS: '-1'
132                 subscriberTopicName: unauthenticated.VES_MEASUREMENT_OUTPUT
133                 tca_policy: '{"domain":"measurementsForVfScaling","metricsPerEventName":[{"eventName":"vFirewallBroadcastPackets","controlLoopSchemaType":"VNF","policyScope":"DCAE","policyName":"DCAE.Config_tca-hi-lo","policyVersion":"v0.0.1","thresholds":[{"closedLoopControlName":"ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a","version":"1.0.2","fieldPath":"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedTotalPacketsDelta","thresholdValue":300,"direction":"LESS_OR_EQUAL","severity":"MAJOR","closedLoopEventStatus":"ONSET"},{"closedLoopControlName":"ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a","version":"1.0.2","fieldPath":"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedTotalPacketsDelta","thresholdValue":700,"direction":"GREATER_OR_EQUAL","severity":"CRITICAL","closedLoopEventStatus":"ONSET"}]},{"eventName":"vLoadBalancer","controlLoopSchemaType":"VM","policyScope":"DCAE","policyName":"DCAE.Config_tca-hi-lo","policyVersion":"v0.0.1","thresholds":[{"closedLoopControlName":"ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3","version":"1.0.2","fieldPath":"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedTotalPacketsDelta","thresholdValue":300,"direction":"GREATER_OR_EQUAL","severity":"CRITICAL","closedLoopEventStatus":"ONSET"}]},{"eventName":"Measurement_vGMUX","controlLoopSchemaType":"VNF","policyScope":"DCAE","policyName":"DCAE.Config_tca-hi-lo","policyVersion":"v0.0.1","thresholds":[{"closedLoopControlName":"ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e","version":"1.0.2","fieldPath":"$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value","thresholdValue":0,"direction":"EQUAL","severity":"MAJOR","closedLoopEventStatus":"ABATED"},{"closedLoopControlName":"ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e","version":"1.0.2","fieldPath":"$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value","thresholdValue":0,"direction":"GREATER","severity":"CRITICAL","closedLoopEventStatus":"ONSET"}]}]}'
134     interfaces:
135       cloudify.interfaces.lifecycle:
136         start:
137           inputs:
138             envs:
139                 DMAAPHOST:
140                     { get_input: dmaap_host }
141                 DMAAPPORT:
142                     { get_input: dmaap_port }
143                 DMAAPPUBTOPIC: "unauthenticated.DCAE_CL_OUTPUT"
144                 DMAAPSUBTOPIC: "unauthenticated.VES_MEASUREMENT_OUTPUT"
145                 AAIHOST:
146                     { get_input: aaiEnrichmentHost }
147                 AAIPORT:
148                     { get_input: aaiEnrichmentPort }
149                 CONSUL_HOST:
150                     { get_input: consul_host }
151                 CONSUL_PORT:
152                     { get_input: consul_port }
153                 CBS_HOST:
154                     { get_input: cbs_host }
155                 CBS_PORT:
156                     { get_input: cbs_port }
157                 CONFIG_BINDING_SERVICE: "config_binding_service"
158             ports:
159               - concat: ["11011:", { get_input: external_port }]
160