From 98b9f73205e8339f9afd14d5a744ab8f743180e9 Mon Sep 17 00:00:00 2001 From: Jack Lucas Date: Mon, 26 Mar 2018 19:52:32 -0400 Subject: Add service components Change-Id: I9c4c2270a27b50881166ef41f532f6a237f69fc5 Issue-ID: DCAEGEN2-411 Signed-off-by: Jack Lucas --- blueprints/k8s-holmes-engine.yaml-template | 100 +++++++++++++++++++++++++++++ blueprints/k8s-holmes-rules.yaml-template | 82 +++++++++++++++++++++++ blueprints/k8s-tca.yaml-template | 80 +++++++++++++++++++++++ blueprints/k8s-ves.yaml-template | 99 ++++++++++++++++++++++++++++ 4 files changed, 361 insertions(+) create mode 100644 blueprints/k8s-holmes-engine.yaml-template create mode 100644 blueprints/k8s-holmes-rules.yaml-template create mode 100644 blueprints/k8s-tca.yaml-template create mode 100644 blueprints/k8s-ves.yaml-template diff --git a/blueprints/k8s-holmes-engine.yaml-template b/blueprints/k8s-holmes-engine.yaml-template new file mode 100644 index 0000000..0ec3f0f --- /dev/null +++ b/blueprints/k8s-holmes-engine.yaml-template @@ -0,0 +1,100 @@ +# -*- indent-tabs-mode: nil -*- # vi: set expandtab: +# +# ============LICENSE_START==================================================== +# org.onap.dcae +# ============================================================================= +# Copyright (c) 2017-2018 AT&T Intellectual Property. All rights reserved. +# ============================================================================= +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END===================================================== + +tosca_definitions_version: cloudify_dsl_1_3 +imports: +- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/k8splugin/1.0.0/k8splugin_types.yaml" +- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/dcaepolicyplugin/2.1.0/dcaepolicyplugin_types.yaml" +- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/pgaas/pgaas_types.yaml" +inputs: + dcae_CL_publish_url: + type: string + default: "http://10.0.11.1:3904/events/unauthenticated.DCAE_CL_OUTPUT" + ves_fault_publish_url: + type: string + default: "http://10.0.11.1:3904/events/unauthenticated.SEC_FAULT_OUTPUT" + msb_hostname: + type: string + default: "" + pgaas_cluster_name: + type: string + # use the single-VM PG instance + default: pgvm + database_name: + type: string + default: holmes + he_image: + type: string + default: "{{ ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_releases }}/onap/holmes/engine-management:v1.0.0" + +node_templates: + pgaasvm: + type: dcae.nodes.pgaas.database + properties: + writerfqdn: { concat: [ { get_input: pgaas_cluster_name }, '-write.' ] } + name: { get_input: database_name } + use_existing: true + + holmesengine: + type: dcae.nodes.ContainerizedServiceComponentUsingDmaap + interfaces: + cloudify.interfaces.lifecycle: + start: + inputs: + envs: + URL_JDBC: + { get_attribute: [ pgaasvm, admin, host ] } + JDBC_PASSWORD: + { get_attribute: [ pgaasvm, admin, password ] } + JDBC_USERNAME: + { get_attribute: [ pgaasvm, admin, user ] } + MSB_ADDR: + get_input: msb_hostname + properties: + application_config: + msb.hostname: + get_input: msb_hostname + msb.uri: /api/microservices/v1/services + services_calls: {} + streams_publishes: + dcae_cl_out: + dmaap_info: + topic_url: + get_input: dcae_CL_publish_url + type: message_router + streams_subscribes: + ves_fault: + dmaap_info: + topic_url: + get_input: ves_fault_publish_url + type: message_router + docker_config: + healthcheck: + endpoint: /api/holmes-engine-mgmt/v1/healthcheck + interval: 15s + timeout: 1s + type: http + ports: + - 9102:0 + image: { get_input: he_image } + service_component_type: dcae-analytics-holmes-engine-management + relationships: + - type: cloudify.relationships.depends_on + target: pgaasvm diff --git a/blueprints/k8s-holmes-rules.yaml-template b/blueprints/k8s-holmes-rules.yaml-template new file mode 100644 index 0000000..09203d3 --- /dev/null +++ b/blueprints/k8s-holmes-rules.yaml-template @@ -0,0 +1,82 @@ +# -*- indent-tabs-mode: nil -*- # vi: set expandtab: +# +# ============LICENSE_START==================================================== +# org.onap.dcae +# ============================================================================= +# Copyright (c) 2017-2018 AT&T Intellectual Property. All rights reserved. +# ============================================================================= +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END===================================================== + +tosca_definitions_version: cloudify_dsl_1_3 +imports: +- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/k8splugin/1.0.0/k8splugin_types.yaml" +- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/dcaepolicyplugin/2.1.0/dcaepolicyplugin_types.yaml" +- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/pgaas/pgaas_types.yaml" +inputs: + msb_hostname: + type: string + default: "" + pgaas_cluster_name: + type: string + # use the single-VM PG instance + default: pgvm + database_name: + type: string + default: holmes + hr_image: + type: string + default: ""{{ ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_releases }}/onap/holmes/rule-management:v1.0.0" +node_templates: + pgaasvm: + type: dcae.nodes.pgaas.database + properties: + writerfqdn: { concat: [ { get_input: pgaas_cluster_name }, '-write.' ] } + name: { get_input: database_name } + holmesrules: + type: dcae.nodes.ContainerizedServiceComponentUsingDmaap + interfaces: + cloudify.interfaces.lifecycle: + start: + inputs: + envs: + URL_JDBC: + { get_attribute: [ pgaasvm, admin, host ] } + JDBC_PASSWORD: + { get_attribute: [ pgaasvm, admin, password ] } + JDBC_USERNAME: + { get_attribute: [ pgaasvm, admin, user ] } + MSB_ADDR: + get_input: msb_hostname + properties: + application_config: + holmes.default.rule.volte.scenario1: "ControlLoop-VOLTE-2179b738-fd36-4843-a71a-a8c24c70c55b$$$package org.onap.holmes.droolsRule;\n\nimport org.onap.holmes.common.dmaap.DmaapService;\nimport org.onap.holmes.common.api.stat.VesAlarm;\nimport org.onap.holmes.common.aai.CorrelationUtil;\nimport org.onap.holmes.common.dmaap.entity.PolicyMsg;\nimport org.onap.holmes.common.dropwizard.ioc.utils.ServiceLocatorHolder;\nimport org.onap.holmes.common.utils.DroolsLog;\n \n\nrule \"Relation_analysis_Rule\"\nsalience 200\nno-loop true\n when\n $root : VesAlarm(alarmIsCleared == 0,\n $sourceId: sourceId, sourceId != null && !sourceId.equals(\"\"),\n\t\t\t$sourceName: sourceName, sourceName != null && !sourceName.equals(\"\"),\n\t\t\t$startEpochMicrosec: startEpochMicrosec,\n eventName in (\"Fault_MultiCloud_VMFailure\"),\n $eventId: eventId)\n $child : VesAlarm( eventId != $eventId, parentId == null,\n CorrelationUtil.getInstance().isTopologicallyRelated(sourceId, $sourceId, $sourceName),\n eventName in (\"Fault_MME_eNodeB out of service alarm\"),\n startEpochMicrosec < $startEpochMicrosec + 60000 && startEpochMicrosec > $startEpochMicrosec - 60000 )\n then\n\t\tDroolsLog.printInfo(\"===========================================================\");\n\t\tDroolsLog.printInfo(\"Relation_analysis_Rule: rootId=\" + $root.getEventId() + \", childId=\" + $child.getEventId());\n\t\t$child.setParentId($root.getEventId());\n\t\tupdate($child);\n\t\t\nend\n\nrule \"root_has_child_handle_Rule\"\nsalience 150\nno-loop true\n\twhen\n\t\t$root : VesAlarm(alarmIsCleared == 0, rootFlag == 0, $eventId: eventId)\n\t\t$child : VesAlarm(eventId != $eventId, parentId == $eventId)\n\tthen\n\t\tDroolsLog.printInfo(\"===========================================================\");\n\t\tDroolsLog.printInfo(\"root_has_child_handle_Rule: rootId=\" + $root.getEventId() + \", childId=\" + $child.getEventId());\n\t\tDmaapService dmaapService = ServiceLocatorHolder.getLocator().getService(DmaapService.class);\n\t\tPolicyMsg policyMsg = dmaapService.getPolicyMsg($root, $child, \"org.onap.holmes.droolsRule\");\n dmaapService.publishPolicyMsg(policyMsg, \"unauthenticated.DCAE_CL_OUTPUT\");\n\t\t$root.setRootFlag(1);\n\t\tupdate($root);\nend\n\nrule \"root_no_child_handle_Rule\"\nsalience 100\nno-loop true\n when\n $root : VesAlarm(alarmIsCleared == 0, rootFlag == 0,\n sourceId != null && !sourceId.equals(\"\"),\n\t\t\tsourceName != null && !sourceName.equals(\"\"),\n eventName in (\"Fault_MultiCloud_VMFailure\"))\n then\n\t\tDroolsLog.printInfo(\"===========================================================\");\n\t\tDroolsLog.printInfo(\"root_no_child_handle_Rule: rootId=\" + $root.getEventId());\n\t\tDmaapService dmaapService = ServiceLocatorHolder.getLocator().getService(DmaapService.class);\n\t\tPolicyMsg policyMsg = dmaapService.getPolicyMsg($root, null, \"org.onap.holmes.droolsRule\");\n dmaapService.publishPolicyMsg(policyMsg, \"unauthenticated.DCAE_CL_OUTPUT\");\n\t\t$root.setRootFlag(1);\n\t\tupdate($root);\nend\n\nrule \"root_cleared_handle_Rule\"\nsalience 100\nno-loop true\n when\n $root : VesAlarm(alarmIsCleared == 1, rootFlag == 1)\n then\n\t\tDroolsLog.printInfo(\"===========================================================\");\n\t\tDroolsLog.printInfo(\"root_cleared_handle_Rule: rootId=\" + $root.getEventId());\n\t\tDmaapService dmaapService = ServiceLocatorHolder.getLocator().getService(DmaapService.class);\n\t\tPolicyMsg policyMsg = dmaapService.getPolicyMsg($root, null, \"org.onap.holmes.droolsRule\");\n dmaapService.publishPolicyMsg(policyMsg, \"unauthenticated.DCAE_CL_OUTPUT\");\n\t\tretract($root);\nend\n\nrule \"child_handle_Rule\"\nsalience 100\nno-loop true\n when\n $child : VesAlarm(alarmIsCleared == 1, rootFlag == 0)\n then\n\t\tDroolsLog.printInfo(\"===========================================================\");\n\t\tDroolsLog.printInfo(\"child_handle_Rule: childId=\" + $child.getEventId());\n\t\tretract($child);\nend" + msb.hostname: + get_input: msb_hostname + msb.uri: /api/microservices/v1/services + services_calls: {} + streams_publishes: {} + streams_subscribes: {} + docker_config: + healthcheck: + endpoint: /api/holmes-rule-mgmt/v1/healthcheck + interval: 15s + timeout: 1s + type: http + ports: + - 9101:0 + image: { get_input: hr_image } + service_component_type: dcae-analytics-holmes-rule-management + relationships: + - type: cloudify.relationships.depends_on + target: pgaasvm diff --git a/blueprints/k8s-tca.yaml-template b/blueprints/k8s-tca.yaml-template new file mode 100644 index 0000000..faff504 --- /dev/null +++ b/blueprints/k8s-tca.yaml-template @@ -0,0 +1,80 @@ +# -*- indent-tabs-mode: nil -*- # vi: set expandtab: +# +# ============LICENSE_START========================================== +# org.onap.dcae +# =================================================================== +# Copyright © 2018 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END============================================ +# +# ECOMP and OpenECOMP are trademarks +# and service marks of AT&T Intellectual Property. +# + +tosca_definitions_version: cloudify_dsl_1_3 + +description: > + This blueprint deploys/manages the TCA module as a Docker container + +imports: + - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/k8splugin/1.0.0/k8splugin_types.yaml + +inputs: + tca_image: + type: string + default: {{ ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_releases }}/onap/org.onap.dcaegen2.deployments.tca-cdap-container.tca-cdap-container:1.0.0 + dmaap_host: + type: string + default: dmaap.onap-message-router + consul_host: + type: string + default: consul-server.onap-consul + consul_port: + type: string + default: "8500" + cbs_host: + type: string + default: "config-binding-service.dcae" + cbs_port: + type: string + default: "10000" + +node_templates: + + # TCA + tca: + type: dcae.nodes.ContainerizedServiceComponent + properties: + service_component_type: 'tca' + image: 'dcae.onap.org/dcae/tca:latest' + application_config: {} + docker_config: {} + log_info: + log_directory: "/opt/app/TCAAnalytics/logs" + + interfaces: + cloudify.interfaces.lifecycle: + start: + inputs: + envs: + DMAAPHOST: { get_input: dmaap_host } + CONSUL_HOST: { get_input: consul_host } + CONSUL_PORT: { get_input: consul_port } + CBS_HOST: { get_input: cbs_host } + CBS_PORT: { get_input: cbs_port } + SERVICE_NAME: "tca" + CONFIG_BINDING_SERVICE: "config_binding_service" + ports: + - "11011:0" diff --git a/blueprints/k8s-ves.yaml-template b/blueprints/k8s-ves.yaml-template new file mode 100644 index 0000000..9ef11d4 --- /dev/null +++ b/blueprints/k8s-ves.yaml-template @@ -0,0 +1,99 @@ +# -*- indent-tabs-mode: nil -*- # vi: set expandtab: +# +# ============LICENSE_START==================================================== +# org.onap.dcae +# ============================================================================= +# Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. +# ============================================================================= +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END====================================================== + +tosca_definitions_version: cloudify_dsl_1_3 + + +imports: + - "http://www.getcloudify.org/spec/cloudify/3.4/types.yaml" + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/k8splugin/1.0.0/k8splugin_types.yaml + +inputs: + ves_other_publish_url: + type: string + default: "http://10.0.11.1:3904/events/unauthenticated.SEC_OTHER_OUTPUT" + ves_heartbeat_publish_url: + type: string + default: "http://10.0.11.1:3904/events/unauthenticated.SEC_HEARTBEAT_OUTPUT" + ves_fault_publish_url: + type: string + default: "http://10.0.11.1:3904/events/unauthenticated.SEC_FAULT_OUTPUT" + ves_measurement_publish_url: + type: string + default: "http://10.0.11.1:3904/events/unauthenticated.SEC_MEASUREMENT_OUTPUT" + tag_version: + type: string + default: {{ ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_releases }}/onap/org.onap.dcaegen2.collectors.ves.vescollector:1.1-latest + external_port: + type: string + description: Kubernetes node port on which collector is exposed + default: "0" + +node_templates: + + ves: + interfaces: + cloudify.interfaces.lifecycle: + start: + inputs: + ports: + - concat: ["8080:", { get_input: external_port }] + properties: + always_pull_image: True + application_config: + collector.dmaap.streamid: fault=ves_fault|syslog=ves_syslog|heartbeat=ves_heartbeat|measurementsForVfScaling=ves_measurement|mobileFlow=ves_mobileflow|other=ves_other|stateChange=ves_statechange|thresholdCrossingAlert=ves_thresholdCrossingAlert|voiceQuality=ves_voicequality|sipSignaling=ves_sipsignaling + collector.inputQueue.maxPending: "8096" + collector.keystore.alias: "dynamically generated" + collector.keystore.file.location: /opt/app/VESCollector/etc/keystore + collector.keystore.passwordfile: /opt/app/VESCollector/etc/passwordfile + collector.schema.checkflag: "1" + collector.schema.file: "{\"v1\":\"./etc/CommonEventFormat_27.2.json\",\"v2\":\"./etc/CommonEventFormat_27.2.json\",\"v3\":\"./etc/CommonEventFormat_27.2.json\",\"v4\":\"./etc/CommonEventFormat_27.2.json\",\"v5\":\"./etc/CommonEventFormat_28.4.json\"}" + collector.service.port: "8080" + collector.service.secure.port: "8443" + event.transform.flag: "0" + header.authflag: "0" + header.authlist: "userid1,base64encodepwd1|userid2,base64encodepwd2" + services_calls: [] + streams_publishes: + ves_fault: + dmaap_info: + topic_url: + get_input: ves_fault_publish_url + type: message_router + ves_measurement: + dmaap_info: + topic_url: + get_input: ves_measurement_publish_url + type: message_router + tomcat.maxthreads: "200" + docker_config: + healthcheck: + endpoint: /healthcheck + interval: 15s + timeout: 1s + type: http + image: + get_input: tag_version + log_info: + log_directory: "/opt/app/VESCollector/logs/ecomp" + + service_component_type: dcaegen2-collectors-ves + + type: dcae.nodes.ContainerizedServiceComponentUsingDmaap -- cgit 1.2.3-korg