Update to k8s plugin 1.1.0
[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.1.0/k8splugin_types.yaml
27   - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/dcaepolicyplugin/2.3.0/dcaepolicyplugin_types.yaml
28 inputs:
29   aaiEnrichmentHost:
30     type: string
31     default: "none"
32   aaiEnrichmentPort:
33     type: string
34     default: 8443
35   enableAAIEnrichment:
36     type: string
37     default: false
38   dmaap_host:
39     type: string
40     default: dmaap.onap-message-router
41   dmaap_port:
42     type: string
43     default: 3904
44   enableRedisCaching:
45     type: string
46   redisHosts:
47     type: string
48   tag_version:
49     type: string
50     default: "{{ ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_releases }}/onap/org.onap.dcaegen2.deployments.tca-cdap-container:1.0.0"
51   consul_host:
52     type: string
53     default: consul-server.onap-consul
54   consul_port:
55     type: string
56     default: "8500"
57   cbs_host:
58     type: string
59     default: "config-binding-service.dcae"
60   cbs_port:
61     type: string
62     default: "10000"
63   policy_id:
64     type: string
65     default: "none"
66   external_port:
67     type: string
68     description: Kubernetes node port on which CDAPgui is exposed
69     default: "32010"
70
71 node_templates:
72   tca_k8s:
73     type: dcae.nodes.ContainerizedServiceComponent
74     relationships:
75       - target: tca_policy
76         type: cloudify.relationships.depends_on
77     properties:
78         service_component_type: 'dcaegen2-analytics-tca'
79         application_config: {}
80         docker_config: {}
81         image:
82           get_input: tag_version
83         log_info:
84           log_directory: "/opt/app/TCAnalytics/logs"
85         application_config:
86             app_config:
87                 appDescription: DCAE Analytics Threshold Crossing Alert Application
88                 appName: dcae-tca
89                 tcaAlertsAbatementTableName: TCAAlertsAbatementTable
90                 tcaAlertsAbatementTableTTLSeconds: '1728000'
91                 tcaSubscriberOutputStreamName: TCASubscriberOutputStream
92                 tcaVESAlertsTableName: TCAVESAlertsTable
93                 tcaVESAlertsTableTTLSeconds: '1728000'
94                 tcaVESMessageStatusTableName: TCAVESMessageStatusTable
95                 tcaVESMessageStatusTableTTLSeconds: '86400'
96                 thresholdCalculatorFlowletInstances: '2'
97             app_preferences:
98                 aaiEnrichmentHost:
99                     get_input: aaiEnrichmentHost
100                 aaiEnrichmentIgnoreSSLCertificateErrors: 'true'
101                 aaiEnrichmentPortNumber: '8443'
102                 aaiEnrichmentProtocol: https
103                 aaiEnrichmentUserName: DCAE
104                 aaiEnrichmentUserPassword: DCAE
105                 aaiVMEnrichmentAPIPath: /aai/v11/search/nodes-query
106                 aaiVNFEnrichmentAPIPath: /aai/v11/network/generic-vnfs/generic-vnf
107                 enableAAIEnrichment:
108                     get_input: enableAAIEnrichment
109                 enableRedisCaching:
110                     get_input: enableRedisCaching
111                 redisHosts:
112                     get_input: redisHosts
113                 enableAlertCEFFormat: 'false'
114                 publisherContentType: application/json
115                 publisherHostName:
116                     get_input: dmaap_host
117                 publisherHostPort:
118                     get_input: dmaap_port
119                 publisherMaxBatchSize: '1'
120                 publisherMaxRecoveryQueueSize: '100000'
121                 publisherPollingInterval: '20000'
122                 publisherProtocol: http
123                 publisherTopicName: unauthenticated.DCAE_CL_OUTPUT
124                 subscriberConsumerGroup: OpenDCAE-c12
125                 subscriberConsumerId: c12
126                 subscriberContentType: application/json
127                 subscriberHostName:
128                     get_input: dmaap_host
129                 subscriberHostPort:
130                     get_input: dmaap_port
131                 subscriberMessageLimit: '-1'
132                 subscriberPollingInterval: '30000'
133                 subscriberProtocol: http
134                 subscriberTimeoutMS: '-1'
135                 subscriberTopicName: unauthenticated.SEC_MEASUREMENT_OUTPUT
136                 tca_policy_default: '{"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.vNicUsageArray[*].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.vNicUsageArray[*].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.vNicUsageArray[*].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"}]}]}'
137         service_component_type: dcaegen2-analytics_tca
138     interfaces:
139       cloudify.interfaces.lifecycle:
140         start:
141           inputs:
142             envs:
143                 DMAAPHOST:
144                     { get_input: dmaap_host }
145                 DMAAPPORT:
146                     { get_input: dmaap_port }
147                 DMAAPPUBTOPIC: "unauthenticated.DCAE_CL_OUTPUT"
148                 DMAAPSUBTOPIC: "unauthenticated.SEC_MEASUREMENT_OUTPUT"
149                 AAIHOST:
150                     { get_input: aaiEnrichmentHost }
151                 AAIPORT:
152                     { get_input: aaiEnrichmentPort }
153                 CONSUL_HOST:
154                     { get_input: consul_host }
155                 CONSUL_PORT:
156                     { get_input: consul_port }
157                 CBS_HOST:
158                     { get_input: cbs_host }
159                 CBS_PORT:
160                     { get_input: cbs_port }
161                 CONFIG_BINDING_SERVICE: "config_binding_service"
162             ports:
163               - concat: ["11011:", { get_input: external_port }]
164   tca_policy:
165     type: dcae.nodes.policy
166     properties:
167       policy_id:
168            get_input: policy_id
169