From bad772074d0bfd4c4dcb7bdd2cbe9ca7246fc28e Mon Sep 17 00:00:00 2001 From: Jack Lucas Date: Mon, 3 Feb 2020 18:21:29 -0500 Subject: Move k8s-bootstrap container to blueprints repo Cleanup of unnecessary input templates and other files Use non-templatized blueprints instead of blueprint templates Copy blueprints from blueprints/ directory into image Move reference_templates to top-level directory Issue-ID: DCAEGEN2-2041 Signed-off-by: Jack Lucas Change-Id: Ib846a96a4995eb97383f63ff764705e6277a24b0 --- .gitignore | 5 + Dockerfile-template | 63 ++ README.md | 36 + blueprints/k8s-helm-override.yaml | 75 ++ blueprints/k8s-helm-override.yaml-template | 75 -- blueprints/k8s-helm.yaml | 60 ++ blueprints/k8s-helm.yaml-template | 60 -- blueprints/k8s-holmes-engine.yaml | 101 ++ blueprints/k8s-holmes-engine.yaml-template | 101 -- blueprints/k8s-holmes-rules.yaml | 81 ++ blueprints/k8s-holmes-rules.yaml-template | 81 -- blueprints/k8s-hv-ves.yaml | 126 +++ blueprints/k8s-hv-ves.yaml-template | 126 --- blueprints/k8s-pgaas-initdb.yaml | 72 ++ blueprints/k8s-pgaas-initdb.yaml-template | 72 -- blueprints/k8s-prh.yaml | 152 +++ blueprints/k8s-prh.yaml-template | 152 --- blueprints/k8s-snmptrap.yaml | 120 +++ blueprints/k8s-snmptrap.yaml-template | 120 --- blueprints/k8s-tca-clampnode.yaml | 175 ++++ blueprints/k8s-tca-clampnode.yaml-template | 175 ---- blueprints/k8s-tca-policynode.yaml | 172 ++++ blueprints/k8s-tca-policynode.yaml-template | 172 ---- blueprints/k8s-tca.yaml | 165 +++ blueprints/k8s-tca.yaml-template | 165 --- blueprints/k8s-ves.yaml | 130 +++ blueprints/k8s-ves.yaml-template | 130 --- blueprints/pom.xml | 174 ---- .../DeploymentHandler-README.md | 23 - .../DeploymentHandler.yaml-template | 102 -- .../reference_templates/DockerBP.yaml-template | 345 ------- blueprints/reference_templates/README.txt | 52 - .../reference_templates/cdap-sdk.yaml-template | 71 -- .../reference_templates/cdap_broker.yaml-template | 97 -- .../reference_templates/cdapbp7.yaml-template | 1054 -------------------- .../reference_templates/centos_vm.yaml-template | 243 ----- .../config_binding_service.yaml-template | 62 -- .../consul_cluster.yaml-template | 384 ------- .../heartbeat-service.yaml-template | 61 -- .../holmes-engine.yaml-template | 98 -- .../reference_templates/holmes-rules.yaml-template | 81 -- .../reference_templates/inventory.yaml-template | 196 ---- .../k8s-dashboard.yaml-template | 119 --- .../k8s-datafile-collector.yaml-template | 124 --- .../k8s-pgaas-database.yaml-template | 57 -- .../k8s-pgaas-getdbinfo.yaml-template | 99 -- .../pgaas-cluster.yaml-template | 435 -------- .../pgaas-database.yaml-template | 63 -- .../reference_templates/pgaas-disk.yaml-template | 123 --- .../pgaas-getdbinfo.yaml-template | 92 -- .../reference_templates/pgaas-onevm.yaml-template | 300 ------ blueprints/reference_templates/pgaas.yaml-template | 412 -------- .../policy_handler.yaml-template | 70 -- .../reference_templates/prh-service.yaml-template | 61 -- .../snmptrap-collector.yaml-template | 95 -- blueprints/reference_templates/tca.yaml-template | 92 -- .../tcadocker-service.yaml-template | 192 ---- .../reference_templates/test_dr_mr.yaml-template | 121 --- .../test_dr_pubsub.yaml-template | 145 --- .../test_mr_multipub.yaml-template | 178 ---- .../test_mr_multisub.yaml-template | 186 ---- .../test_mr_pubsub.yaml-template | 89 -- .../test_mr_pubsub_extra.yaml-template | 93 -- blueprints/reference_templates/ves.yaml-template | 135 --- .../bin/check-blueprint-vs-input | 262 ----- check-blueprint-vs-input/lib/sample-inputs.yaml | 35 - .../man/check-blueprint-vs-input.1 | 50 - .../man/check-blueprint-vs-input.man | 55 - check-blueprint-vs-input/pom.xml | 250 ----- config/00-consul.json | 9 + input-templates/cdap-sdk-inputs.yaml | 22 - input-templates/cdapinputs.yaml | 35 - input-templates/datafile-collector-input.yaml | 22 - input-templates/dhinputs.yaml | 22 - input-templates/he-ip.yaml | 28 - input-templates/heartbeat-input.json | 7 - input-templates/hr-ip.yaml | 26 - input-templates/inputs.yaml | 35 - input-templates/invinputs.yaml | 27 - input-templates/phinputs.yaml | 108 -- input-templates/pom.xml | 174 ---- input-templates/prh-input.json | 7 - input-templates/prh-input.yaml | 26 - input-templates/snmptrap-input.json | 7 - input-templates/tcadocker-input.json | 11 - input-templates/tcainputs.yaml | 21 - input-templates/vesinput.yaml | 27 - mvn-phase-script.sh | 11 +- pom.xml | 117 ++- reference_templates/DeploymentHandler-README.md | 23 + .../DeploymentHandler.yaml-template | 102 ++ reference_templates/DockerBP.yaml-template | 345 +++++++ reference_templates/README.txt | 52 + reference_templates/cdap-sdk.yaml-template | 71 ++ reference_templates/cdap_broker.yaml-template | 97 ++ reference_templates/cdapbp7.yaml-template | 1054 ++++++++++++++++++++ reference_templates/centos_vm.yaml-template | 243 +++++ .../config_binding_service.yaml-template | 62 ++ reference_templates/consul_cluster.yaml-template | 384 +++++++ .../heartbeat-service.yaml-template | 61 ++ reference_templates/holmes-engine.yaml-template | 98 ++ reference_templates/holmes-rules.yaml-template | 81 ++ reference_templates/inventory.yaml-template | 196 ++++ reference_templates/k8s-dashboard.yaml-template | 119 +++ .../k8s-datafile-collector.yaml-template | 124 +++ .../k8s-pgaas-database.yaml-template | 57 ++ .../k8s-pgaas-getdbinfo.yaml-template | 99 ++ reference_templates/pgaas-cluster.yaml-template | 435 ++++++++ reference_templates/pgaas-database.yaml-template | 63 ++ reference_templates/pgaas-disk.yaml-template | 123 +++ reference_templates/pgaas-getdbinfo.yaml-template | 92 ++ reference_templates/pgaas-onevm.yaml-template | 300 ++++++ reference_templates/pgaas.yaml-template | 412 ++++++++ reference_templates/policy_handler.yaml-template | 70 ++ reference_templates/prh-service.yaml-template | 61 ++ .../snmptrap-collector.yaml-template | 95 ++ reference_templates/tca.yaml-template | 92 ++ .../tcadocker-service.yaml-template | 192 ++++ reference_templates/test_dr_mr.yaml-template | 121 +++ reference_templates/test_dr_pubsub.yaml-template | 145 +++ reference_templates/test_mr_multipub.yaml-template | 178 ++++ reference_templates/test_mr_multisub.yaml-template | 186 ++++ reference_templates/test_mr_pubsub.yaml-template | 89 ++ .../test_mr_pubsub_extra.yaml-template | 93 ++ reference_templates/ves.yaml-template | 135 +++ scripts/bootstrap.sh | 233 +++++ scripts/load-plugins.sh | 62 ++ scripts/uninstall.sh | 36 + 128 files changed, 8133 insertions(+), 9028 deletions(-) create mode 100644 .gitignore create mode 100644 Dockerfile-template create mode 100644 README.md create mode 100644 blueprints/k8s-helm-override.yaml delete mode 100644 blueprints/k8s-helm-override.yaml-template create mode 100644 blueprints/k8s-helm.yaml delete mode 100644 blueprints/k8s-helm.yaml-template create mode 100644 blueprints/k8s-holmes-engine.yaml delete mode 100644 blueprints/k8s-holmes-engine.yaml-template create mode 100644 blueprints/k8s-holmes-rules.yaml delete mode 100644 blueprints/k8s-holmes-rules.yaml-template create mode 100644 blueprints/k8s-hv-ves.yaml delete mode 100644 blueprints/k8s-hv-ves.yaml-template create mode 100644 blueprints/k8s-pgaas-initdb.yaml delete mode 100644 blueprints/k8s-pgaas-initdb.yaml-template create mode 100644 blueprints/k8s-prh.yaml delete mode 100644 blueprints/k8s-prh.yaml-template create mode 100644 blueprints/k8s-snmptrap.yaml delete mode 100644 blueprints/k8s-snmptrap.yaml-template create mode 100644 blueprints/k8s-tca-clampnode.yaml delete mode 100644 blueprints/k8s-tca-clampnode.yaml-template create mode 100644 blueprints/k8s-tca-policynode.yaml delete mode 100644 blueprints/k8s-tca-policynode.yaml-template create mode 100644 blueprints/k8s-tca.yaml delete mode 100644 blueprints/k8s-tca.yaml-template create mode 100644 blueprints/k8s-ves.yaml delete mode 100644 blueprints/k8s-ves.yaml-template delete mode 100644 blueprints/pom.xml delete mode 100644 blueprints/reference_templates/DeploymentHandler-README.md delete mode 100644 blueprints/reference_templates/DeploymentHandler.yaml-template delete mode 100644 blueprints/reference_templates/DockerBP.yaml-template delete mode 100644 blueprints/reference_templates/README.txt delete mode 100644 blueprints/reference_templates/cdap-sdk.yaml-template delete mode 100644 blueprints/reference_templates/cdap_broker.yaml-template delete mode 100644 blueprints/reference_templates/cdapbp7.yaml-template delete mode 100644 blueprints/reference_templates/centos_vm.yaml-template delete mode 100644 blueprints/reference_templates/config_binding_service.yaml-template delete mode 100644 blueprints/reference_templates/consul_cluster.yaml-template delete mode 100644 blueprints/reference_templates/heartbeat-service.yaml-template delete mode 100644 blueprints/reference_templates/holmes-engine.yaml-template delete mode 100644 blueprints/reference_templates/holmes-rules.yaml-template delete mode 100644 blueprints/reference_templates/inventory.yaml-template delete mode 100644 blueprints/reference_templates/k8s-dashboard.yaml-template delete mode 100644 blueprints/reference_templates/k8s-datafile-collector.yaml-template delete mode 100644 blueprints/reference_templates/k8s-pgaas-database.yaml-template delete mode 100644 blueprints/reference_templates/k8s-pgaas-getdbinfo.yaml-template delete mode 100644 blueprints/reference_templates/pgaas-cluster.yaml-template delete mode 100644 blueprints/reference_templates/pgaas-database.yaml-template delete mode 100644 blueprints/reference_templates/pgaas-disk.yaml-template delete mode 100644 blueprints/reference_templates/pgaas-getdbinfo.yaml-template delete mode 100644 blueprints/reference_templates/pgaas-onevm.yaml-template delete mode 100644 blueprints/reference_templates/pgaas.yaml-template delete mode 100644 blueprints/reference_templates/policy_handler.yaml-template delete mode 100644 blueprints/reference_templates/prh-service.yaml-template delete mode 100644 blueprints/reference_templates/snmptrap-collector.yaml-template delete mode 100644 blueprints/reference_templates/tca.yaml-template delete mode 100644 blueprints/reference_templates/tcadocker-service.yaml-template delete mode 100644 blueprints/reference_templates/test_dr_mr.yaml-template delete mode 100644 blueprints/reference_templates/test_dr_pubsub.yaml-template delete mode 100644 blueprints/reference_templates/test_mr_multipub.yaml-template delete mode 100644 blueprints/reference_templates/test_mr_multisub.yaml-template delete mode 100644 blueprints/reference_templates/test_mr_pubsub.yaml-template delete mode 100644 blueprints/reference_templates/test_mr_pubsub_extra.yaml-template delete mode 100644 blueprints/reference_templates/ves.yaml-template delete mode 100755 check-blueprint-vs-input/bin/check-blueprint-vs-input delete mode 100644 check-blueprint-vs-input/lib/sample-inputs.yaml delete mode 100644 check-blueprint-vs-input/man/check-blueprint-vs-input.1 delete mode 100644 check-blueprint-vs-input/man/check-blueprint-vs-input.man delete mode 100644 check-blueprint-vs-input/pom.xml create mode 100644 config/00-consul.json delete mode 100644 input-templates/cdap-sdk-inputs.yaml delete mode 100644 input-templates/cdapinputs.yaml delete mode 100644 input-templates/datafile-collector-input.yaml delete mode 100644 input-templates/dhinputs.yaml delete mode 100644 input-templates/he-ip.yaml delete mode 100644 input-templates/heartbeat-input.json delete mode 100644 input-templates/hr-ip.yaml delete mode 100644 input-templates/inputs.yaml delete mode 100644 input-templates/invinputs.yaml delete mode 100644 input-templates/phinputs.yaml delete mode 100644 input-templates/pom.xml delete mode 100644 input-templates/prh-input.json delete mode 100644 input-templates/prh-input.yaml delete mode 100644 input-templates/snmptrap-input.json delete mode 100644 input-templates/tcadocker-input.json delete mode 100644 input-templates/tcainputs.yaml delete mode 100644 input-templates/vesinput.yaml create mode 100644 reference_templates/DeploymentHandler-README.md create mode 100644 reference_templates/DeploymentHandler.yaml-template create mode 100644 reference_templates/DockerBP.yaml-template create mode 100644 reference_templates/README.txt create mode 100644 reference_templates/cdap-sdk.yaml-template create mode 100644 reference_templates/cdap_broker.yaml-template create mode 100644 reference_templates/cdapbp7.yaml-template create mode 100644 reference_templates/centos_vm.yaml-template create mode 100644 reference_templates/config_binding_service.yaml-template create mode 100644 reference_templates/consul_cluster.yaml-template create mode 100644 reference_templates/heartbeat-service.yaml-template create mode 100644 reference_templates/holmes-engine.yaml-template create mode 100644 reference_templates/holmes-rules.yaml-template create mode 100644 reference_templates/inventory.yaml-template create mode 100644 reference_templates/k8s-dashboard.yaml-template create mode 100644 reference_templates/k8s-datafile-collector.yaml-template create mode 100644 reference_templates/k8s-pgaas-database.yaml-template create mode 100644 reference_templates/k8s-pgaas-getdbinfo.yaml-template create mode 100644 reference_templates/pgaas-cluster.yaml-template create mode 100644 reference_templates/pgaas-database.yaml-template create mode 100644 reference_templates/pgaas-disk.yaml-template create mode 100644 reference_templates/pgaas-getdbinfo.yaml-template create mode 100644 reference_templates/pgaas-onevm.yaml-template create mode 100644 reference_templates/pgaas.yaml-template create mode 100644 reference_templates/policy_handler.yaml-template create mode 100644 reference_templates/prh-service.yaml-template create mode 100644 reference_templates/snmptrap-collector.yaml-template create mode 100644 reference_templates/tca.yaml-template create mode 100644 reference_templates/tcadocker-service.yaml-template create mode 100644 reference_templates/test_dr_mr.yaml-template create mode 100644 reference_templates/test_dr_pubsub.yaml-template create mode 100644 reference_templates/test_mr_multipub.yaml-template create mode 100644 reference_templates/test_mr_multisub.yaml-template create mode 100644 reference_templates/test_mr_pubsub.yaml-template create mode 100644 reference_templates/test_mr_pubsub_extra.yaml-template create mode 100644 reference_templates/ves.yaml-template create mode 100755 scripts/bootstrap.sh create mode 100755 scripts/load-plugins.sh create mode 100755 scripts/uninstall.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..aa7a830 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +.project +Dockerfile +.vscode +bootstrap-container.code-workspace +target \ No newline at end of file diff --git a/Dockerfile-template b/Dockerfile-template new file mode 100644 index 0000000..8c2e084 --- /dev/null +++ b/Dockerfile-template @@ -0,0 +1,63 @@ +# ============LICENSE_START======================================================= +# org.onap.dcae +# ================================================================================ +# Copyright (c) 2018-2020 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========================================================= + +FROM centos:7.4.1708 +LABEL maintainer="maintainer" + +ENV DCAE_REPO {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }} +ENV CCSDK_REPO {{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }} +ENV BP_REPO {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_blueprints_releases }} + +# Install gcc +RUN yum install -y gcc python-devel + +# Install Consul +RUN yum install -y unzip \ + && mkdir -p /opt/consul/bin \ + && mkdir -p /opt/consul/data \ + && mkdir -p /opt/consul/config \ + && curl -Ssf https://releases.hashicorp.com/consul/1.2.1/consul_1.2.1_linux_amd64.zip > /tmp/consul.zip \ + && unzip -pj /tmp/consul.zip > /opt/consul/bin/consul \ + && chmod +x /opt/consul/bin/consul +COPY config/00-consul.json /opt/consul/config/ + +# Install jq +RUN curl -Ssf -L "https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64" > /bin/jq \ +&& chmod +x /bin/jq + +# Install pip and Cloudify CLI (stay at version 4.2 because of changes in higher versions) +RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py \ + && python get-pip.py \ + && rm get-pip.py \ + && pip install cloudify==4.2 + +# Copy scripts +RUN mkdir scripts +COPY scripts/ /scripts + +# Get plugins from raw repos +RUN scripts/load-plugins.sh ${DCAE_REPO} ${CCSDK_REPO} \ + && rm scripts/load-plugins.sh \ +# Make sure scripts are executable + && chmod +x /scripts/*.sh + +# Load blueprints and input templates +COPY blueprints/ /blueprints + +# Set up runtime script +ENTRYPOINT exec "/scripts/bootstrap.sh" diff --git a/README.md b/README.md new file mode 100644 index 0000000..8d3a870 --- /dev/null +++ b/README.md @@ -0,0 +1,36 @@ +# DCAE Blueprints and Bootstrap Container +This repository holds the source code needed to build the +Docker image for the DCAE bootstrap container. The bootstrap +container runs at DCAE deployment time (via a Helm chart) and +does initial setup of the DCAE environment. This includes +deploying several service components using Cloudify Manager. + +This repository also holds Cloudify blueprints for service components. +The Docker build process copies these blueprints into the Docker image +for the bootstrap container. + +_Note: Prior to the Frankfurt release (R6), this repository held blueprint templates +for components deployed using Cloudify Manager. The build process for this +repository expanded the templates and pushed them to the Nexus raw +repository. The DCAE bootstrap container was hosted in the `dcaegen2.deployments` repository. The Docker build process for the bootstrap containter image pulled the blueprints it needed from the Nexus raw repository._ + +## DCAE Bootstrap Container +This container is responsible for loading plugins and wagons onto the +DCAE Cloudify Manager instance and for launching DCAE components. + +The Docker image build process loads plugins and blueprints into the +image's file system. The plugins are pulled from the Nexus raw repository. The +blueprints are copied from the `blueprints` directory in this repository. At run time, the main script in the container +(`bootstrap.sh`) uploads the plugins to Cloudify Manager, then installs +components using the blueprints. + +The container expects to be started with two environment variables: + - `CMADDR` -- the address of the target Cloudify Manager + - `CMPASS` -- the password for Cloudify Manager + +The container expects input files to use when deploying the blueprints. +It expects to find them in /inputs. The normal method for launching +the container is via a Helm Chart launched by OOM. That chart creates +a Kubernetes ConfigMap containing the input files. The ConfigMap is +mounted as a volume at /inputs. + diff --git a/blueprints/k8s-helm-override.yaml b/blueprints/k8s-helm-override.yaml new file mode 100644 index 0000000..639d2a0 --- /dev/null +++ b/blueprints/k8s-helm-override.yaml @@ -0,0 +1,75 @@ +# ============LICENSE_START========================================== +# =================================================================== +# Copyright (c) 2019 AT&T +# +# 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: + - https://www.getcloudify.org/spec/cloudify/4.5.5/types.yaml + - "https://nexus.onap.org/service/local/repositories/raw/content/org.onap.ccsdk.platform.plugins/type_files/helm/4.0.0/helm-type.yaml" + +inputs: + tiller-server-ip: + description: IP address of Kubernetes master node + tiller-server-port: + description: Nodeport of tiller server + namespace: + description: Target namespace to be installed under (requires to be new) + chart-repo-url: + default: https://nexus.onap.org/content/sites/oom-helm-staging + chart-version : + description: Chart version for identified component-name + stable-repo-url: + description: URL for stable repository + type: string + default: 'https://kubernetes-charts.storage.googleapis.com' + config-url: + default: '' + config-format: + default: 'yaml' + component-name: + description: onap component name +node_templates: + onap_env: + type: onap.nodes.component + properties: + tiller-server-ip: { get_input: tiller-server-ip } + tiller-server-port: { get_input: tiller-server-port } + component-name: onap + chart-repo-url: { get_input: chart-repo-url } + chart-version: { get_input: chart-version } + namespace: { get_input: namespace } + stable-repo-url: { get_input: stable-repo-url} + config: '{ "aaf": {"enabled": false}, "aai": {"enabled": false}, "appc": {"enabled": false}, "clamp": {"enabled": false}, "cli": {"enabled": false}, "consul": {"enabled": false}, "dcaegen2": {"enabled": false}, "dmaap": {"enabled": false}, "esr": {"enabled": false}, "log": {"enabled": false}, "sniro-emulator": {"enabled": false}, "msb": {"enabled": false}, "multicloud": {"enabled": false}, "nbi": {"enabled": false}, "oof": {"enabled": false}, "policy": {"enabled": false}, "pomba": {"enabled": false}, "portal": {"enabled": false}, "robot": {"enabled": false}, "sdc": {"enabled": false}, "sdnc": {"enabled": false}, "so": {"enabled": false}, "uui": {"enabled": false}, "vfc": {"enabled": false}, "vid": {"enabled": false}, "vnfsdk": {"enabled": false} }' + + dcaecomponent: + type: onap.nodes.component + properties: + tiller-server-ip: { get_input: tiller-server-ip } + tiller-server-port: { get_input: tiller-server-port } + component-name: { get_input: component-name } + chart-repo-url: { get_input: chart-repo-url } + chart-version: { get_input: chart-version } + namespace: { get_input: namespace } + stable-repo-url: { get_input: stable-repo-url} + config-url: { get_input: config-url} + config-format: { get_input: config-format} + relationships: + - type: cloudify.relationships.connected_to + target: onap_env +outputs: + dcaecomponent_install_status: + value: { get_attribute: [ dcaecomponent, install-status ] } + diff --git a/blueprints/k8s-helm-override.yaml-template b/blueprints/k8s-helm-override.yaml-template deleted file mode 100644 index dc53dde..0000000 --- a/blueprints/k8s-helm-override.yaml-template +++ /dev/null @@ -1,75 +0,0 @@ -# ============LICENSE_START========================================== -# =================================================================== -# Copyright (c) 2019 AT&T -# -# 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: - - https://www.getcloudify.org/spec/cloudify/4.5.5/types.yaml - - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/helm/4.0.0/helm-type.yaml" - -inputs: - tiller-server-ip: - description: IP address of Kubernetes master node - tiller-server-port: - description: Nodeport of tiller server - namespace: - description: Target namespace to be installed under (requires to be new) - chart-repo-url: - default: https://nexus.onap.org/content/sites/oom-helm-staging - chart-version : - description: Chart version for identified component-name - stable-repo-url: - description: URL for stable repository - type: string - default: 'https://kubernetes-charts.storage.googleapis.com' - config-url: - default: '' - config-format: - default: 'yaml' - component-name: - description: onap component name -node_templates: - onap_env: - type: onap.nodes.component - properties: - tiller-server-ip: { get_input: tiller-server-ip } - tiller-server-port: { get_input: tiller-server-port } - component-name: onap - chart-repo-url: { get_input: chart-repo-url } - chart-version: { get_input: chart-version } - namespace: { get_input: namespace } - stable-repo-url: { get_input: stable-repo-url} - config: '{ "aaf": {"enabled": false}, "aai": {"enabled": false}, "appc": {"enabled": false}, "clamp": {"enabled": false}, "cli": {"enabled": false}, "consul": {"enabled": false}, "dcaegen2": {"enabled": false}, "dmaap": {"enabled": false}, "esr": {"enabled": false}, "log": {"enabled": false}, "sniro-emulator": {"enabled": false}, "msb": {"enabled": false}, "multicloud": {"enabled": false}, "nbi": {"enabled": false}, "oof": {"enabled": false}, "policy": {"enabled": false}, "pomba": {"enabled": false}, "portal": {"enabled": false}, "robot": {"enabled": false}, "sdc": {"enabled": false}, "sdnc": {"enabled": false}, "so": {"enabled": false}, "uui": {"enabled": false}, "vfc": {"enabled": false}, "vid": {"enabled": false}, "vnfsdk": {"enabled": false} }' - - dcaecomponent: - type: onap.nodes.component - properties: - tiller-server-ip: { get_input: tiller-server-ip } - tiller-server-port: { get_input: tiller-server-port } - component-name: { get_input: component-name } - chart-repo-url: { get_input: chart-repo-url } - chart-version: { get_input: chart-version } - namespace: { get_input: namespace } - stable-repo-url: { get_input: stable-repo-url} - config-url: { get_input: config-url} - config-format: { get_input: config-format} - relationships: - - type: cloudify.relationships.connected_to - target: onap_env -outputs: - dcaecomponent_install_status: - value: { get_attribute: [ dcaecomponent, install-status ] } - diff --git a/blueprints/k8s-helm.yaml b/blueprints/k8s-helm.yaml new file mode 100644 index 0000000..4aed5ba --- /dev/null +++ b/blueprints/k8s-helm.yaml @@ -0,0 +1,60 @@ +# ============LICENSE_START========================================== +# =================================================================== +# Copyright (c) 2019 AT&T +# +# 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: + - https://www.getcloudify.org/spec/cloudify/4.5.5/types.yaml + - "https://nexus.onap.org/service/local/repositories/raw/content/org.onap.ccsdk.platform.plugins/type_files/helm/4.0.0/helm-type.yaml" + +inputs: + tiller-server-ip: + description: IP address of Kubernetes master node + tiller-server-port: + description: Nodeport of tiller server + namespace: + description: Target namespace to be installed under (requires to be new) + chart-repo-url: + default: https://nexus.onap.org/content/sites/oom-helm-staging + chart-version : + description: Chart version for identified component-name + stable-repo-url: + description: URL for stable repository + type: string + default: 'https://kubernetes-charts.storage.googleapis.com' + config-url: + default: '' + config-format: + default: 'yaml' + component-name: + description: onap component name +node_templates: + dcaecomponent: + type: onap.nodes.component + properties: + tiller-server-ip: { get_input: tiller-server-ip } + tiller-server-port: { get_input: tiller-server-port } + component-name: { get_input: component-name } + chart-repo-url: { get_input: chart-repo-url } + chart-version: { get_input: chart-version } + namespace: { get_input: namespace } + stable-repo-url: { get_input: stable-repo-url} + config-url: { get_input: config-url} + config-format: { get_input: config-format} +outputs: + dcaecomponent_install_status: + value: { get_attribute: [ dcaecomponent, install-status ] } + diff --git a/blueprints/k8s-helm.yaml-template b/blueprints/k8s-helm.yaml-template deleted file mode 100644 index 958f0e6..0000000 --- a/blueprints/k8s-helm.yaml-template +++ /dev/null @@ -1,60 +0,0 @@ -# ============LICENSE_START========================================== -# =================================================================== -# Copyright (c) 2019 AT&T -# -# 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: - - https://www.getcloudify.org/spec/cloudify/4.5.5/types.yaml - - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/helm/4.0.0/helm-type.yaml" - -inputs: - tiller-server-ip: - description: IP address of Kubernetes master node - tiller-server-port: - description: Nodeport of tiller server - namespace: - description: Target namespace to be installed under (requires to be new) - chart-repo-url: - default: https://nexus.onap.org/content/sites/oom-helm-staging - chart-version : - description: Chart version for identified component-name - stable-repo-url: - description: URL for stable repository - type: string - default: 'https://kubernetes-charts.storage.googleapis.com' - config-url: - default: '' - config-format: - default: 'yaml' - component-name: - description: onap component name -node_templates: - dcaecomponent: - type: onap.nodes.component - properties: - tiller-server-ip: { get_input: tiller-server-ip } - tiller-server-port: { get_input: tiller-server-port } - component-name: { get_input: component-name } - chart-repo-url: { get_input: chart-repo-url } - chart-version: { get_input: chart-version } - namespace: { get_input: namespace } - stable-repo-url: { get_input: stable-repo-url} - config-url: { get_input: config-url} - config-format: { get_input: config-format} -outputs: - dcaecomponent_install_status: - value: { get_attribute: [ dcaecomponent, install-status ] } - diff --git a/blueprints/k8s-holmes-engine.yaml b/blueprints/k8s-holmes-engine.yaml new file mode 100644 index 0000000..707d2ed --- /dev/null +++ b/blueprints/k8s-holmes-engine.yaml @@ -0,0 +1,101 @@ +# -*- indent-tabs-mode: nil -*- # vi: set expandtab: +# +# ============LICENSE_START==================================================== +# ============================================================================= +# 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: +- https://www.getcloudify.org/spec/cloudify/4.5.5/types.yaml +- "https://nexus.onap.org/service/local/repositories/raw/content/org.onap.dcaegen2.platform.plugins/R6/k8splugin/1.7.2/k8splugin_types.yaml" +- "https://nexus.onap.org/service/local/repositories/raw/content/org.onap.dcaegen2.platform.plugins/R6/dcaepolicyplugin/2.4.0/dcaepolicyplugin_types.yaml" +- "https://nexus.onap.org/service/local/repositories/raw/content/org.onap.ccsdk.platform.plugins/type_files/pgaas/1.1.0/pgaas_types.yaml" +inputs: + dcae_CL_publish_url: + type: string + default: "http://message-router.onap.svc.cluster.local:3904/events/unauthenticated.DCAE_CL_OUTPUT" + #default: "http://10.0.11.1:3904/events/unauthenticated.DCAE_CL_OUTPUT" + ves_fault_publish_url: + type: string + default: "http://message-router.onap.svc.cluster.local:3904/events/unauthenticated.SEC_FAULT_OUTPUT" + #default: "http://10.0.11.1:3904/events/unauthenticated.SEC_FAULT_OUTPUT" + msb_hostname: + type: string + default: "msb-discovery.onap.svc.cluster.local" + pgaas_cluster_name: + type: string + default: "dcae-postgres.onap.svc.cluster.local" + # use the single-VM PG instance + #default: pgvm + database_name: + type: string + default: holmes + he_image: + type: string + default: "nexus3.onap.org:10001/onap/holmes/engine-management:v1.0.0" + +node_templates: + pgaasvm: + type: dcae.nodes.pgaas.database + properties: + #writerfqdn: { concat: [ { get_input: pgaas_cluster_name }, '-write.' ] } + writerfqdn: { get_input: pgaas_cluster_name } + name: { get_input: database_name } + use_existing: true + + holmesengine: + type: dcae.nodes.ContainerizedPlatformComponent + 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 + ports: + - '9102:0' + properties: + name: 'holmes-engine-mgmt' + dns_name: 'holmes-engine-mgmt' + 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 + image: { get_input: he_image } + # need to use truncated name!! + #service_component_type: dcae-analytics-holmes-engin-management + relationships: + - type: cloudify.relationships.depends_on + target: pgaasvm diff --git a/blueprints/k8s-holmes-engine.yaml-template b/blueprints/k8s-holmes-engine.yaml-template deleted file mode 100644 index f14dea2..0000000 --- a/blueprints/k8s-holmes-engine.yaml-template +++ /dev/null @@ -1,101 +0,0 @@ -# -*- indent-tabs-mode: nil -*- # vi: set expandtab: -# -# ============LICENSE_START==================================================== -# ============================================================================= -# 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: -- https://www.getcloudify.org/spec/cloudify/4.5.5/types.yaml -- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/k8splugin/1.7.2/k8splugin_types.yaml" -- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/dcaepolicyplugin/2.4.0/dcaepolicyplugin_types.yaml" -- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/pgaas/1.1.0/pgaas_types.yaml" -inputs: - dcae_CL_publish_url: - type: string - default: "http://message-router.onap.svc.cluster.local:3904/events/unauthenticated.DCAE_CL_OUTPUT" - #default: "http://10.0.11.1:3904/events/unauthenticated.DCAE_CL_OUTPUT" - ves_fault_publish_url: - type: string - default: "http://message-router.onap.svc.cluster.local:3904/events/unauthenticated.SEC_FAULT_OUTPUT" - #default: "http://10.0.11.1:3904/events/unauthenticated.SEC_FAULT_OUTPUT" - msb_hostname: - type: string - default: "msb-discovery.onap.svc.cluster.local" - pgaas_cluster_name: - type: string - default: "dcae-postgres.onap.svc.cluster.local" - # 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.' ] } - writerfqdn: { get_input: pgaas_cluster_name } - name: { get_input: database_name } - use_existing: true - - holmesengine: - type: dcae.nodes.ContainerizedPlatformComponent - 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 - ports: - - '9102:0' - properties: - name: 'holmes-engine-mgmt' - dns_name: 'holmes-engine-mgmt' - 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 - image: { get_input: he_image } - # need to use truncated name!! - #service_component_type: dcae-analytics-holmes-engin-management - relationships: - - type: cloudify.relationships.depends_on - target: pgaasvm diff --git a/blueprints/k8s-holmes-rules.yaml b/blueprints/k8s-holmes-rules.yaml new file mode 100644 index 0000000..269692a --- /dev/null +++ b/blueprints/k8s-holmes-rules.yaml @@ -0,0 +1,81 @@ +# -*- indent-tabs-mode: nil -*- # vi: set expandtab: +# +# ============LICENSE_START==================================================== +# ============================================================================= +# 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: +- https://www.getcloudify.org/spec/cloudify/4.5.5/types.yaml +- "https://nexus.onap.org/service/local/repositories/raw/content/org.onap.dcaegen2.platform.plugins/R6/k8splugin/1.7.2/k8splugin_types.yaml" +- "https://nexus.onap.org/service/local/repositories/raw/content/org.onap.dcaegen2.platform.plugins/R6/dcaepolicyplugin/2.4.0/dcaepolicyplugin_types.yaml" +- "https://nexus.onap.org/service/local/repositories/raw/content/org.onap.ccsdk.platform.plugins/type_files/pgaas/1.1.0/pgaas_types.yaml" +inputs: + msb_hostname: + type: string + default: "msb-discovery.onap.svc.cluster.local" + pgaas_cluster_name: + type: string + default: "dcae-postgres.onap.svc.cluster.local" + # use the single-VM PG instance + #default: pgvm + database_name: + type: string + default: holmes + hr_image: + type: string + default: "nexus3.onap.org:10001/onap/holmes/rule-management:v1.0.0" +node_templates: + pgaasvm: + type: dcae.nodes.pgaas.database + properties: + #writerfqdn: { concat: [ { get_input: pgaas_cluster_name }, '-write.' ] } + writerfqdn: { get_input: pgaas_cluster_name } + name: { get_input: database_name } + holmesrules: + type: dcae.nodes.ContainerizedPlatformComponent + 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 + ports: + - '9101:0' + - '9104:0' + properties: + name: 'holmes-rule-mgmt' + dns_name: 'holmes-rule-mgmt' + 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: {} + 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-holmes-rules.yaml-template b/blueprints/k8s-holmes-rules.yaml-template deleted file mode 100644 index 1cff89f..0000000 --- a/blueprints/k8s-holmes-rules.yaml-template +++ /dev/null @@ -1,81 +0,0 @@ -# -*- indent-tabs-mode: nil -*- # vi: set expandtab: -# -# ============LICENSE_START==================================================== -# ============================================================================= -# 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: -- https://www.getcloudify.org/spec/cloudify/4.5.5/types.yaml -- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/k8splugin/1.7.2/k8splugin_types.yaml" -- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/dcaepolicyplugin/2.4.0/dcaepolicyplugin_types.yaml" -- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/pgaas/1.1.0/pgaas_types.yaml" -inputs: - msb_hostname: - type: string - default: "msb-discovery.onap.svc.cluster.local" - pgaas_cluster_name: - type: string - default: "dcae-postgres.onap.svc.cluster.local" - # 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.' ] } - writerfqdn: { get_input: pgaas_cluster_name } - name: { get_input: database_name } - holmesrules: - type: dcae.nodes.ContainerizedPlatformComponent - 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 - ports: - - '9101:0' - - '9104:0' - properties: - name: 'holmes-rule-mgmt' - dns_name: 'holmes-rule-mgmt' - 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: {} - 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-hv-ves.yaml b/blueprints/k8s-hv-ves.yaml new file mode 100644 index 0000000..3723200 --- /dev/null +++ b/blueprints/k8s-hv-ves.yaml @@ -0,0 +1,126 @@ +# -*- indent-tabs-mode: nil -*- # vi: set expandtab: +# +# ============LICENSE_START==================================================== +# ============================================================================= +# Copyright (C) 2018-2019 NOKIA +# ============================================================================= +# 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: + - https://www.getcloudify.org/spec/cloudify/4.5.5/types.yaml + - https://nexus.onap.org/service/local/repositories/raw/content/org.onap.dcaegen2.platform.plugins/R6/k8splugin/1.7.2/k8splugin_types.yaml + +inputs: + tag_version: + type: string + default: 'nexus3.onap.org:10001/onap/org.onap.dcaegen2.collectors.hv-ves.hv-collector-main:1.3.0' + hv_ves_name: + type: string + default: 'dcae-hv-ves-collector' + replicas: + type: integer + description: number of instances + default: 1 + host_port: + type: integer + description: Network port that the platform service is expecting to expose on the host + default: 30222 + container_port: + type: integer + description: Network port that the platform service exposes in the container + default: 6061 + kafka_bootstrap_servers: + type: string + default: 'message-router-kafka:9092' + kafka_username: + type: string + default: 'admin' + kafka_password: + type: string + default: 'admin_secret' + perf3gpp_kafka_topic: + type: string + default: 'HV_VES_PERF3GPP' + log_level: + type: string + default: 'INFO' + server_idle_timeout_sec: + type: integer + default: 300 + cbs_request_interval_sec: + type: integer + default: 5 + security_ssl_disable: + type: boolean + default: true + security_keys_key_store_file: + type: string + default: '/etc/ves-hv/ssl/cert.jks' + security_keys_key_store_password_file: + type: string + default: '/etc/ves-hv/ssl/jks.pass' + security_keys_trust_store_file: + type: string + default: '/etc/ves-hv/ssl/trust.jks' + security_keys_trust_store_password_file: + type: string + default: '/etc/ves-hv/ssl/trust.pass' +node_templates: + hv-ves: + interfaces: + cloudify.interfaces.lifecycle: + start: + inputs: + envs: + JAVA_OPTS: { concat: [ '-Dlogback.configurationFile=/etc/ONAP/', { get_input: hv_ves_name }, '/logback.xml' ] } + properties: + application_config: + logLevel: { get_input: log_level } + server.idleTimeoutSec: { get_input: server_idle_timeout_sec } + server.listenPort: { get_input: container_port } + cbs.requestIntervalSec: { get_input: cbs_request_interval_sec} + security.sslDisable: { get_input: security_ssl_disable } + security.keys.keyStoreFile: { get_input: security_keys_key_store_file } + security.keys.keyStorePasswordFile: { get_input: security_keys_key_store_password_file } + security.keys.trustStoreFile: { get_input: security_keys_trust_store_file } + security.keys.trustStorePasswordFile: { get_input: security_keys_trust_store_password_file } + streams_publishes: + perf3gpp: + type: kafka + aaf_credentials: + username: { get_input: kafka_username } + password: { get_input: kafka_password } + kafka_info: + bootstrap_servers: { get_input: kafka_bootstrap_servers } + topic_name: { get_input: perf3gpp_kafka_topic } + docker_config: + healthcheck: + type: script + script: "/opt/ves-hv-collector/healthcheck.sh" + interval: 15s + timeout: 2s + image: { get_input: tag_version } + replicas: { get_input: replicas } + name: { get_input: hv_ves_name } + dns_name: { get_input: hv_ves_name } + container_port: { get_input: container_port } + host_port: { get_input: host_port } + log_info: + log_directory: { concat: [ '/var/log/ONAP/', { get_input: hv_ves_name } ] } + tls_info: + cert_directory: '/etc/ves-hv/ssl' + use_tls: false + type: dcae.nodes.ContainerizedPlatformComponent diff --git a/blueprints/k8s-hv-ves.yaml-template b/blueprints/k8s-hv-ves.yaml-template deleted file mode 100644 index c66a606..0000000 --- a/blueprints/k8s-hv-ves.yaml-template +++ /dev/null @@ -1,126 +0,0 @@ -# -*- indent-tabs-mode: nil -*- # vi: set expandtab: -# -# ============LICENSE_START==================================================== -# ============================================================================= -# Copyright (C) 2018-2019 NOKIA -# ============================================================================= -# 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: - - https://www.getcloudify.org/spec/cloudify/4.5.5/types.yaml - - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/k8splugin/1.7.2/k8splugin_types.yaml - -inputs: - tag_version: - type: string - default: '{{ ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_releases }}/onap/org.onap.dcaegen2.collectors.hv-ves.hv-collector-main:1.3.0' - hv_ves_name: - type: string - default: 'dcae-hv-ves-collector' - replicas: - type: integer - description: number of instances - default: 1 - host_port: - type: integer - description: Network port that the platform service is expecting to expose on the host - default: 30222 - container_port: - type: integer - description: Network port that the platform service exposes in the container - default: 6061 - kafka_bootstrap_servers: - type: string - default: 'message-router-kafka:9092' - kafka_username: - type: string - default: 'admin' - kafka_password: - type: string - default: 'admin_secret' - perf3gpp_kafka_topic: - type: string - default: 'HV_VES_PERF3GPP' - log_level: - type: string - default: 'INFO' - server_idle_timeout_sec: - type: integer - default: 300 - cbs_request_interval_sec: - type: integer - default: 5 - security_ssl_disable: - type: boolean - default: true - security_keys_key_store_file: - type: string - default: '/etc/ves-hv/ssl/cert.jks' - security_keys_key_store_password_file: - type: string - default: '/etc/ves-hv/ssl/jks.pass' - security_keys_trust_store_file: - type: string - default: '/etc/ves-hv/ssl/trust.jks' - security_keys_trust_store_password_file: - type: string - default: '/etc/ves-hv/ssl/trust.pass' -node_templates: - hv-ves: - interfaces: - cloudify.interfaces.lifecycle: - start: - inputs: - envs: - JAVA_OPTS: { concat: [ '-Dlogback.configurationFile=/etc/ONAP/', { get_input: hv_ves_name }, '/logback.xml' ] } - properties: - application_config: - logLevel: { get_input: log_level } - server.idleTimeoutSec: { get_input: server_idle_timeout_sec } - server.listenPort: { get_input: container_port } - cbs.requestIntervalSec: { get_input: cbs_request_interval_sec} - security.sslDisable: { get_input: security_ssl_disable } - security.keys.keyStoreFile: { get_input: security_keys_key_store_file } - security.keys.keyStorePasswordFile: { get_input: security_keys_key_store_password_file } - security.keys.trustStoreFile: { get_input: security_keys_trust_store_file } - security.keys.trustStorePasswordFile: { get_input: security_keys_trust_store_password_file } - streams_publishes: - perf3gpp: - type: kafka - aaf_credentials: - username: { get_input: kafka_username } - password: { get_input: kafka_password } - kafka_info: - bootstrap_servers: { get_input: kafka_bootstrap_servers } - topic_name: { get_input: perf3gpp_kafka_topic } - docker_config: - healthcheck: - type: script - script: "/opt/ves-hv-collector/healthcheck.sh" - interval: 15s - timeout: 2s - image: { get_input: tag_version } - replicas: { get_input: replicas } - name: { get_input: hv_ves_name } - dns_name: { get_input: hv_ves_name } - container_port: { get_input: container_port } - host_port: { get_input: host_port } - log_info: - log_directory: { concat: [ '/var/log/ONAP/', { get_input: hv_ves_name } ] } - tls_info: - cert_directory: '/etc/ves-hv/ssl' - use_tls: false - type: dcae.nodes.ContainerizedPlatformComponent diff --git a/blueprints/k8s-pgaas-initdb.yaml b/blueprints/k8s-pgaas-initdb.yaml new file mode 100644 index 0000000..4cdf5ae --- /dev/null +++ b/blueprints/k8s-pgaas-initdb.yaml @@ -0,0 +1,72 @@ +# -*- 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 + +description: |- + This blueprint is used to take control of a postgres server instance for use by cloudify-managed applications. + This blueprint depends upon the deployment of the pgaas_plugin and an existing postgres server instance. + This blueprint is part of a suite of three blueprints: + k8s-pgaas-initdb takes control of the postgres server instance. + k8s-pgaas-database creates a database, roles and credentials associated with the database. + k8s-pgaas-getdbinfo shows how an application can access a database (including its roles and credentials) that was already created with k8s-pgaas-database. + +imports: + - https://www.getcloudify.org/spec/cloudify/4.5.5/types.yaml + - "https://nexus.onap.org/service/local/repositories/raw/content/org.onap.dcaegen2.platform.plugins/R6/relationshipplugin/1.1.0/relationshipplugin_types.yaml" + - "https://nexus.onap.org/service/local/repositories/raw/content/org.onap.ccsdk.platform.plugins/type_files/sshkeyshare/sshkey_types.yaml" + - "https://nexus.onap.org/service/local/repositories/raw/content/org.onap.ccsdk.platform.plugins/type_files/pgaas/1.1.0/pgaas_types.yaml" + +inputs: + blueprint_version: + type: string + default: '2018-04-27T00:31:38+0000' + + pgaas_cluster_name: + type: string + default: pghelm + + k8s_pgaas_instance_fqdn: + type: string + + k8s_initial_password: + type: string + default: '' + +node_templates: + + # tie to pgaas_plugin database + pgaas_cluster: + type: dcae.nodes.pgaas.cluster + properties: + writerfqdn: { get_input: k8s_pgaas_instance_fqdn } + readerfqdn: { get_input: k8s_pgaas_instance_fqdn } + initialpassword: { get_input: k8s_initial_password } + relationships: + - type: dcae.relationships.pgaas_cluster_uses_sshkeypair + target: sharedsshkey_pgrs + + sharedsshkey_pgrs: + type: ccsdk.nodes.ssh.keypair + + +outputs: + blueprint_version: + value: { get_input: blueprint_version } diff --git a/blueprints/k8s-pgaas-initdb.yaml-template b/blueprints/k8s-pgaas-initdb.yaml-template deleted file mode 100644 index 2022300..0000000 --- a/blueprints/k8s-pgaas-initdb.yaml-template +++ /dev/null @@ -1,72 +0,0 @@ -# -*- 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 - -description: |- - This blueprint is used to take control of a postgres server instance for use by cloudify-managed applications. - This blueprint depends upon the deployment of the pgaas_plugin and an existing postgres server instance. - This blueprint is part of a suite of three blueprints: - k8s-pgaas-initdb takes control of the postgres server instance. - k8s-pgaas-database creates a database, roles and credentials associated with the database. - k8s-pgaas-getdbinfo shows how an application can access a database (including its roles and credentials) that was already created with k8s-pgaas-database. - -imports: - - https://www.getcloudify.org/spec/cloudify/4.5.5/types.yaml - - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.1.0/relationshipplugin_types.yaml" - - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/sshkeyshare/sshkey_types.yaml" - - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/pgaas/1.1.0/pgaas_types.yaml" - -inputs: - blueprint_version: - type: string - default: '2018-04-27T00:31:38+0000' - - pgaas_cluster_name: - type: string - default: pghelm - - k8s_pgaas_instance_fqdn: - type: string - - k8s_initial_password: - type: string - default: '' - -node_templates: - - # tie to pgaas_plugin database - pgaas_cluster: - type: dcae.nodes.pgaas.cluster - properties: - writerfqdn: { get_input: k8s_pgaas_instance_fqdn } - readerfqdn: { get_input: k8s_pgaas_instance_fqdn } - initialpassword: { get_input: k8s_initial_password } - relationships: - - type: dcae.relationships.pgaas_cluster_uses_sshkeypair - target: sharedsshkey_pgrs - - sharedsshkey_pgrs: - type: ccsdk.nodes.ssh.keypair - - -outputs: - blueprint_version: - value: { get_input: blueprint_version } diff --git a/blueprints/k8s-prh.yaml b/blueprints/k8s-prh.yaml new file mode 100644 index 0000000..4486412 --- /dev/null +++ b/blueprints/k8s-prh.yaml @@ -0,0 +1,152 @@ +# -*- indent-tabs-mode: nil -*- # vi: set expandtab: +# +# ============LICENSE_START==================================================== +# ============================================================================= +# Copyright (c) 2018-2019 AT&T, NOKIA +# ============================================================================= +# 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: + - https://www.getcloudify.org/spec/cloudify/4.5.5/types.yaml + - https://nexus.onap.org/service/local/repositories/raw/content/org.onap.dcaegen2.platform.plugins/R6/k8splugin/1.7.2/k8splugin_types.yaml + +inputs: + pnfUrl: + type: string + default: "https://aai.onap.svc.cluster.local:8443/aai/v12/network/pnfs/pnf" + baseUrl: + type: string + default: "https://aai.onap.svc.cluster.local:8443/aai/v12" + aaiEnrichmentHost: + type: string + default: aai.onap.svc.cluster.local + aaiEnrichmentPort: + type: integer + default: 8443 + aaiEnrichmentUser: + type: string + description: aai user name + default: "AAI" + aaiEnrichmentPasswd: + type: string + description: aai password + default: "AAI" + dmaap_pnfReady_url: + type: string + default: "http://message-router.onap.svc.cluster.local:3904/events/unauthenticated.PNF_READY" + dmaap_vesPnfRegOutput_url: + type: string + default: "http://message-router.onap.svc.cluster.local:3904/events/unauthenticated.VES_PNFREG_OUTPUT" + dmaap_pnfUpdate_url: + type: string + default: "http://message-router.onap.svc.cluster.local:3904/events/unauthenticated.PNF_UPDATE" + dmaap_user: + type: string + description: dmap user name + default: "admin" + dmaap_passwd: + type: string + description: dmap password + default: "admin" + tag_version: + type: string + default: "nexus3.onap.org:10001/onap/org.onap.dcaegen2.services.prh.prh-app-server:1.4.0" + replicas: + type: integer + description: number of instances + default: 1 + host_port: + description: port on Kubernetes host where PRH API will be exposed + default: 0 + secureEnableCert: + type: boolean + description: enable certificate base connection with AAI and DMaap + default: false +node_templates: + prh: + properties: + application_config: + dmaap.dmaapConsumerConfiguration.dmaapUserName: { get_input: dmaap_user } + dmaap.dmaapConsumerConfiguration.dmaapUserPassword: { get_input: dmaap_passwd } + dmaap.dmaapConsumerConfiguration.dmaapContentType: "application/json" + dmaap.dmaapConsumerConfiguration.consumerId: "c12" + dmaap.dmaapConsumerConfiguration.consumerGroup: "OpenDCAE-c12" + dmaap.dmaapConsumerConfiguration.timeoutMs: -1 + dmaap.dmaapProducerConfiguration.dmaapUserName: { get_input: dmaap_user } + dmaap.dmaapProducerConfiguration.dmaapUserPassword: { get_input: dmaap_passwd } + dmaap.dmaapProducerConfiguration.dmaapContentType: "application/json" + dmaap.dmaapUpdateProducerConfiguration.dmaapUserName: { get_input: dmaap_user } + dmaap.dmaapUpdateProducerConfiguration.dmaapUserPassword: { get_input: dmaap_passwd } + dmaap.dmaapUpdateProducerConfiguration.dmaapContentType: "application/json" + aai.aaiClientConfiguration.pnfUrl: { get_input: pnfUrl } + aai.aaiClientConfiguration.baseUrl: { get_input: baseUrl } + aai.aaiClientConfiguration.aaiHost: { get_input: aaiEnrichmentHost } + aai.aaiClientConfiguration.aaiHostPortNumber: { get_input: aaiEnrichmentPort } + aai.aaiClientConfiguration.aaiProtocol: "https" + aai.aaiClientConfiguration.aaiUserName: { get_input: aaiEnrichmentUser } + aai.aaiClientConfiguration.aaiUserPassword: { get_input: aaiEnrichmentPasswd } + aai.aaiClientConfiguration.aaiIgnoreSslCertificateErrors: true + aai.aaiClientConfiguration.aaiBasePath: "/aai/v12" + aai.aaiClientConfiguration.aaiPnfPath: "/network/pnfs/pnf" + aai.aaiClientConfiguration.aaiServiceInstancePath: "/business/customers/customer/${customer}/service-subscriptions/service-subscription/${serviceType}/service-instances/service-instance/${serviceInstanceId}" + aai.aaiClientConfiguration.aaiHeaders: + X-FromAppId: "prh" + X-TransactionId: "9999" + Accept: "application/json" + Real-Time: "true" + Authorization: "Basic QUFJOkFBSQ==" + security.trustStorePath: "/opt/app/prh/etc/cert/trust.jks" + security.trustStorePasswordPath: "/opt/app/prh/etc/cert/trust.pass" + security.keyStorePath: "/opt/app/prh/etc/cert/cert.jks" + security.keyStorePasswordPath: "/opt/app/prh/etc/cert/jks.pass" + security.enableAaiCertAuth: { get_input: secureEnableCert } + security.enableDmaapCertAuth: { get_input: secureEnableCert } + streams_publishes: + pnf-update: + type: "message_router" + dmaap_info: + topic_url: {get_input: dmaap_pnfUpdate_url } + pnf-ready: + type: "message_router" + dmaap_info: + topic_url: { get_input: dmaap_pnfReady_url } + streams_subscribes: + ves-reg-output: + type: "message_router" + dmaap_info: + topic_url: { get_input: dmaap_vesPnfRegOutput_url } + + host_port: + { get_input: host_port } + container_port: + 8100 + docker_config: + healthcheck: + endpoint: /heartbeat + interval: 15s + timeout: 1s + type: http + image: + { get_input: tag_version } + replicas: {get_input: replicas} + name: 'dcae-prh' + dns_name: 'dcae-prh' + log_info: + log_directory: "/opt/app/prh/logs" + tls_info: + cert_directory: '/opt/app/prh/etc/cert' + use_tls: true + type: dcae.nodes.ContainerizedPlatformComponent diff --git a/blueprints/k8s-prh.yaml-template b/blueprints/k8s-prh.yaml-template deleted file mode 100644 index 3d3107c..0000000 --- a/blueprints/k8s-prh.yaml-template +++ /dev/null @@ -1,152 +0,0 @@ -# -*- indent-tabs-mode: nil -*- # vi: set expandtab: -# -# ============LICENSE_START==================================================== -# ============================================================================= -# Copyright (c) 2018-2019 AT&T, NOKIA -# ============================================================================= -# 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: - - https://www.getcloudify.org/spec/cloudify/4.5.5/types.yaml - - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/k8splugin/1.7.2/k8splugin_types.yaml - -inputs: - pnfUrl: - type: string - default: "https://aai.onap.svc.cluster.local:8443/aai/v12/network/pnfs/pnf" - baseUrl: - type: string - default: "https://aai.onap.svc.cluster.local:8443/aai/v12" - aaiEnrichmentHost: - type: string - default: aai.onap.svc.cluster.local - aaiEnrichmentPort: - type: integer - default: 8443 - aaiEnrichmentUser: - type: string - description: aai user name - default: "AAI" - aaiEnrichmentPasswd: - type: string - description: aai password - default: "AAI" - dmaap_pnfReady_url: - type: string - default: "http://message-router.onap.svc.cluster.local:3904/events/unauthenticated.PNF_READY" - dmaap_vesPnfRegOutput_url: - type: string - default: "http://message-router.onap.svc.cluster.local:3904/events/unauthenticated.VES_PNFREG_OUTPUT" - dmaap_pnfUpdate_url: - type: string - default: "http://message-router.onap.svc.cluster.local:3904/events/unauthenticated.PNF_UPDATE" - dmaap_user: - type: string - description: dmap user name - default: "admin" - dmaap_passwd: - type: string - description: dmap password - default: "admin" - tag_version: - type: string - default: "{{ ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_releases }}/onap/org.onap.dcaegen2.services.prh.prh-app-server:1.4.0" - replicas: - type: integer - description: number of instances - default: 1 - host_port: - description: port on Kubernetes host where PRH API will be exposed - default: 0 - secureEnableCert: - type: boolean - description: enable certificate base connection with AAI and DMaap - default: false -node_templates: - prh: - properties: - application_config: - dmaap.dmaapConsumerConfiguration.dmaapUserName: { get_input: dmaap_user } - dmaap.dmaapConsumerConfiguration.dmaapUserPassword: { get_input: dmaap_passwd } - dmaap.dmaapConsumerConfiguration.dmaapContentType: "application/json" - dmaap.dmaapConsumerConfiguration.consumerId: "c12" - dmaap.dmaapConsumerConfiguration.consumerGroup: "OpenDCAE-c12" - dmaap.dmaapConsumerConfiguration.timeoutMs: -1 - dmaap.dmaapProducerConfiguration.dmaapUserName: { get_input: dmaap_user } - dmaap.dmaapProducerConfiguration.dmaapUserPassword: { get_input: dmaap_passwd } - dmaap.dmaapProducerConfiguration.dmaapContentType: "application/json" - dmaap.dmaapUpdateProducerConfiguration.dmaapUserName: { get_input: dmaap_user } - dmaap.dmaapUpdateProducerConfiguration.dmaapUserPassword: { get_input: dmaap_passwd } - dmaap.dmaapUpdateProducerConfiguration.dmaapContentType: "application/json" - aai.aaiClientConfiguration.pnfUrl: { get_input: pnfUrl } - aai.aaiClientConfiguration.baseUrl: { get_input: baseUrl } - aai.aaiClientConfiguration.aaiHost: { get_input: aaiEnrichmentHost } - aai.aaiClientConfiguration.aaiHostPortNumber: { get_input: aaiEnrichmentPort } - aai.aaiClientConfiguration.aaiProtocol: "https" - aai.aaiClientConfiguration.aaiUserName: { get_input: aaiEnrichmentUser } - aai.aaiClientConfiguration.aaiUserPassword: { get_input: aaiEnrichmentPasswd } - aai.aaiClientConfiguration.aaiIgnoreSslCertificateErrors: true - aai.aaiClientConfiguration.aaiBasePath: "/aai/v12" - aai.aaiClientConfiguration.aaiPnfPath: "/network/pnfs/pnf" - aai.aaiClientConfiguration.aaiServiceInstancePath: "/business/customers/customer/${customer}/service-subscriptions/service-subscription/${serviceType}/service-instances/service-instance/${serviceInstanceId}" - aai.aaiClientConfiguration.aaiHeaders: - X-FromAppId: "prh" - X-TransactionId: "9999" - Accept: "application/json" - Real-Time: "true" - Authorization: "Basic QUFJOkFBSQ==" - security.trustStorePath: "/opt/app/prh/etc/cert/trust.jks" - security.trustStorePasswordPath: "/opt/app/prh/etc/cert/trust.pass" - security.keyStorePath: "/opt/app/prh/etc/cert/cert.jks" - security.keyStorePasswordPath: "/opt/app/prh/etc/cert/jks.pass" - security.enableAaiCertAuth: { get_input: secureEnableCert } - security.enableDmaapCertAuth: { get_input: secureEnableCert } - streams_publishes: - pnf-update: - type: "message_router" - dmaap_info: - topic_url: {get_input: dmaap_pnfUpdate_url } - pnf-ready: - type: "message_router" - dmaap_info: - topic_url: { get_input: dmaap_pnfReady_url } - streams_subscribes: - ves-reg-output: - type: "message_router" - dmaap_info: - topic_url: { get_input: dmaap_vesPnfRegOutput_url } - - host_port: - { get_input: host_port } - container_port: - 8100 - docker_config: - healthcheck: - endpoint: /heartbeat - interval: 15s - timeout: 1s - type: http - image: - { get_input: tag_version } - replicas: {get_input: replicas} - name: 'dcae-prh' - dns_name: 'dcae-prh' - log_info: - log_directory: "/opt/app/prh/logs" - tls_info: - cert_directory: '/opt/app/prh/etc/cert' - use_tls: true - type: dcae.nodes.ContainerizedPlatformComponent diff --git a/blueprints/k8s-snmptrap.yaml b/blueprints/k8s-snmptrap.yaml new file mode 100644 index 0000000..e1d50c7 --- /dev/null +++ b/blueprints/k8s-snmptrap.yaml @@ -0,0 +1,120 @@ +# -*- indent-tabs-mode: nil -*- # vi: set expandtab: +# +# ============LICENSE_START==================================================== +# ============================================================================= +# Copyright (c) 2018-2019 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: + - https://www.getcloudify.org/spec/cloudify/4.5.5/types.yaml + - https://nexus.onap.org/service/local/repositories/raw/content/org.onap.dcaegen2.platform.plugins/R6/k8splugin/1.7.2/k8splugin_types.yaml +inputs: + tag_version: + type: string + default: "nexus3.onap.org:10001/onap/org.onap.dcaegen2.collectors.snmptrap:1.4.0" + cache: + type: string + default: + dns_cache_ttl_seconds: 60 + files: + type: string + default: + arriving_traps_log: snmptrapd_arriving_traps.log + data_dir: data + eelf_audit: audit.log + eelf_base_dir: /opt/app/snmptrap/logs + eelf_debug: debug.log + eelf_error: error.log + eelf_metrics: metrics.log + log_dir: logs + minimum_severity_to_log: 2 + perm_status_file: snmptrapd_status.log + pid_dir: tmp + roll_frequency: day + runtime_base_dir: /opt/app/snmptrap + snmptrapd_diag: snmptrapd_prog_diag.log + traps_stats_log: snmptrapd_stats.csv + protocols: + type: string + default: + ipv4_interface: 0.0.0.0 + ipv4_port: 6162 + ipv6_interface: ::1 + ipv6_port: 6162 + publisher: + type: string + default: + http_milliseconds_between_retries: 750 + http_milliseconds_timeout: 1500 + http_peer_publisher: unavailable + http_primary_publisher: 'true' + http_retries: 3 + max_milliseconds_between_publishes: 10000 + max_traps_between_publishes: 10 + sec_fault_unsecure_topic: + type: string + default: "http://message-router.onap.svc.cluster.local:3904/events/unauthenticated.ONAP-COLLECTOR-SNMPTRAP" + snmptrapd: + type: string + default: + title: Collector for receiving SNMP traps and publishing to DMAAP/MR + version: 1.4.0 + external_port: + type: string + description: Kubernetes node port on which collector is exposed + default: "30470" + replicas: + type: integer + description: number of instances + default: 1 + +node_templates: + snmptrap: + interfaces: + cloudify.interfaces.lifecycle: + start: + inputs: + ports: + - concat: ["6162/udp:", { get_input: external_port }] + properties: + application_config: + StormWatchPolicy: '' + cache: + get_input: cache + files: + get_input: files + protocols: + get_input: protocols + publisher: + get_input: publisher + services_calls: {} + snmptrapd: + get_input: snmptrapd + sw_interval_in_seconds: 60 + streams_publishes: + sec_fault_unsecure: + dmaap_info: + topic_url: + get_input: sec_fault_unsecure_topic + type: message_router + + image: + get_input: tag_version + replicas: {get_input: replicas} + name: 'dcae-snmptrap-collector' + dns_name: 'dcae-snmptrap-collector' + type: dcae.nodes.ContainerizedPlatformComponent diff --git a/blueprints/k8s-snmptrap.yaml-template b/blueprints/k8s-snmptrap.yaml-template deleted file mode 100644 index bf83a27..0000000 --- a/blueprints/k8s-snmptrap.yaml-template +++ /dev/null @@ -1,120 +0,0 @@ -# -*- indent-tabs-mode: nil -*- # vi: set expandtab: -# -# ============LICENSE_START==================================================== -# ============================================================================= -# Copyright (c) 2018-2019 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: - - https://www.getcloudify.org/spec/cloudify/4.5.5/types.yaml - - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/k8splugin/1.7.2/k8splugin_types.yaml -inputs: - tag_version: - type: string - default: "{{ ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_releases }}/onap/org.onap.dcaegen2.collectors.snmptrap:1.4.0" - cache: - type: string - default: - dns_cache_ttl_seconds: 60 - files: - type: string - default: - arriving_traps_log: snmptrapd_arriving_traps.log - data_dir: data - eelf_audit: audit.log - eelf_base_dir: /opt/app/snmptrap/logs - eelf_debug: debug.log - eelf_error: error.log - eelf_metrics: metrics.log - log_dir: logs - minimum_severity_to_log: 2 - perm_status_file: snmptrapd_status.log - pid_dir: tmp - roll_frequency: day - runtime_base_dir: /opt/app/snmptrap - snmptrapd_diag: snmptrapd_prog_diag.log - traps_stats_log: snmptrapd_stats.csv - protocols: - type: string - default: - ipv4_interface: 0.0.0.0 - ipv4_port: 6162 - ipv6_interface: ::1 - ipv6_port: 6162 - publisher: - type: string - default: - http_milliseconds_between_retries: 750 - http_milliseconds_timeout: 1500 - http_peer_publisher: unavailable - http_primary_publisher: 'true' - http_retries: 3 - max_milliseconds_between_publishes: 10000 - max_traps_between_publishes: 10 - sec_fault_unsecure_topic: - type: string - default: "http://message-router.onap.svc.cluster.local:3904/events/unauthenticated.ONAP-COLLECTOR-SNMPTRAP" - snmptrapd: - type: string - default: - title: Collector for receiving SNMP traps and publishing to DMAAP/MR - version: 1.4.0 - external_port: - type: string - description: Kubernetes node port on which collector is exposed - default: "30470" - replicas: - type: integer - description: number of instances - default: 1 - -node_templates: - snmptrap: - interfaces: - cloudify.interfaces.lifecycle: - start: - inputs: - ports: - - concat: ["6162/udp:", { get_input: external_port }] - properties: - application_config: - StormWatchPolicy: '' - cache: - get_input: cache - files: - get_input: files - protocols: - get_input: protocols - publisher: - get_input: publisher - services_calls: {} - snmptrapd: - get_input: snmptrapd - sw_interval_in_seconds: 60 - streams_publishes: - sec_fault_unsecure: - dmaap_info: - topic_url: - get_input: sec_fault_unsecure_topic - type: message_router - - image: - get_input: tag_version - replicas: {get_input: replicas} - name: 'dcae-snmptrap-collector' - dns_name: 'dcae-snmptrap-collector' - type: dcae.nodes.ContainerizedPlatformComponent diff --git a/blueprints/k8s-tca-clampnode.yaml b/blueprints/k8s-tca-clampnode.yaml new file mode 100644 index 0000000..56dbc2c --- /dev/null +++ b/blueprints/k8s-tca-clampnode.yaml @@ -0,0 +1,175 @@ +# +# ============LICENSE_START==================================================== +# ============================================================================= +# Copyright (c) 2019 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 + +description: > + This blueprint deploys/manages the TCA module as a Docker container + +imports: + - https://www.getcloudify.org/spec/cloudify/4.5.5/types.yaml + - "https://nexus.onap.org/service/local/repositories/raw/content/org.onap.dcaegen2.platform.plugins/R6/k8splugin/1.7.2/k8splugin_types.yaml" + - "https://nexus.onap.org/service/local/repositories/raw/content/org.onap.dcaegen2.platform.plugins/R6/clamppolicyplugin/1.1.0/clamppolicyplugin_types.yaml" +inputs: + aaiEnrichmentHost: + type: string + default: "aai.onap.svc.cluster.local" + aaiEnrichmentPort: + type: string + default: "8443" + enableAAIEnrichment: + type: string + default: true + dmaap_host: + type: string + default: message-router.onap + dmaap_port: + type: string + default: "3904" + enableRedisCaching: + type: string + default: false + redisHosts: + type: string + default: dcae-redis.onap.svc.cluster.local:6379 + tag_version: + type: string + default: "nexus3.onap.org:10001/onap/org.onap.dcaegen2.deployments.tca-cdap-container:1.2.2" + consul_host: + type: string + default: consul-server.onap + consul_port: + type: string + default: "8500" + cbs_host: + type: string + default: "config-binding-service" + cbs_port: + type: string + default: "10000" + policy_id: + type: string + default: "onap.restart.tca" + external_port: + type: string + description: Kubernetes node port on which CDAPgui is exposed + default: "32012" + policy_model_id: + type: string + default: "onap.policies.monitoring.cdap.tca.hi.lo.app" +node_templates: + tca_k8s: + type: dcae.nodes.ContainerizedServiceComponent + relationships: + - target: tca_policy + type: cloudify.relationships.depends_on + properties: + service_component_type: 'dcaegen2-analytics-tca' + application_config: {} + docker_config: {} + image: + get_input: tag_version + log_info: + log_directory: "/opt/app/TCAnalytics/logs" + application_config: + app_config: + appDescription: DCAE Analytics Threshold Crossing Alert Application + appName: dcae-tca + tcaAlertsAbatementTableName: TCAAlertsAbatementTable + tcaAlertsAbatementTableTTLSeconds: '1728000' + tcaSubscriberOutputStreamName: TCASubscriberOutputStream + tcaVESAlertsTableName: TCAVESAlertsTable + tcaVESAlertsTableTTLSeconds: '1728000' + tcaVESMessageStatusTableName: TCAVESMessageStatusTable + tcaVESMessageStatusTableTTLSeconds: '86400' + thresholdCalculatorFlowletInstances: '2' + app_preferences: + aaiEnrichmentHost: + get_input: aaiEnrichmentHost + aaiEnrichmentIgnoreSSLCertificateErrors: 'true' + aaiEnrichmentPortNumber: '8443' + aaiEnrichmentProtocol: https + aaiEnrichmentUserName: dcae@dcae.onap.org + aaiEnrichmentUserPassword: demo123456! + aaiVMEnrichmentAPIPath: /aai/v11/search/nodes-query + aaiVNFEnrichmentAPIPath: /aai/v11/network/generic-vnfs/generic-vnf + enableAAIEnrichment: + get_input: enableAAIEnrichment + enableRedisCaching: + get_input: enableRedisCaching + redisHosts: + get_input: redisHosts + enableAlertCEFFormat: 'false' + publisherContentType: application/json + publisherHostName: + get_input: dmaap_host + publisherHostPort: + get_input: dmaap_port + publisherMaxBatchSize: '1' + publisherMaxRecoveryQueueSize: '100000' + publisherPollingInterval: '20000' + publisherProtocol: http + publisherTopicName: unauthenticated.DCAE_CL_OUTPUT + subscriberConsumerGroup: OpenDCAE-clamp + subscriberConsumerId: c12 + subscriberContentType: application/json + subscriberHostName: + get_input: dmaap_host + subscriberHostPort: + get_input: dmaap_port + subscriberMessageLimit: '-1' + subscriberPollingInterval: '30000' + subscriberProtocol: http + subscriberTimeoutMS: '-1' + subscriberTopicName: unauthenticated.VES_MEASUREMENT_OUTPUT + #tca_policy: '{"domain":"measurementsForVfScaling","metricsPerEventName":[{"eventName":"vFirewallBroadcastPackets","controlLoopSchemaType":"VM","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"}]}]}' + tca_policy: '' + service_component_type: dcaegen2-analytics_tca + interfaces: + cloudify.interfaces.lifecycle: + start: + inputs: + envs: + DMAAPHOST: + { get_input: dmaap_host } + DMAAPPORT: + { get_input: dmaap_port } + DMAAPPUBTOPIC: "unauthenticated.DCAE_CL_OUTPUT" + DMAAPSUBTOPIC: "unauthenticated.VES_MEASUREMENT_OUTPUT" + AAIHOST: + { get_input: aaiEnrichmentHost } + AAIPORT: + { get_input: aaiEnrichmentPort } + CONSUL_HOST: + { get_input: consul_host } + CONSUL_PORT: + { get_input: consul_port } + CBS_HOST: + { get_input: cbs_host } + CBS_PORT: + { get_input: cbs_port } + CONFIG_BINDING_SERVICE: "config_binding_service" + ports: + - concat: ["11011:", { get_input: external_port }] + tca_policy: + type: clamp.nodes.policy + properties: + policy_id: + get_input: policy_id + policy_model_id: + get_input: policy_model_id diff --git a/blueprints/k8s-tca-clampnode.yaml-template b/blueprints/k8s-tca-clampnode.yaml-template deleted file mode 100644 index d43d017..0000000 --- a/blueprints/k8s-tca-clampnode.yaml-template +++ /dev/null @@ -1,175 +0,0 @@ -# -# ============LICENSE_START==================================================== -# ============================================================================= -# Copyright (c) 2019 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 - -description: > - This blueprint deploys/manages the TCA module as a Docker container - -imports: - - https://www.getcloudify.org/spec/cloudify/4.5.5/types.yaml - - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/k8splugin/1.7.2/k8splugin_types.yaml" - - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/clamppolicyplugin/1.1.0/clamppolicyplugin_types.yaml" -inputs: - aaiEnrichmentHost: - type: string - default: "aai.onap.svc.cluster.local" - aaiEnrichmentPort: - type: string - default: "8443" - enableAAIEnrichment: - type: string - default: true - dmaap_host: - type: string - default: message-router.onap - dmaap_port: - type: string - default: "3904" - enableRedisCaching: - type: string - default: false - redisHosts: - type: string - default: dcae-redis.onap.svc.cluster.local:6379 - tag_version: - type: string - default: "nexus3.onap.org:10001/onap/org.onap.dcaegen2.deployments.tca-cdap-container:1.2.2" - consul_host: - type: string - default: consul-server.onap - consul_port: - type: string - default: "8500" - cbs_host: - type: string - default: "config-binding-service" - cbs_port: - type: string - default: "10000" - policy_id: - type: string - default: "onap.restart.tca" - external_port: - type: string - description: Kubernetes node port on which CDAPgui is exposed - default: "32012" - policy_model_id: - type: string - default: "onap.policies.monitoring.cdap.tca.hi.lo.app" -node_templates: - tca_k8s: - type: dcae.nodes.ContainerizedServiceComponent - relationships: - - target: tca_policy - type: cloudify.relationships.depends_on - properties: - service_component_type: 'dcaegen2-analytics-tca' - application_config: {} - docker_config: {} - image: - get_input: tag_version - log_info: - log_directory: "/opt/app/TCAnalytics/logs" - application_config: - app_config: - appDescription: DCAE Analytics Threshold Crossing Alert Application - appName: dcae-tca - tcaAlertsAbatementTableName: TCAAlertsAbatementTable - tcaAlertsAbatementTableTTLSeconds: '1728000' - tcaSubscriberOutputStreamName: TCASubscriberOutputStream - tcaVESAlertsTableName: TCAVESAlertsTable - tcaVESAlertsTableTTLSeconds: '1728000' - tcaVESMessageStatusTableName: TCAVESMessageStatusTable - tcaVESMessageStatusTableTTLSeconds: '86400' - thresholdCalculatorFlowletInstances: '2' - app_preferences: - aaiEnrichmentHost: - get_input: aaiEnrichmentHost - aaiEnrichmentIgnoreSSLCertificateErrors: 'true' - aaiEnrichmentPortNumber: '8443' - aaiEnrichmentProtocol: https - aaiEnrichmentUserName: dcae@dcae.onap.org - aaiEnrichmentUserPassword: demo123456! - aaiVMEnrichmentAPIPath: /aai/v11/search/nodes-query - aaiVNFEnrichmentAPIPath: /aai/v11/network/generic-vnfs/generic-vnf - enableAAIEnrichment: - get_input: enableAAIEnrichment - enableRedisCaching: - get_input: enableRedisCaching - redisHosts: - get_input: redisHosts - enableAlertCEFFormat: 'false' - publisherContentType: application/json - publisherHostName: - get_input: dmaap_host - publisherHostPort: - get_input: dmaap_port - publisherMaxBatchSize: '1' - publisherMaxRecoveryQueueSize: '100000' - publisherPollingInterval: '20000' - publisherProtocol: http - publisherTopicName: unauthenticated.DCAE_CL_OUTPUT - subscriberConsumerGroup: OpenDCAE-clamp - subscriberConsumerId: c12 - subscriberContentType: application/json - subscriberHostName: - get_input: dmaap_host - subscriberHostPort: - get_input: dmaap_port - subscriberMessageLimit: '-1' - subscriberPollingInterval: '30000' - subscriberProtocol: http - subscriberTimeoutMS: '-1' - subscriberTopicName: unauthenticated.VES_MEASUREMENT_OUTPUT - #tca_policy: '{"domain":"measurementsForVfScaling","metricsPerEventName":[{"eventName":"vFirewallBroadcastPackets","controlLoopSchemaType":"VM","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"}]}]}' - tca_policy: '' - service_component_type: dcaegen2-analytics_tca - interfaces: - cloudify.interfaces.lifecycle: - start: - inputs: - envs: - DMAAPHOST: - { get_input: dmaap_host } - DMAAPPORT: - { get_input: dmaap_port } - DMAAPPUBTOPIC: "unauthenticated.DCAE_CL_OUTPUT" - DMAAPSUBTOPIC: "unauthenticated.VES_MEASUREMENT_OUTPUT" - AAIHOST: - { get_input: aaiEnrichmentHost } - AAIPORT: - { get_input: aaiEnrichmentPort } - CONSUL_HOST: - { get_input: consul_host } - CONSUL_PORT: - { get_input: consul_port } - CBS_HOST: - { get_input: cbs_host } - CBS_PORT: - { get_input: cbs_port } - CONFIG_BINDING_SERVICE: "config_binding_service" - ports: - - concat: ["11011:", { get_input: external_port }] - tca_policy: - type: clamp.nodes.policy - properties: - policy_id: - get_input: policy_id - policy_model_id: - get_input: policy_model_id diff --git a/blueprints/k8s-tca-policynode.yaml b/blueprints/k8s-tca-policynode.yaml new file mode 100644 index 0000000..2dec8c0 --- /dev/null +++ b/blueprints/k8s-tca-policynode.yaml @@ -0,0 +1,172 @@ +# +# ============LICENSE_START==================================================== +# ============================================================================= +# Copyright (c) 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 + +description: > + This blueprint deploys/manages the TCA module as a Docker container + +imports: + - https://www.getcloudify.org/spec/cloudify/4.5.5/types.yaml + - https://nexus.onap.org/service/local/repositories/raw/content/org.onap.dcaegen2.platform.plugins/R6/k8splugin/1.7.2/k8splugin_types.yaml + - https://nexus.onap.org/service/local/repositories/raw/content/org.onap.dcaegen2.platform.plugins/R6/dcaepolicyplugin/2.4.0/dcaepolicyplugin_types.yaml +inputs: + aaiEnrichmentHost: + type: string + default: "aai.onap.svc.cluster.local" + aaiEnrichmentPort: + type: string + default: "8443" + enableAAIEnrichment: + type: string + default: true + dmaap_host: + type: string + default: message-router.onap.svc.cluster.local + dmaap_port: + type: string + default: "3904" + enableRedisCaching: + type: string + default: false + redisHosts: + type: string + default: dcae-redis.onap.svc.cluster.local:6379 + tag_version: + type: string + default: "nexus3.onap.org:10001/onap/org.onap.dcaegen2.deployments.tca-cdap-container:1.0.0" + consul_host: + type: string + default: consul-server.onap.svc.cluster.local + consul_port: + type: string + default: "8500" + cbs_host: + type: string + default: "config-binding-service.dcae.svc.cluster.local" + cbs_port: + type: string + default: "10000" + policy_id: + type: string + default: "none" + external_port: + type: string + description: Kubernetes node port on which CDAPgui is exposed + default: "32010" + +node_templates: + tca_k8s: + type: dcae.nodes.ContainerizedServiceComponent + relationships: + - target: tca_policy + type: cloudify.relationships.depends_on + properties: + service_component_type: 'dcaegen2-analytics-tca' + application_config: {} + docker_config: {} + image: + get_input: tag_version + log_info: + log_directory: "/opt/app/TCAnalytics/logs" + application_config: + app_config: + appDescription: DCAE Analytics Threshold Crossing Alert Application + appName: dcae-tca + tcaAlertsAbatementTableName: TCAAlertsAbatementTable + tcaAlertsAbatementTableTTLSeconds: '1728000' + tcaSubscriberOutputStreamName: TCASubscriberOutputStream + tcaVESAlertsTableName: TCAVESAlertsTable + tcaVESAlertsTableTTLSeconds: '1728000' + tcaVESMessageStatusTableName: TCAVESMessageStatusTable + tcaVESMessageStatusTableTTLSeconds: '86400' + thresholdCalculatorFlowletInstances: '2' + app_preferences: + aaiEnrichmentHost: + get_input: aaiEnrichmentHost + aaiEnrichmentIgnoreSSLCertificateErrors: 'true' + aaiEnrichmentPortNumber: '8443' + aaiEnrichmentProtocol: https + aaiEnrichmentUserName: dcae@dcae.onap.org + aaiEnrichmentUserPassword: demo123456! + aaiVMEnrichmentAPIPath: /aai/v11/search/nodes-query + aaiVNFEnrichmentAPIPath: /aai/v11/network/generic-vnfs/generic-vnf + enableAAIEnrichment: + get_input: enableAAIEnrichment + enableRedisCaching: + get_input: enableRedisCaching + redisHosts: + get_input: redisHosts + enableAlertCEFFormat: 'false' + publisherContentType: application/json + publisherHostName: + get_input: dmaap_host + publisherHostPort: + get_input: dmaap_port + publisherMaxBatchSize: '1' + publisherMaxRecoveryQueueSize: '100000' + publisherPollingInterval: '20000' + publisherProtocol: http + publisherTopicName: unauthenticated.DCAE_CL_OUTPUT + subscriberConsumerGroup: OpenDCAE-c12 + subscriberConsumerId: c12 + subscriberContentType: application/json + subscriberHostName: + get_input: dmaap_host + subscriberHostPort: + get_input: dmaap_port + subscriberMessageLimit: '-1' + subscriberPollingInterval: '30000' + subscriberProtocol: http + subscriberTimeoutMS: '-1' + subscriberTopicName: unauthenticated.VES_MEASUREMENT_OUTPUT + tca_policy: '{"domain":"measurementsForVfScaling","metricsPerEventName":[{"eventName":"vFirewallBroadcastPackets","controlLoopSchemaType":"VM","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"}]}]}' + service_component_type: dcaegen2-analytics_tca + interfaces: + cloudify.interfaces.lifecycle: + start: + inputs: + envs: + DMAAPHOST: + { get_input: dmaap_host } + DMAAPPORT: + { get_input: dmaap_port } + DMAAPPUBTOPIC: "unauthenticated.DCAE_CL_OUTPUT" + DMAAPSUBTOPIC: "unauthenticated.VES_MEASUREMENT_OUTPUT" + AAIHOST: + { get_input: aaiEnrichmentHost } + AAIPORT: + { get_input: aaiEnrichmentPort } + CONSUL_HOST: + { get_input: consul_host } + CONSUL_PORT: + { get_input: consul_port } + CBS_HOST: + { get_input: cbs_host } + CBS_PORT: + { get_input: cbs_port } + CONFIG_BINDING_SERVICE: "config_binding_service" + ports: + - concat: ["11011:", { get_input: external_port }] + tca_policy: + type: dcae.nodes.policy + properties: + policy_id: + get_input: policy_id + + diff --git a/blueprints/k8s-tca-policynode.yaml-template b/blueprints/k8s-tca-policynode.yaml-template deleted file mode 100644 index c24dfed..0000000 --- a/blueprints/k8s-tca-policynode.yaml-template +++ /dev/null @@ -1,172 +0,0 @@ -# -# ============LICENSE_START==================================================== -# ============================================================================= -# Copyright (c) 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 - -description: > - This blueprint deploys/manages the TCA module as a Docker container - -imports: - - https://www.getcloudify.org/spec/cloudify/4.5.5/types.yaml - - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/k8splugin/1.7.2/k8splugin_types.yaml - - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/dcaepolicyplugin/2.4.0/dcaepolicyplugin_types.yaml -inputs: - aaiEnrichmentHost: - type: string - default: "aai.onap.svc.cluster.local" - aaiEnrichmentPort: - type: string - default: "8443" - enableAAIEnrichment: - type: string - default: true - dmaap_host: - type: string - default: message-router.onap.svc.cluster.local - dmaap_port: - type: string - default: "3904" - enableRedisCaching: - type: string - default: false - redisHosts: - type: string - default: dcae-redis.onap.svc.cluster.local:6379 - tag_version: - type: string - default: "{{ ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_releases }}/onap/org.onap.dcaegen2.deployments.tca-cdap-container:1.0.0" - consul_host: - type: string - default: consul-server.onap.svc.cluster.local - consul_port: - type: string - default: "8500" - cbs_host: - type: string - default: "config-binding-service.dcae.svc.cluster.local" - cbs_port: - type: string - default: "10000" - policy_id: - type: string - default: "none" - external_port: - type: string - description: Kubernetes node port on which CDAPgui is exposed - default: "32010" - -node_templates: - tca_k8s: - type: dcae.nodes.ContainerizedServiceComponent - relationships: - - target: tca_policy - type: cloudify.relationships.depends_on - properties: - service_component_type: 'dcaegen2-analytics-tca' - application_config: {} - docker_config: {} - image: - get_input: tag_version - log_info: - log_directory: "/opt/app/TCAnalytics/logs" - application_config: - app_config: - appDescription: DCAE Analytics Threshold Crossing Alert Application - appName: dcae-tca - tcaAlertsAbatementTableName: TCAAlertsAbatementTable - tcaAlertsAbatementTableTTLSeconds: '1728000' - tcaSubscriberOutputStreamName: TCASubscriberOutputStream - tcaVESAlertsTableName: TCAVESAlertsTable - tcaVESAlertsTableTTLSeconds: '1728000' - tcaVESMessageStatusTableName: TCAVESMessageStatusTable - tcaVESMessageStatusTableTTLSeconds: '86400' - thresholdCalculatorFlowletInstances: '2' - app_preferences: - aaiEnrichmentHost: - get_input: aaiEnrichmentHost - aaiEnrichmentIgnoreSSLCertificateErrors: 'true' - aaiEnrichmentPortNumber: '8443' - aaiEnrichmentProtocol: https - aaiEnrichmentUserName: dcae@dcae.onap.org - aaiEnrichmentUserPassword: demo123456! - aaiVMEnrichmentAPIPath: /aai/v11/search/nodes-query - aaiVNFEnrichmentAPIPath: /aai/v11/network/generic-vnfs/generic-vnf - enableAAIEnrichment: - get_input: enableAAIEnrichment - enableRedisCaching: - get_input: enableRedisCaching - redisHosts: - get_input: redisHosts - enableAlertCEFFormat: 'false' - publisherContentType: application/json - publisherHostName: - get_input: dmaap_host - publisherHostPort: - get_input: dmaap_port - publisherMaxBatchSize: '1' - publisherMaxRecoveryQueueSize: '100000' - publisherPollingInterval: '20000' - publisherProtocol: http - publisherTopicName: unauthenticated.DCAE_CL_OUTPUT - subscriberConsumerGroup: OpenDCAE-c12 - subscriberConsumerId: c12 - subscriberContentType: application/json - subscriberHostName: - get_input: dmaap_host - subscriberHostPort: - get_input: dmaap_port - subscriberMessageLimit: '-1' - subscriberPollingInterval: '30000' - subscriberProtocol: http - subscriberTimeoutMS: '-1' - subscriberTopicName: unauthenticated.VES_MEASUREMENT_OUTPUT - tca_policy: '{"domain":"measurementsForVfScaling","metricsPerEventName":[{"eventName":"vFirewallBroadcastPackets","controlLoopSchemaType":"VM","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"}]}]}' - service_component_type: dcaegen2-analytics_tca - interfaces: - cloudify.interfaces.lifecycle: - start: - inputs: - envs: - DMAAPHOST: - { get_input: dmaap_host } - DMAAPPORT: - { get_input: dmaap_port } - DMAAPPUBTOPIC: "unauthenticated.DCAE_CL_OUTPUT" - DMAAPSUBTOPIC: "unauthenticated.VES_MEASUREMENT_OUTPUT" - AAIHOST: - { get_input: aaiEnrichmentHost } - AAIPORT: - { get_input: aaiEnrichmentPort } - CONSUL_HOST: - { get_input: consul_host } - CONSUL_PORT: - { get_input: consul_port } - CBS_HOST: - { get_input: cbs_host } - CBS_PORT: - { get_input: cbs_port } - CONFIG_BINDING_SERVICE: "config_binding_service" - ports: - - concat: ["11011:", { get_input: external_port }] - tca_policy: - type: dcae.nodes.policy - properties: - policy_id: - get_input: policy_id - - diff --git a/blueprints/k8s-tca.yaml b/blueprints/k8s-tca.yaml new file mode 100644 index 0000000..f006531 --- /dev/null +++ b/blueprints/k8s-tca.yaml @@ -0,0 +1,165 @@ +# +# ============LICENSE_START==================================================== +# ============================================================================= +# Copyright (c) 2018-2019 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 + +description: > + This blueprint deploys/manages the TCA module as a Docker container + +imports: + - https://www.getcloudify.org/spec/cloudify/4.5.5/types.yaml + - https://nexus.onap.org/service/local/repositories/raw/content/org.onap.dcaegen2.platform.plugins/R6/k8splugin/1.7.2/k8splugin_types.yaml +inputs: + aaiEnrichmentHost: + type: string + default: "aai.onap.svc.cluster.local" + aaiEnrichmentPort: + type: string + default: "8443" + enableAAIEnrichment: + type: string + default: true + dmaap_host: + type: string + default: message-router.onap.svc.cluster.local + dmaap_port: + type: string + default: "3904" + enableRedisCaching: + type: string + default: false + redisHosts: + type: string + default: dcae-redis.onap.svc.cluster.local:6379 + tag_version: + type: string + default: "nexus3.onap.org:10001/onap/org.onap.dcaegen2.deployments.tca-cdap-container:1.2.2" + consul_host: + type: string + default: consul-server.onap.svc.cluster.local + consul_port: + type: string + default: "8500" + cbs_host: + type: string + default: "config-binding-service.dcae.svc.cluster.local" + cbs_port: + type: string + default: "10000" + policy_id: + type: string + default: "none" + external_port: + type: string + description: Kubernetes node port on which CDAPgui is exposed + default: "32010" + +node_templates: + tca_k8s: + type: dcae.nodes.ContainerizedPlatformComponent + properties: + name: 'dcae-tca-analytics' + dns_name: 'dcae-tca-analytics' + image: + get_input: tag_version + log_info: + log_directory: "/opt/app/TCAnalytics/logs" + resource_config: + limits: + cpu: '1' + requests: + cpu: '0.5' + application_config: + app_config: + appDescription: DCAE Analytics Threshold Crossing Alert Application + appName: dcae-tca + tcaAlertsAbatementTableName: TCAAlertsAbatementTable + tcaAlertsAbatementTableTTLSeconds: '1728000' + tcaSubscriberOutputStreamName: TCASubscriberOutputStream + tcaVESAlertsTableName: TCAVESAlertsTable + tcaVESAlertsTableTTLSeconds: '1728000' + tcaVESMessageStatusTableName: TCAVESMessageStatusTable + tcaVESMessageStatusTableTTLSeconds: '86400' + thresholdCalculatorFlowletInstances: '2' + app_preferences: + aaiEnrichmentHost: + get_input: aaiEnrichmentHost + aaiEnrichmentIgnoreSSLCertificateErrors: 'true' + aaiEnrichmentPortNumber: '8443' + aaiEnrichmentProtocol: https + aaiEnrichmentUserName: dcae@dcae.onap.org + aaiEnrichmentUserPassword: demo123456! + aaiVMEnrichmentAPIPath: /aai/v11/search/nodes-query + aaiVNFEnrichmentAPIPath: /aai/v11/network/generic-vnfs/generic-vnf + enableAAIEnrichment: + get_input: enableAAIEnrichment + enableRedisCaching: + get_input: enableRedisCaching + redisHosts: + get_input: redisHosts + enableAlertCEFFormat: 'false' + publisherContentType: application/json + publisherHostName: + get_input: dmaap_host + publisherHostPort: + get_input: dmaap_port + publisherMaxBatchSize: '1' + publisherMaxRecoveryQueueSize: '100000' + publisherPollingInterval: '20000' + publisherProtocol: http + publisherTopicName: unauthenticated.DCAE_CL_OUTPUT + subscriberConsumerGroup: OpenDCAE-c12 + subscriberConsumerId: c12 + subscriberContentType: application/json + subscriberHostName: + get_input: dmaap_host + subscriberHostPort: + get_input: dmaap_port + subscriberMessageLimit: '-1' + subscriberPollingInterval: '30000' + subscriberProtocol: http + subscriberTimeoutMS: '-1' + subscriberTopicName: unauthenticated.VES_MEASUREMENT_OUTPUT + tca_policy: '{"domain":"measurementsForVfScaling","metricsPerEventName":[{"eventName":"vFirewallBroadcastPackets","controlLoopSchemaType":"VM","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"}]}]}' + interfaces: + cloudify.interfaces.lifecycle: + start: + inputs: + envs: + DMAAPHOST: + { get_input: dmaap_host } + DMAAPPORT: + { get_input: dmaap_port } + DMAAPPUBTOPIC: "unauthenticated.DCAE_CL_OUTPUT" + DMAAPSUBTOPIC: "unauthenticated.VES_MEASUREMENT_OUTPUT" + AAIHOST: + { get_input: aaiEnrichmentHost } + AAIPORT: + { get_input: aaiEnrichmentPort } + CONSUL_HOST: + { get_input: consul_host } + CONSUL_PORT: + { get_input: consul_port } + CBS_HOST: + { get_input: cbs_host } + CBS_PORT: + { get_input: cbs_port } + CONFIG_BINDING_SERVICE: "config_binding_service" + ports: + - concat: ["11011:", "0"] + diff --git a/blueprints/k8s-tca.yaml-template b/blueprints/k8s-tca.yaml-template deleted file mode 100644 index 78c3f03..0000000 --- a/blueprints/k8s-tca.yaml-template +++ /dev/null @@ -1,165 +0,0 @@ -# -# ============LICENSE_START==================================================== -# ============================================================================= -# Copyright (c) 2018-2019 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 - -description: > - This blueprint deploys/manages the TCA module as a Docker container - -imports: - - https://www.getcloudify.org/spec/cloudify/4.5.5/types.yaml - - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/k8splugin/1.7.2/k8splugin_types.yaml -inputs: - aaiEnrichmentHost: - type: string - default: "aai.onap.svc.cluster.local" - aaiEnrichmentPort: - type: string - default: "8443" - enableAAIEnrichment: - type: string - default: true - dmaap_host: - type: string - default: message-router.onap.svc.cluster.local - dmaap_port: - type: string - default: "3904" - enableRedisCaching: - type: string - default: false - redisHosts: - type: string - default: dcae-redis.onap.svc.cluster.local:6379 - tag_version: - type: string - default: "{{ ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_releases }}/onap/org.onap.dcaegen2.deployments.tca-cdap-container:1.2.2" - consul_host: - type: string - default: consul-server.onap.svc.cluster.local - consul_port: - type: string - default: "8500" - cbs_host: - type: string - default: "config-binding-service.dcae.svc.cluster.local" - cbs_port: - type: string - default: "10000" - policy_id: - type: string - default: "none" - external_port: - type: string - description: Kubernetes node port on which CDAPgui is exposed - default: "32010" - -node_templates: - tca_k8s: - type: dcae.nodes.ContainerizedPlatformComponent - properties: - name: 'dcae-tca-analytics' - dns_name: 'dcae-tca-analytics' - image: - get_input: tag_version - log_info: - log_directory: "/opt/app/TCAnalytics/logs" - resource_config: - limits: - cpu: '1' - requests: - cpu: '0.5' - application_config: - app_config: - appDescription: DCAE Analytics Threshold Crossing Alert Application - appName: dcae-tca - tcaAlertsAbatementTableName: TCAAlertsAbatementTable - tcaAlertsAbatementTableTTLSeconds: '1728000' - tcaSubscriberOutputStreamName: TCASubscriberOutputStream - tcaVESAlertsTableName: TCAVESAlertsTable - tcaVESAlertsTableTTLSeconds: '1728000' - tcaVESMessageStatusTableName: TCAVESMessageStatusTable - tcaVESMessageStatusTableTTLSeconds: '86400' - thresholdCalculatorFlowletInstances: '2' - app_preferences: - aaiEnrichmentHost: - get_input: aaiEnrichmentHost - aaiEnrichmentIgnoreSSLCertificateErrors: 'true' - aaiEnrichmentPortNumber: '8443' - aaiEnrichmentProtocol: https - aaiEnrichmentUserName: dcae@dcae.onap.org - aaiEnrichmentUserPassword: demo123456! - aaiVMEnrichmentAPIPath: /aai/v11/search/nodes-query - aaiVNFEnrichmentAPIPath: /aai/v11/network/generic-vnfs/generic-vnf - enableAAIEnrichment: - get_input: enableAAIEnrichment - enableRedisCaching: - get_input: enableRedisCaching - redisHosts: - get_input: redisHosts - enableAlertCEFFormat: 'false' - publisherContentType: application/json - publisherHostName: - get_input: dmaap_host - publisherHostPort: - get_input: dmaap_port - publisherMaxBatchSize: '1' - publisherMaxRecoveryQueueSize: '100000' - publisherPollingInterval: '20000' - publisherProtocol: http - publisherTopicName: unauthenticated.DCAE_CL_OUTPUT - subscriberConsumerGroup: OpenDCAE-c12 - subscriberConsumerId: c12 - subscriberContentType: application/json - subscriberHostName: - get_input: dmaap_host - subscriberHostPort: - get_input: dmaap_port - subscriberMessageLimit: '-1' - subscriberPollingInterval: '30000' - subscriberProtocol: http - subscriberTimeoutMS: '-1' - subscriberTopicName: unauthenticated.VES_MEASUREMENT_OUTPUT - tca_policy: '{"domain":"measurementsForVfScaling","metricsPerEventName":[{"eventName":"vFirewallBroadcastPackets","controlLoopSchemaType":"VM","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"}]}]}' - interfaces: - cloudify.interfaces.lifecycle: - start: - inputs: - envs: - DMAAPHOST: - { get_input: dmaap_host } - DMAAPPORT: - { get_input: dmaap_port } - DMAAPPUBTOPIC: "unauthenticated.DCAE_CL_OUTPUT" - DMAAPSUBTOPIC: "unauthenticated.VES_MEASUREMENT_OUTPUT" - AAIHOST: - { get_input: aaiEnrichmentHost } - AAIPORT: - { get_input: aaiEnrichmentPort } - CONSUL_HOST: - { get_input: consul_host } - CONSUL_PORT: - { get_input: consul_port } - CBS_HOST: - { get_input: cbs_host } - CBS_PORT: - { get_input: cbs_port } - CONFIG_BINDING_SERVICE: "config_binding_service" - ports: - - concat: ["11011:", "0"] - diff --git a/blueprints/k8s-ves.yaml b/blueprints/k8s-ves.yaml new file mode 100644 index 0000000..7a45a5c --- /dev/null +++ b/blueprints/k8s-ves.yaml @@ -0,0 +1,130 @@ +# -*- indent-tabs-mode: nil -*- # vi: set expandtab: +# +# ============LICENSE_START==================================================== +# ============================================================================= +# Copyright (c) 2018-2019 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: + - https://www.getcloudify.org/spec/cloudify/4.5.5/types.yaml + - https://nexus.onap.org/service/local/repositories/raw/content/org.onap.dcaegen2.platform.plugins/R6/k8splugin/1.7.2/k8splugin_types.yaml + +inputs: + ves_other_publish_url: + type: string + default: "http://message-router.onap.svc.cluster.local:3904/events/unauthenticated.SEC_OTHER_OUTPUT" + ves_heartbeat_publish_url: + type: string + default: "http://message-router.onap.svc.cluster.local:3904/events/unauthenticated.SEC_HEARTBEAT_OUTPUT" + ves_fault_publish_url: + type: string + default: "http://message-router.onap.svc.cluster.local:3904/events/unauthenticated.SEC_FAULT_OUTPUT" + ves_measurement_publish_url: + type: string + default: "http://message-router.onap.svc.cluster.local:3904/events/unauthenticated.VES_MEASUREMENT_OUTPUT" + ves_notification_publish_url: + type: string + default: "http://message-router.onap.svc.cluster.local:3904/events/unauthenticated.VES_NOTIFICATION_OUTPUT" + ves_pnfRegistration_publish_url: + type: string + default: "http://message-router.onap.svc.cluster.local:3904/events/unauthenticated.VES_PNFREG_OUTPUT" + tag_version: + type: string + default: "{{ ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_releases }}/onap/org.onap.dcaegen2.collectors.ves.vescollector:1.5.2" + external_port: + type: string + description: Kubernetes node port on which collector is exposed + default: "30235" + external_tls_port: + type: string + description: Kubernetes node port on which collector is exposed for https + default: "30417" + replicas: + type: integer + description: number of instances + default: 1 +node_templates: + ves: + interfaces: + cloudify.interfaces.lifecycle: + start: + inputs: + ports: + - concat: ["8080:", { get_input: external_port }] + - concat: ["8443:", { get_input: external_tls_port }] + properties: + application_config: + collector.dmaap.streamid: fault=ves-fault|syslog=ves-syslog|heartbeat=ves-heartbeat|measurementsForVfScaling=ves-measurement|measurement=ves-measurement|mobileFlow=ves-mobileflow|other=ves-other|stateChange=ves-statechange|thresholdCrossingAlert=ves-thresholdCrossingAlert|voiceQuality=ves-voicequality|sipSignaling=ves-sipsignaling|notification=ves-notification|pnfRegistration=ves-pnfRegistration + collector.inputQueue.maxPending: "8096" + 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.1.json\",\"v7\":\"./etc/CommonEventFormat_30.0.1.json\"}" + collector.service.port: "8080" + collector.service.secure.port: "8443" + event.transform.flag: "0" + auth.method: "noAuth" + header.authlist: "sample1,$2a$10$0buh.2WeYwN868YMwnNNEuNEAMNYVU9.FSMJGyIKV3dGET/7oGOi6" + 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 + ves-notification: + dmaap_info: + topic_url: + get_input: ves_notification_publish_url + type: message_router + ves-pnfRegistration: + dmaap_info: + topic_url: + get_input: ves_pnfRegistration_publish_url + type: message_router + ves-heartbeat: + dmaap_info: + topic_url: + get_input: ves_heartbeat_publish_url + type: message_router + ves-other: + dmaap_info: + topic_url: + get_input: ves_other_publish_url + type: message_router + collector.dynamic.config.update.frequency: "5" + docker_config: + healthcheck: + endpoint: /healthcheck + interval: 15s + timeout: 1s + type: http + image: + get_input: tag_version + replicas: {get_input: replicas} + name: 'dcae-ves-collector' + dns_name: 'dcae-ves-collector' + log_info: + log_directory: "/opt/app/VESCollector/logs/ecomp" + type: dcae.nodes.ContainerizedPlatformComponent + + diff --git a/blueprints/k8s-ves.yaml-template b/blueprints/k8s-ves.yaml-template deleted file mode 100644 index bb372a9..0000000 --- a/blueprints/k8s-ves.yaml-template +++ /dev/null @@ -1,130 +0,0 @@ -# -*- indent-tabs-mode: nil -*- # vi: set expandtab: -# -# ============LICENSE_START==================================================== -# ============================================================================= -# Copyright (c) 2018-2019 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: - - https://www.getcloudify.org/spec/cloudify/4.5.5/types.yaml - - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/k8splugin/1.7.2/k8splugin_types.yaml - -inputs: - ves_other_publish_url: - type: string - default: "http://message-router.onap.svc.cluster.local:3904/events/unauthenticated.SEC_OTHER_OUTPUT" - ves_heartbeat_publish_url: - type: string - default: "http://message-router.onap.svc.cluster.local:3904/events/unauthenticated.SEC_HEARTBEAT_OUTPUT" - ves_fault_publish_url: - type: string - default: "http://message-router.onap.svc.cluster.local:3904/events/unauthenticated.SEC_FAULT_OUTPUT" - ves_measurement_publish_url: - type: string - default: "http://message-router.onap.svc.cluster.local:3904/events/unauthenticated.VES_MEASUREMENT_OUTPUT" - ves_notification_publish_url: - type: string - default: "http://message-router.onap.svc.cluster.local:3904/events/unauthenticated.VES_NOTIFICATION_OUTPUT" - ves_pnfRegistration_publish_url: - type: string - default: "http://message-router.onap.svc.cluster.local:3904/events/unauthenticated.VES_PNFREG_OUTPUT" - tag_version: - type: string - default: "{{ ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_releases }}/onap/org.onap.dcaegen2.collectors.ves.vescollector:1.5.2" - external_port: - type: string - description: Kubernetes node port on which collector is exposed - default: "30235" - external_tls_port: - type: string - description: Kubernetes node port on which collector is exposed for https - default: "30417" - replicas: - type: integer - description: number of instances - default: 1 -node_templates: - ves: - interfaces: - cloudify.interfaces.lifecycle: - start: - inputs: - ports: - - concat: ["8080:", { get_input: external_port }] - - concat: ["8443:", { get_input: external_tls_port }] - properties: - application_config: - collector.dmaap.streamid: fault=ves-fault|syslog=ves-syslog|heartbeat=ves-heartbeat|measurementsForVfScaling=ves-measurement|measurement=ves-measurement|mobileFlow=ves-mobileflow|other=ves-other|stateChange=ves-statechange|thresholdCrossingAlert=ves-thresholdCrossingAlert|voiceQuality=ves-voicequality|sipSignaling=ves-sipsignaling|notification=ves-notification|pnfRegistration=ves-pnfRegistration - collector.inputQueue.maxPending: "8096" - 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.1.json\",\"v7\":\"./etc/CommonEventFormat_30.0.1.json\"}" - collector.service.port: "8080" - collector.service.secure.port: "8443" - event.transform.flag: "0" - auth.method: "noAuth" - header.authlist: "sample1,$2a$10$0buh.2WeYwN868YMwnNNEuNEAMNYVU9.FSMJGyIKV3dGET/7oGOi6" - 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 - ves-notification: - dmaap_info: - topic_url: - get_input: ves_notification_publish_url - type: message_router - ves-pnfRegistration: - dmaap_info: - topic_url: - get_input: ves_pnfRegistration_publish_url - type: message_router - ves-heartbeat: - dmaap_info: - topic_url: - get_input: ves_heartbeat_publish_url - type: message_router - ves-other: - dmaap_info: - topic_url: - get_input: ves_other_publish_url - type: message_router - collector.dynamic.config.update.frequency: "5" - docker_config: - healthcheck: - endpoint: /healthcheck - interval: 15s - timeout: 1s - type: http - image: - get_input: tag_version - replicas: {get_input: replicas} - name: 'dcae-ves-collector' - dns_name: 'dcae-ves-collector' - log_info: - log_directory: "/opt/app/VESCollector/logs/ecomp" - type: dcae.nodes.ContainerizedPlatformComponent - - diff --git a/blueprints/pom.xml b/blueprints/pom.xml deleted file mode 100644 index 9b886ea..0000000 --- a/blueprints/pom.xml +++ /dev/null @@ -1,174 +0,0 @@ - - - - 4.0.0 - - org.onap.dcaegen2.platform - blueprints - 1.2.0-SNAPSHOT - - org.onap.dcaegen2.platform.blueprints - blueprints - blueprints - 1.0.0-SNAPSHOT - http://maven.apache.org - - - UTF-8 - true - . - - - - - py - Python - **/*.py - - - - - ${project.artifactId}-${project.version} - - - - - org.codehaus.mojo - exec-maven-plugin - 1.2.1 - - - clean phase script - clean - - exec - - - - ${project.artifactId} - clean - - - - - generate-sources script - generate-sources - - exec - - - - ${project.artifactId} - generate-sources - - - - - compile script - compile - - exec - - - - ${project.artifactId} - compile - - - - - package script - package - - exec - - - - ${project.artifactId} - package - - - - - test script - test - - exec - - - - ${project.artifactId} - test - - - - - install script - install - - exec - - - - ${project.artifactId} - install - - - - - deploy script - deploy - - exec - - - - ${project.artifactId} - deploy - - - - - - - - diff --git a/blueprints/reference_templates/DeploymentHandler-README.md b/blueprints/reference_templates/DeploymentHandler-README.md deleted file mode 100644 index 8b76890..0000000 --- a/blueprints/reference_templates/DeploymentHandler-README.md +++ /dev/null @@ -1,23 +0,0 @@ -## Deployment Handler Installation Blueprint -[`DeploymentHandler.yaml`](./DeploymentHandler.yaml) is a Cloudify blueprint that can be used to deploy an instance of the DCAE Deployment Handler (DH) as a Docker container in the DCAE Docker environment. - -### Input parameters -Some deployment parameters can be controlled via inputs supplied to Cloudify at the time a deployment is created from the blueprint. -The table below describes the available input parameters. - -Parameter|Description|Required?|Default ----------|-----------|---------|------- -`location_id`|Location where DH is to be deployed; should point to a central site|Yes|None -`docker_host_override`|Registered service name of the Docker host where DH should be deployed|Yes|`platform_dockerhost` -`deployment_handler_image`|Fully qualified name of the Docker image to use for DH|Yes|Current stable version of image -`application_config`|Application-specific configuration parameters (see below)|No|`{}` -`host_log_root`|root directory for logs in the Docker host file system|Yes|`/opt/onap/log` - -### Application configuration -The DH has sensible defaults for its configuration. The `application_config` input can be used to supply additional configuration information to override defaults and/or to set values for optional parameters. The content of this input is a dictionary with parameter names as keys and parameter values as values. See the documentation for the DH for the available configuration parameters. - -### Additional configuration -`DeploymentHandler.yaml` relies on the DCAE Docker plugin to carry out the actual deployment. The plugin gathers information from the blueprint and the inputs and uses this information to make API calls to a Docker Engine running in the DCAE environment. - -Certain aspects of Docker behavior are controlled through inputs to the plugin's `create` operation. This includes mapping directories and files from the host file system into the Docker container's file system. It is also possible to pass environment variables to the container. The inputs to the `create` operation are specified inside the blueprint in the `interfaces` section of node definition for the deployment handler. - diff --git a/blueprints/reference_templates/DeploymentHandler.yaml-template b/blueprints/reference_templates/DeploymentHandler.yaml-template deleted file mode 100644 index 4856636..0000000 --- a/blueprints/reference_templates/DeploymentHandler.yaml-template +++ /dev/null @@ -1,102 +0,0 @@ -# -*- indent-tabs-mode: nil -*- # vi: set expandtab: -# -# ============LICENSE_START========================================== -# org.onap.dcae -# =================================================================== -# Copyright © 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============================================ -# -# 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 DCAE deployment handler as a Docker container - -imports: - - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml - - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dockerplugin/2/dockerplugin_types.yaml - - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml - - -inputs: - - location_id: - description: Deployment location - - docker_host_override: - description: Target docker host - default: 'platform_dockerhost' - - deployment_handler_image: - description: Docker image for deployment handler - default: '{{ ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_releases }}/onap/org.onap.dcaegen2.platform.deployment-handler:3.2.0' - - application_config: - description: deployment handler application configuration (to override defaults) - default: {} - - host_log_root: - description: root directory for logs in the Docker host file system - default: '/opt/onap/log' - -node_templates: - - # Deployment Handler - deployment-handler: - type: dcae.nodes.DockerContainerForPlatforms - properties: - name: - 'deployment_handler' - image: - { get_input: deployment_handler_image } - application_config: - { get_input: application_config } - host_port: - 8188 - container_port: - 8443 - docker_config: - healthcheck: - type: 'http' - interval: '300s' - timeout: '5s' - endpoint: '/' - relationships: - - type: dcae.relationships.component_contained_in - target: docker_host - interfaces: - cloudify.interfaces.lifecycle: - start: - inputs: - envs: - SOMEVAR: somevalue - #volumes: - #- host: - #path: { concat: [ { get_input: host_log_root }, '/dcae/deployment_handler' ] } - #container: - #bind: /opt/app/dh/log - #mode: rw - - # Docker host - docker_host: - type: dcae.nodes.SelectedDockerHost - properties: - location_id: - { get_input: location_id } - docker_host_override: - { get_input: docker_host_override } diff --git a/blueprints/reference_templates/DockerBP.yaml-template b/blueprints/reference_templates/DockerBP.yaml-template deleted file mode 100644 index e655063..0000000 --- a/blueprints/reference_templates/DockerBP.yaml-template +++ /dev/null @@ -1,345 +0,0 @@ -# -*- 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 - - http://www.getcloudify.org/spec/openstack-plugin/1.4/plugin.yaml - - http://www.getcloudify.org/spec/fabric-plugin/1.4.1/plugin.yaml - - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/dnsdesig/dns_types.yaml - - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/sshkeyshare/sshkey_types.yaml - - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml - - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dockerplugin/2/dockerplugin_types.yaml - - - -inputs: - registered_dockerhost_name: - description: the name that this Dockerhost is registered as - location_id: - description: the location ID for the location where the Docker hsot is being deployed - type: string - target_datacenter: - description: |- - This is the name of the target Consul datacenter that the docker host will try to join - type: string - registrator_image: - description: |- - Full uri to registrator Docker image. Note! You should be using the forked version of - registrator in order to have Consul health checks for Docker containers. - type: string - centos7image_id: - type: string - default: '' - ubuntu1604image_id: - type: string - flavor_id: - type: string - security_group: - type: string - public_net: - type: string - private_net: - type: string - openstack: {} - keypair: - type: string - location_prefix: - type: string - location_domain: - type: string - node_name: - description: Used to construct the fqdn of the docker host - type: string - default: dokr00 - key_filename: - type: string - codesource_url: - type: string - codesource_version: - type: string - vm_init_dokr_00: - type: string - default: |- - #!/bin/sh - set -x - DATACENTER= - vm_init_dokr_01: - type: string - default: |- - REGNAME= - vm_init_dokr_fqdn: - type: string - description: |- - The FQDN environment variable is to be used in the cloud init script for the Docker host. - This is to be applied as metadata on the Consul node for the Docker host under the key - "fqdn". - default: |- - FQDN= - vm_init_dokr_service_tags: - type: string - description: |- - Environment variable assigned to a list of strings that are to be used as tags to label - the docker host. These tags are used when registering the docker host as a service in - Consul. The format of this input parameter is a string that is a shell script variable - assignment of the variable SERVICE_TAGS. It must be either null or a json array of strings. - Here is a valid example of when the value is a json array: - - 'SERVICE_TAGS="[\"foo\", \"bar\"]"' - - Note how the double quotes per array element are escaped. - default: "SERVICE_TAGS=null" - vm_init_dokr_02: - type: string - default: | - MYIP=`wget -qO- http://169.254.169.254/2009-04-04/meta-data/local-ipv4` - while [ -z "$MYPUB" ]; do - MYPUB=`wget -qO- http://169.254.169.254/2009-04-04/meta-data/public-ipv4` - sleep 5 - done - echo "My public IP: $MYPUB" - MYNAME=`hostname` - echo >>/etc/hosts - echo $MYIP $MYNAME >>/etc/hosts - - # Grab nameservers to be used to setup recursors for Consul - cat < /tmp/grab_nameservers.py - with open("/etc/resolv.conf", "r") as f: - nss = [line.split(" ")[1].strip() for line in f.readlines() if line.startswith("nameserver")] - print("[\"{0}\"]".format("\",\"".join(nss))) - EOF - NAMESERVERS=$(python3 /tmp/grab_nameservers.py) - - mkdir -p /opt/consul/config /opt/consul/data /opt/consul/bin - # Download Consul from Nexus - apt-get update - DEBIAN_FRONTEND=noninteractive apt-get install -y -q unzip - CONSUL_BIN_DIR=/opt/consul/bin - curl -Ss https://releases.hashicorp.com/consul/0.8.3/consul_0.8.3_linux_amd64.zip > $CONSUL_BIN_DIR/consul_0.8.3_linux_amd64.zip - unzip $CONSUL_BIN_DIR/consul_0.8.3_linux_amd64.zip -d $CONSUL_BIN_DIR - # NOTE: The health check for the docker host is a simple existence look up for - # registrator (name is hardcoded). It does not check if registrator is running. - # This would require a script health check which means we might need to turn on - # "enable_script_check". - # NOTE: At the time of this change, there is no issue but there could be a - # chicken-and-egg issue where the health check might depend upon future downstream - # nodes (registrator) that downstream node requires a *healthy* docker host. - cat < /opt/consul/config/consul.json - { - "bind_addr" : "0.0.0.0", - "client_addr" : "0.0.0.0", - "advertise_addr" : "$MYIP", - "data_dir" : "/opt/consul/data", - "datacenter": "$DATACENTER", - "http_api_response_headers": { - "Access-Control-Allow-Origin" : "*" - }, - "rejoin_after_leave": true, - "server": false, - "ui": false, - "enable_syslog": true, - "log_level": "info", - "ports": { - "dns": 53 - }, - "recursors": $NAMESERVERS, - "service" : { - "id": "$REGNAME", - "name": "$REGNAME", - "address": "$MYPUB", - "port": 2376, - "tags": $SERVICE_TAGS, - "checks": [ - { - "http": "http://$MYPUB:2376/containers/registrator/json", - "interval": "30s" - } - ] - }, - "node_meta": { - "fqdn": "$FQDN" - } - } - EOF - - # Specify DOCKER_HOST environment variable to support healthchecks for Docker containers - # in Consul. Tried using the local unix socket but that did not work (possible bug in Consul) - # so forcing to use the http connection to Docker engine. - cat < /lib/systemd/system/consul.service - [Unit] - Description=Consul - Requires=network-online.target - After=network.target - [Service] - Type=simple - Environment=DOCKER_HOST=tcp://localhost:2376 - ExecStart=/opt/consul/bin/consul agent -config-dir=/opt/consul/config - ExecReload=/bin/kill -HUP \$MAINPID - [Install] - WantedBy=multi-user.target - EOF - systemctl enable consul - systemctl start consul - until /opt/consul/bin/consul join "cloudify-manager-${DATACENTER}" - do - echo Waiting to join Consul cluster - sleep 60 - done - - DEBIAN_FRONTEND=noninteractive apt-get install -y -q linux-image-extra-`uname -r` linux-image-extra-virtual apparmor dirmngr - DEBIAN_FRONTEND=noninteractive apt-get install -y -q docker.io - echo 'DOCKER_OPTS="--raw-logs -H tcp://0.0.0.0:2376 -H unix:///var/run/docker.sock"' >>/etc/default/docker - systemctl restart docker -node_templates: - key_pair: - type: cloudify.openstack.nodes.KeyPair - properties: - private_key_path: { get_input: key_filename } - use_external_resource: True - resource_id: { get_input: keypair } - openstack_config: &open_conf - get_input: openstack - private_net: - type: cloudify.openstack.nodes.Network - properties: - use_external_resource: True - resource_id: { get_input: private_net } - openstack_config: *open_conf - security_group: - type: cloudify.openstack.nodes.SecurityGroup - properties: - use_external_resource: True - resource_id: { get_input: security_group } - openstack_config: *open_conf - fixedip_dokr00: - type: cloudify.openstack.nodes.Port - properties: - port: - extra_dhcp_opts: - - opt_name: 'domain-name' - opt_value: { get_input: location_domain } - openstack_config: *open_conf - relationships: - - type: cloudify.relationships.contained_in - target: private_net - floatingip_dokr00: - type: cloudify.openstack.nodes.FloatingIP - properties: - openstack_config: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - floating_network_name: { get_input: public_net } - dns_dokr00: - type: ccsdk.nodes.dns.arecord - properties: - fqdn: { concat: [ { get_input: location_prefix }, { get_input: node_name }, '.', { get_input: location_domain } ] } - openstack: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - ip_addresses: - - { get_attribute: [ floatingip_dokr00, floating_ip_address ] } - relationships: - - type: cloudify.relationships.depends_on - target: floatingip_dokr00 - host_dokr00: - type: cloudify.openstack.nodes.Server - properties: - install_agent: false - image: { get_input: ubuntu1604image_id } - flavor: { get_input: flavor_id } - management_network_name: { get_input: private_net } - openstack_config: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - name: { concat: [ { get_input: location_prefix }, { get_input: node_name }] } - userdata: - concat: - - { get_input: vm_init_dokr_00 } - - { get_input: target_datacenter } - - |+ - - - { get_input: vm_init_dokr_01 } - - { get_input: registered_dockerhost_name } - - |+ - - - { get_input: vm_init_dokr_fqdn } - - { get_property: [ dns_dokr00, fqdn ] } - - |+ - - - { get_input: vm_init_dokr_service_tags } - - |+ - - - { get_input: vm_init_dokr_02 } - relationships: - - type: cloudify.openstack.server_connected_to_port - target: fixedip_dokr00 - - type: cloudify.openstack.server_connected_to_security_group - target: security_group - - type: cloudify.openstack.server_connected_to_floating_ip - target: floatingip_dokr00 - - type: cloudify.openstack.server_connected_to_keypair - target: key_pair - - type: cloudify.relationships.depends_on - target: dns_dokr00 - - registrator: - type: dcae.nodes.DockerContainer - properties: - name: - 'registrator' - image: - { get_input: registrator_image } - relationships: - - type: dcae.relationships.component_contained_in - target: docker_host - interfaces: - cloudify.interfaces.lifecycle: - start: - inputs: - envs: - EXTERNAL_IP: - get_attribute: [ floatingip_dokr00, floating_ip_address ] - volumes: - - host: - path: '/var/run/docker.sock' - container: - bind: '/tmp/docker.sock' - mode: 'ro' - - docker_host: - type: dcae.nodes.SelectedDockerHost - properties: - location_id: - { get_input: location_id } - docker_host_override: - { get_input: registered_dockerhost_name } - relationships: - - type: cloudify.relationships.depends_on #this is to avoid a race condition - target: host_dokr00 diff --git a/blueprints/reference_templates/README.txt b/blueprints/reference_templates/README.txt deleted file mode 100644 index 3834c38..0000000 --- a/blueprints/reference_templates/README.txt +++ /dev/null @@ -1,52 +0,0 @@ -Blueprints used for deployment of VM's and cluster for DCAE deployment (Amsterdam release) -========================================================================================= -centos_vm.yaml-template -DockerBP.yaml-template -consul_cluster.yaml-template -cdap-sdk.yaml-template -cdapbp7.yaml-template -pgaas-database.yaml-template -pgaas-cluster.yaml-template -pgaas-onevm.yaml-template -pgaas-getdbinfo.yaml-template -pgaas-disk.yaml-template -pgaas.yaml-template - - -Blueprint used for spinning up Platform components in VM's (Amsterdam release) -============================================================================== -centos_vm.yaml-template -inventory.yaml-template -cdap_broker.yaml-template -policy_handler.yaml-template -DeploymentHandler.yaml-template -config_binding_service.yaml-template - -Blueprint used for spinning up Service components in VM's (Amsterdam release) -============================================================================== -holmes-rules.yaml-template -holmes-engine.yaml-template -heartbeat-service.yaml-template -ves.yaml-template -tca.yaml-template -snmptrap-collector.yaml-template -prh-service.yaml-template -tcadocker-service.yaml-template - - -Blueprints used for K8S deployment through K8SPlugin -==================================================== -k8s-policy_handler.yaml-template -k8s-inventory.yaml-template -k8s-deployment_handler.yaml-template -k8s-config_binding_service.yaml-template - - -Blueprints used for testing dmaap plugin -======================================== -test_dr_mr.yaml-template -test_dr_pubsub.yaml-template -test_mr_multipub.yaml-template -test_mr_multisub.yaml-template -test_mr_pubsub_extra.yaml-template -test_mr_pubsub.yaml-template diff --git a/blueprints/reference_templates/cdap-sdk.yaml-template b/blueprints/reference_templates/cdap-sdk.yaml-template deleted file mode 100644 index cd1244f..0000000 --- a/blueprints/reference_templates/cdap-sdk.yaml-template +++ /dev/null @@ -1,71 +0,0 @@ -# ============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: - - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dockerplugin/2/dockerplugin_types.yaml - - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml - -inputs: - dh_override: - type: string - default: "component_dockerhost" - dh_location_id: - type: string - default: "dcaeams" - cdap_cluster_name: - type: string - default: "cdap" -node_templates: - docker_cdap_host: - properties: - docker_host_override: - get_input: dh_override - location_id: - get_input: dh_location_id - type: dcae.nodes.SelectedDockerHost - cdapdocker: - interfaces: - cloudify.interfaces.lifecycle: - stop: - inputs: - cleanup_image: true - start: - inputs: - ports: - - '11011:11011' - envs: - SERVICE_11015_NAME: { get_input: cdap_cluster_name } - SERVICE_11011_IGNORE: 'true' - properties: - host_port: 11015 - container_port: 11015 - docker_config: - healthcheck: - endpoint: "/status" - interval: "15s" - timeout: "15s" - type: "http" - name: 'cdap_docker' - image: "caskdata/cdap-standalone:4.1.2" - relationships: - - type: dcae.relationships.component_contained_in - target: docker_cdap_host - type: dcae.nodes.DockerContainerForPlatforms - diff --git a/blueprints/reference_templates/cdap_broker.yaml-template b/blueprints/reference_templates/cdap_broker.yaml-template deleted file mode 100644 index 3c29634..0000000 --- a/blueprints/reference_templates/cdap_broker.yaml-template +++ /dev/null @@ -1,97 +0,0 @@ -# -*- 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 - -description: > - This blueprint is for managing the CDAP infrastructure - -imports: - - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml - - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/cdapcloudify/14/cdapcloudify_types.yaml - - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dockerplugin/2/dockerplugin_types.yaml - - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml - -inputs: - location_id: - type: string - default: "" - cdap_cluster_name: - type: string - default: "cdap" - -node_templates: - - broker_deleter: - #does nothing on install, but deletes all registered apps when broker is uninstalled - #uninstalling the broker without doing this leaves them in purgatory forever, unless CDAP was also uninstalled, but that may or may not be true or in the same blueprint. - type: dcae.nodes.broker_deleter - interfaces: - cloudify.interfaces.lifecycle: - delete: - inputs: - connected_broker_dns_name: { get_property: [cdap_broker, name] } - relationships: - - type: cloudify.relationships.depends_on - target: cdap_broker - - cdap_broker: - type: dcae.nodes.DockerContainerForPlatforms - properties: - name: 'cdap_broker' - application_config: - bindingttw: 5 - hcinterval: 60s - autoderegisterafter: 10m - pipelinehealthlimit: 2 - host_port: 7777 - container_port: 7777 - docker_config: - healthcheck: - type: "http" - #broker has a semi healthcheck endpoint at root right now, TODO would be to add a real /healtcheck endpoint - endpoint: "/" - interval: "120s" - timeout: "60s" - image: "{{ ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_releases }}/onap/org.onap.dcaegen2.platform.cdapbroker:v4.0.0" - interfaces: - cloudify.interfaces.lifecycle: - start: - inputs: - envs: - CDAP_CLUSTER_TO_MANAGE: { get_input: cdap_cluster_name } - volumes: - - host: - path: '/tmp/log/cdapbroker/' - container: - bind: '/tmp/log/cdapbroker/' #Broker EELF log directory - mode: 'rw' - relationships: - - type: dcae.relationships.component_contained_in - target: docker_host - - docker_host: - type: dcae.nodes.SelectedDockerHost - properties: - location_id: - { get_input: location_id } - docker_host_override: - 'platform_dockerhost' - #WARNING: ASSUMES THIS EXISTS AND IS ALREADY REGISTERED diff --git a/blueprints/reference_templates/cdapbp7.yaml-template b/blueprints/reference_templates/cdapbp7.yaml-template deleted file mode 100644 index 7fddaa1..0000000 --- a/blueprints/reference_templates/cdapbp7.yaml-template +++ /dev/null @@ -1,1054 +0,0 @@ -# -*- 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 - - http://www.getcloudify.org/spec/openstack-plugin/1.4/plugin.yaml - - http://www.getcloudify.org/spec/fabric-plugin/1.4.1/plugin.yaml - - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/dnsdesig/dns_types.yaml - - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/sshkeyshare/sshkey_types.yaml - -inputs: - centos7image_id: - type: string - default: '' - ubuntu1404image_id: - type: string - default: '' - ubuntu1604image_id: - type: string - flavor_id: - type: string - security_group: - type: string - public_net: - type: string - private_net: - type: string - openstack: {} - keypair: - type: string - location_prefix: - type: string - location_domain: - type: string - key_filename: - type: string - codesource_url: - type: string - codesource_version: - type: string - - vm_init_cdap: - type: string - default: | - wget -qO- $CODE_SOURCE/${CODE_VERSION}/cloud_init/cdap-init.sh >/tmp/cdap-init.sh - sh /tmp/cdap-init.sh "$CODE_SOURCE" "$CODE_VERSION" "$CLUSTER_INDEX" "$CLUSTER_SIZE" "$CLUSTER_FQDNS" "$CLUSTER_LOCAL_IPS" "$CLUSTER_FLOATING_IPS" "$DATACENTER" "$REGISTERED_NAME" - location_id: - default: "solutioning-central" - cdap_cluster_name: - type: string - default: "cdap" - -node_templates: - key_pair: - type: cloudify.openstack.nodes.KeyPair - properties: - private_key_path: { get_input: key_filename } - use_external_resource: True - resource_id: { get_input: keypair } - openstack_config: &open_conf - get_input: openstack - private_net: - type: cloudify.openstack.nodes.Network - properties: - use_external_resource: True - resource_id: { get_input: private_net } - openstack_config: *open_conf - security_group: - type: cloudify.openstack.nodes.SecurityGroup - properties: - use_external_resource: True - resource_id: { get_input: security_group } - openstack_config: *open_conf - - sharedsshkey_cdap: - type: ccsdk.nodes.ssh.keypair - hostdeps_cdap: - type: cloudify.nodes.Root - relationships: - - type: cloudify.relationships.depends_on - target: dns_cdap00 - - type: cloudify.relationships.depends_on - target: fixedip_cdap00 - - type: cloudify.relationships.depends_on - target: dns_cdap01 - - type: cloudify.relationships.depends_on - target: fixedip_cdap01 - - type: cloudify.relationships.depends_on - target: dns_cdap02 - - type: cloudify.relationships.depends_on - target: fixedip_cdap02 - - type: cloudify.relationships.depends_on - target: dns_cdap03 - - type: cloudify.relationships.depends_on - target: fixedip_cdap03 - - type: cloudify.relationships.depends_on - target: dns_cdap04 - - type: cloudify.relationships.depends_on - target: fixedip_cdap04 - - type: cloudify.relationships.depends_on - target: dns_cdap05 - - type: cloudify.relationships.depends_on - target: fixedip_cdap05 - - type: cloudify.relationships.depends_on - target: dns_cdap06 - - type: cloudify.relationships.depends_on - target: fixedip_cdap06 - fixedip_cdap00: - type: cloudify.openstack.nodes.Port - properties: - port: - extra_dhcp_opts: - - opt_name: 'domain-name' - opt_value: { get_input: location_domain } - openstack_config: *open_conf - relationships: - - type: cloudify.relationships.contained_in - target: private_net - floatingip_cdap00: - type: cloudify.openstack.nodes.FloatingIP - properties: - openstack_config: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - floating_network_name: { get_input: public_net } - dns_cdap00: - type: ccsdk.nodes.dns.arecord - properties: - fqdn: { concat: [ { get_input: location_prefix }, 'cdap00.', { get_input: location_domain } ] } - openstack: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - ip_addresses: - - { get_attribute: [ floatingip_cdap00, floating_ip_address ] } - relationships: - - type: cloudify.relationships.depends_on - target: floatingip_cdap00 - host_cdap00: - type: cloudify.openstack.nodes.Server - properties: - install_agent: false - image: { get_input: ubuntu1604image_id } - flavor: { get_input: flavor_id } - management_network_name: { get_input: private_net } - openstack_config: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - name: { concat: [ { get_input: location_prefix }, 'cdap00' ] } - userdata: - concat: - - |- - #!/bin/sh - mkdir /root/.sshkey - echo ' - - { get_attribute: [ sharedsshkey_cdap, public ] } - - |- - ' >/root/.sshkey/id_rsa.pub - echo ' - - { get_attribute: [ sharedsshkey_cdap, base64private ] } - - |- - ' | base64 -d >/root/.sshkey/id_rsa - chmod 700 /root/.sshkey - chmod 600 /root/.sshkey/* - set -x - CLUSTER_INDEX=00 - CLUSTER_SIZE=7 - CLUSTER_FQDNS= - - { get_property: [ dns_cdap00, fqdn ] } - - ',' - - { get_property: [ dns_cdap01, fqdn ] } - - ',' - - { get_property: [ dns_cdap02, fqdn ] } - - ',' - - { get_property: [ dns_cdap03, fqdn ] } - - ',' - - { get_property: [ dns_cdap04, fqdn ] } - - ',' - - { get_property: [ dns_cdap05, fqdn ] } - - ',' - - { get_property: [ dns_cdap06, fqdn ] } - - "\nCLUSTER_FLOATING_IPS=" - - { get_attribute: [ floatingip_cdap00, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap01, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap02, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap03, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap04, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap05, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap06, floating_ip_address ] } - - "\nCLUSTER_LOCAL_IPS=" - - { get_attribute: [ fixedip_cdap00, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap01, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap02, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap03, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap04, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap05, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap06, fixed_ip_address ] } - - "\nCODE_SOURCE=" - - { get_input: codesource_url } - - "\nCODE_VERSION=" - - { get_input: codesource_version } - - "\n" - - "DATACENTER=" - - { get_input: location_id } - - "\n" - - { get_input: vm_init_cdap } - relationships: - - type: cloudify.openstack.server_connected_to_port - target: fixedip_cdap00 - - type: cloudify.openstack.server_connected_to_security_group - target: security_group - - type: cloudify.openstack.server_connected_to_floating_ip - target: floatingip_cdap00 - - type: cloudify.openstack.server_connected_to_keypair - target: key_pair - - type: cloudify.relationships.depends_on - target: hostdeps_cdap - - type: cloudify.relationships.depends_on - target: sharedsshkey_cdap - fixedip_cdap01: - type: cloudify.openstack.nodes.Port - properties: - port: - extra_dhcp_opts: - - opt_name: 'domain-name' - opt_value: { get_input: location_domain } - openstack_config: *open_conf - relationships: - - type: cloudify.relationships.contained_in - target: private_net - floatingip_cdap01: - type: cloudify.openstack.nodes.FloatingIP - properties: - openstack_config: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - floating_network_name: { get_input: public_net } - dns_cdap01: - type: ccsdk.nodes.dns.arecord - properties: - fqdn: { concat: [ { get_input: location_prefix }, 'cdap01.', { get_input: location_domain } ] } - openstack: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - ip_addresses: - - { get_attribute: [ floatingip_cdap01, floating_ip_address ] } - relationships: - - type: cloudify.relationships.depends_on - target: floatingip_cdap01 - host_cdap01: - type: cloudify.openstack.nodes.Server - properties: - install_agent: false - image: { get_input: ubuntu1604image_id } - flavor: { get_input: flavor_id } - management_network_name: { get_input: private_net } - openstack_config: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - name: { concat: [ { get_input: location_prefix }, 'cdap01' ] } - userdata: - concat: - - |- - #!/bin/sh - mkdir /root/.sshkey - echo ' - - { get_attribute: [ sharedsshkey_cdap, public ] } - - |- - ' >/root/.sshkey/id_rsa.pub - echo ' - - { get_attribute: [ sharedsshkey_cdap, base64private ] } - - |- - ' | base64 -d >/root/.sshkey/id_rsa - chmod 700 /root/.sshkey - chmod 600 /root/.sshkey/* - set -x - CLUSTER_INDEX=01 - CLUSTER_SIZE=7 - CLUSTER_FQDNS= - - { get_property: [ dns_cdap00, fqdn ] } - - ',' - - { get_property: [ dns_cdap01, fqdn ] } - - ',' - - { get_property: [ dns_cdap02, fqdn ] } - - ',' - - { get_property: [ dns_cdap03, fqdn ] } - - ',' - - { get_property: [ dns_cdap04, fqdn ] } - - ',' - - { get_property: [ dns_cdap05, fqdn ] } - - ',' - - { get_property: [ dns_cdap06, fqdn ] } - - "\nCLUSTER_FLOATING_IPS=" - - { get_attribute: [ floatingip_cdap00, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap01, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap02, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap03, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap04, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap05, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap06, floating_ip_address ] } - - "\nCLUSTER_LOCAL_IPS=" - - { get_attribute: [ fixedip_cdap00, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap01, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap02, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap03, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap04, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap05, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap06, fixed_ip_address ] } - - "\nCODE_SOURCE=" - - { get_input: codesource_url } - - "\nCODE_VERSION=" - - { get_input: codesource_version } - - "\n" - - "DATACENTER=" - - { get_input: location_id } - - "\n" - - { get_input: vm_init_cdap } - relationships: - - type: cloudify.openstack.server_connected_to_port - target: fixedip_cdap01 - - type: cloudify.openstack.server_connected_to_security_group - target: security_group - - type: cloudify.openstack.server_connected_to_floating_ip - target: floatingip_cdap01 - - type: cloudify.openstack.server_connected_to_keypair - target: key_pair - - type: cloudify.relationships.depends_on - target: hostdeps_cdap - - type: cloudify.relationships.depends_on - target: sharedsshkey_cdap - fixedip_cdap02: - type: cloudify.openstack.nodes.Port - properties: - port: - extra_dhcp_opts: - - opt_name: 'domain-name' - opt_value: { get_input: location_domain } - openstack_config: *open_conf - relationships: - - type: cloudify.relationships.contained_in - target: private_net - floatingip_cdap02: - type: cloudify.openstack.nodes.FloatingIP - properties: - openstack_config: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - floating_network_name: { get_input: public_net } - dns_cdap02: - type: ccsdk.nodes.dns.arecord - properties: - fqdn: { concat: [ { get_input: location_prefix }, 'cdap02.', { get_input: location_domain } ] } - openstack: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - ip_addresses: - - { get_attribute: [ floatingip_cdap02, floating_ip_address ] } - relationships: - - type: cloudify.relationships.depends_on - target: floatingip_cdap02 - host_cdap02: - type: cloudify.openstack.nodes.Server - properties: - install_agent: false - image: { get_input: ubuntu1604image_id } - flavor: { get_input: flavor_id } - management_network_name: { get_input: private_net } - openstack_config: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - name: { concat: [ { get_input: location_prefix }, 'cdap02' ] } - userdata: - concat: - - |- - #!/bin/sh - mkdir /root/.sshkey - echo ' - - { get_attribute: [ sharedsshkey_cdap, public ] } - - |- - ' >/root/.sshkey/id_rsa.pub - echo ' - - { get_attribute: [ sharedsshkey_cdap, base64private ] } - - |- - ' | base64 -d >/root/.sshkey/id_rsa - chmod 700 /root/.sshkey - chmod 600 /root/.sshkey/* - set -x - CLUSTER_INDEX=02 - CLUSTER_SIZE=7 - CLUSTER_FQDNS= - - { get_property: [ dns_cdap00, fqdn ] } - - ',' - - { get_property: [ dns_cdap01, fqdn ] } - - ',' - - { get_property: [ dns_cdap02, fqdn ] } - - ',' - - { get_property: [ dns_cdap03, fqdn ] } - - ',' - - { get_property: [ dns_cdap04, fqdn ] } - - ',' - - { get_property: [ dns_cdap05, fqdn ] } - - ',' - - { get_property: [ dns_cdap06, fqdn ] } - - "\nCLUSTER_FLOATING_IPS=" - - { get_attribute: [ floatingip_cdap00, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap01, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap02, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap03, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap04, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap05, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap06, floating_ip_address ] } - - "\nCLUSTER_LOCAL_IPS=" - - { get_attribute: [ fixedip_cdap00, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap01, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap02, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap03, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap04, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap05, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap06, fixed_ip_address ] } - - "\nCODE_SOURCE=" - - { get_input: codesource_url } - - "\nCODE_VERSION=" - - { get_input: codesource_version } - - "\n" - - "DATACENTER=" - - { get_input: location_id } - - "\n" - - "REGISTERED_NAME=" - - { get_input: cdap_cluster_name } - - "\n" - - { get_input: vm_init_cdap } - relationships: - - type: cloudify.openstack.server_connected_to_port - target: fixedip_cdap02 - - type: cloudify.openstack.server_connected_to_security_group - target: security_group - - type: cloudify.openstack.server_connected_to_floating_ip - target: floatingip_cdap02 - - type: cloudify.openstack.server_connected_to_keypair - target: key_pair - - type: cloudify.relationships.depends_on - target: hostdeps_cdap - - type: cloudify.relationships.depends_on - target: sharedsshkey_cdap - - fixedip_cdap03: - type: cloudify.openstack.nodes.Port - properties: - port: - extra_dhcp_opts: - - opt_name: 'domain-name' - opt_value: { get_input: location_domain } - openstack_config: *open_conf - relationships: - - type: cloudify.relationships.contained_in - target: private_net - floatingip_cdap03: - type: cloudify.openstack.nodes.FloatingIP - properties: - openstack_config: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - floating_network_name: { get_input: public_net } - dns_cdap03: - type: ccsdk.nodes.dns.arecord - properties: - fqdn: { concat: [ { get_input: location_prefix }, 'cdap03.', { get_input: location_domain } ] } - openstack: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - ip_addresses: - - { get_attribute: [ floatingip_cdap03, floating_ip_address ] } - relationships: - - type: cloudify.relationships.depends_on - target: floatingip_cdap03 - host_cdap03: - type: cloudify.openstack.nodes.Server - properties: - install_agent: false - image: { get_input: ubuntu1604image_id } - flavor: { get_input: flavor_id } - management_network_name: { get_input: private_net } - openstack_config: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - name: { concat: [ { get_input: location_prefix }, 'cdap03' ] } - userdata: - concat: - - |- - #!/bin/sh - mkdir /root/.sshkey - echo ' - - { get_attribute: [ sharedsshkey_cdap, public ] } - - |- - ' >/root/.sshkey/id_rsa.pub - echo ' - - { get_attribute: [ sharedsshkey_cdap, base64private ] } - - |- - ' | base64 -d >/root/.sshkey/id_rsa - chmod 700 /root/.sshkey - chmod 600 /root/.sshkey/* - set -x - CLUSTER_INDEX=03 - CLUSTER_SIZE=7 - CLUSTER_FQDNS= - - { get_property: [ dns_cdap00, fqdn ] } - - ',' - - { get_property: [ dns_cdap01, fqdn ] } - - ',' - - { get_property: [ dns_cdap02, fqdn ] } - - ',' - - { get_property: [ dns_cdap03, fqdn ] } - - ',' - - { get_property: [ dns_cdap04, fqdn ] } - - ',' - - { get_property: [ dns_cdap05, fqdn ] } - - ',' - - { get_property: [ dns_cdap06, fqdn ] } - - "\nCLUSTER_FLOATING_IPS=" - - { get_attribute: [ floatingip_cdap00, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap01, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap02, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap03, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap04, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap05, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap06, floating_ip_address ] } - - "\nCLUSTER_LOCAL_IPS=" - - { get_attribute: [ fixedip_cdap00, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap01, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap02, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap03, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap04, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap05, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap06, fixed_ip_address ] } - - "\nCODE_SOURCE=" - - { get_input: codesource_url } - - "\nCODE_VERSION=" - - { get_input: codesource_version } - - "\n" - - "DATACENTER=" - - { get_input: location_id } - - "\n" - - { get_input: vm_init_cdap } - relationships: - - type: cloudify.openstack.server_connected_to_port - target: fixedip_cdap03 - - type: cloudify.openstack.server_connected_to_security_group - target: security_group - - type: cloudify.openstack.server_connected_to_floating_ip - target: floatingip_cdap03 - - type: cloudify.openstack.server_connected_to_keypair - target: key_pair - - type: cloudify.relationships.depends_on - target: hostdeps_cdap - - type: cloudify.relationships.depends_on - target: sharedsshkey_cdap - fixedip_cdap04: - type: cloudify.openstack.nodes.Port - properties: - port: - extra_dhcp_opts: - - opt_name: 'domain-name' - opt_value: { get_input: location_domain } - openstack_config: *open_conf - relationships: - - type: cloudify.relationships.contained_in - target: private_net - floatingip_cdap04: - type: cloudify.openstack.nodes.FloatingIP - properties: - openstack_config: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - floating_network_name: { get_input: public_net } - dns_cdap04: - type: ccsdk.nodes.dns.arecord - properties: - fqdn: { concat: [ { get_input: location_prefix }, 'cdap04.', { get_input: location_domain } ] } - openstack: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - ip_addresses: - - { get_attribute: [ floatingip_cdap04, floating_ip_address ] } - relationships: - - type: cloudify.relationships.depends_on - target: floatingip_cdap04 - host_cdap04: - type: cloudify.openstack.nodes.Server - properties: - install_agent: false - image: { get_input: ubuntu1604image_id } - flavor: { get_input: flavor_id } - management_network_name: { get_input: private_net } - openstack_config: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - name: { concat: [ { get_input: location_prefix }, 'cdap04' ] } - userdata: - concat: - - |- - #!/bin/sh - mkdir /root/.sshkey - echo ' - - { get_attribute: [ sharedsshkey_cdap, public ] } - - |- - ' >/root/.sshkey/id_rsa.pub - echo ' - - { get_attribute: [ sharedsshkey_cdap, base64private ] } - - |- - ' | base64 -d >/root/.sshkey/id_rsa - chmod 700 /root/.sshkey - chmod 600 /root/.sshkey/* - set -x - CLUSTER_INDEX=04 - CLUSTER_SIZE=7 - CLUSTER_FQDNS= - - { get_property: [ dns_cdap00, fqdn ] } - - ',' - - { get_property: [ dns_cdap01, fqdn ] } - - ',' - - { get_property: [ dns_cdap02, fqdn ] } - - ',' - - { get_property: [ dns_cdap03, fqdn ] } - - ',' - - { get_property: [ dns_cdap04, fqdn ] } - - ',' - - { get_property: [ dns_cdap05, fqdn ] } - - ',' - - { get_property: [ dns_cdap06, fqdn ] } - - "\nCLUSTER_FLOATING_IPS=" - - { get_attribute: [ floatingip_cdap00, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap01, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap02, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap03, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap04, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap05, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap06, floating_ip_address ] } - - "\nCLUSTER_LOCAL_IPS=" - - { get_attribute: [ fixedip_cdap00, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap01, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap02, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap03, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap04, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap05, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap06, fixed_ip_address ] } - - "\nCODE_SOURCE=" - - { get_input: codesource_url } - - "\nCODE_VERSION=" - - { get_input: codesource_version } - - "\n" - - "DATACENTER=" - - { get_input: location_id } - - "\n" - - { get_input: vm_init_cdap } - relationships: - - type: cloudify.openstack.server_connected_to_port - target: fixedip_cdap04 - - type: cloudify.openstack.server_connected_to_security_group - target: security_group - - type: cloudify.openstack.server_connected_to_floating_ip - target: floatingip_cdap04 - - type: cloudify.openstack.server_connected_to_keypair - target: key_pair - - type: cloudify.relationships.depends_on - target: hostdeps_cdap - - type: cloudify.relationships.depends_on - target: sharedsshkey_cdap - fixedip_cdap05: - type: cloudify.openstack.nodes.Port - properties: - port: - extra_dhcp_opts: - - opt_name: 'domain-name' - opt_value: { get_input: location_domain } - openstack_config: *open_conf - relationships: - - type: cloudify.relationships.contained_in - target: private_net - floatingip_cdap05: - type: cloudify.openstack.nodes.FloatingIP - properties: - openstack_config: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - floating_network_name: { get_input: public_net } - dns_cdap05: - type: ccsdk.nodes.dns.arecord - properties: - fqdn: { concat: [ { get_input: location_prefix }, 'cdap05.', { get_input: location_domain } ] } - openstack: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - ip_addresses: - - { get_attribute: [ floatingip_cdap05, floating_ip_address ] } - relationships: - - type: cloudify.relationships.depends_on - target: floatingip_cdap05 - host_cdap05: - type: cloudify.openstack.nodes.Server - properties: - install_agent: false - image: { get_input: ubuntu1604image_id } - flavor: { get_input: flavor_id } - management_network_name: { get_input: private_net } - openstack_config: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - name: { concat: [ { get_input: location_prefix }, 'cdap05' ] } - userdata: - concat: - - |- - #!/bin/sh - mkdir /root/.sshkey - echo ' - - { get_attribute: [ sharedsshkey_cdap, public ] } - - |- - ' >/root/.sshkey/id_rsa.pub - echo ' - - { get_attribute: [ sharedsshkey_cdap, base64private ] } - - |- - ' | base64 -d >/root/.sshkey/id_rsa - chmod 700 /root/.sshkey - chmod 600 /root/.sshkey/* - set -x - CLUSTER_INDEX=05 - CLUSTER_SIZE=7 - CLUSTER_FQDNS= - - { get_property: [ dns_cdap00, fqdn ] } - - ',' - - { get_property: [ dns_cdap01, fqdn ] } - - ',' - - { get_property: [ dns_cdap02, fqdn ] } - - ',' - - { get_property: [ dns_cdap03, fqdn ] } - - ',' - - { get_property: [ dns_cdap04, fqdn ] } - - ',' - - { get_property: [ dns_cdap05, fqdn ] } - - ',' - - { get_property: [ dns_cdap06, fqdn ] } - - "\nCLUSTER_FLOATING_IPS=" - - { get_attribute: [ floatingip_cdap00, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap01, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap02, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap03, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap04, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap05, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap06, floating_ip_address ] } - - "\nCLUSTER_LOCAL_IPS=" - - { get_attribute: [ fixedip_cdap00, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap01, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap02, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap03, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap04, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap05, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap06, fixed_ip_address ] } - - "\nCODE_SOURCE=" - - { get_input: codesource_url } - - "\nCODE_VERSION=" - - { get_input: codesource_version } - - "\n" - - "DATACENTER=" - - { get_input: location_id } - - "\n" - - { get_input: vm_init_cdap } - relationships: - - type: cloudify.openstack.server_connected_to_port - target: fixedip_cdap05 - - type: cloudify.openstack.server_connected_to_security_group - target: security_group - - type: cloudify.openstack.server_connected_to_floating_ip - target: floatingip_cdap05 - - type: cloudify.openstack.server_connected_to_keypair - target: key_pair - - type: cloudify.relationships.depends_on - target: hostdeps_cdap - - type: cloudify.relationships.depends_on - target: sharedsshkey_cdap - fixedip_cdap06: - type: cloudify.openstack.nodes.Port - properties: - port: - extra_dhcp_opts: - - opt_name: 'domain-name' - opt_value: { get_input: location_domain } - openstack_config: *open_conf - relationships: - - type: cloudify.relationships.contained_in - target: private_net - floatingip_cdap06: - type: cloudify.openstack.nodes.FloatingIP - properties: - openstack_config: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - floating_network_name: { get_input: public_net } - dns_cdap06: - type: ccsdk.nodes.dns.arecord - properties: - fqdn: { concat: [ { get_input: location_prefix }, 'cdap06.', { get_input: location_domain } ] } - openstack: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - ip_addresses: - - { get_attribute: [ floatingip_cdap06, floating_ip_address ] } - relationships: - - type: cloudify.relationships.depends_on - target: floatingip_cdap06 - host_cdap06: - type: cloudify.openstack.nodes.Server - properties: - install_agent: false - image: { get_input: ubuntu1604image_id } - flavor: { get_input: flavor_id } - management_network_name: { get_input: private_net } - openstack_config: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - name: { concat: [ { get_input: location_prefix }, 'cdap06' ] } - userdata: - concat: - - |- - #!/bin/sh - mkdir /root/.sshkey - echo ' - - { get_attribute: [ sharedsshkey_cdap, public ] } - - |- - ' >/root/.sshkey/id_rsa.pub - echo ' - - { get_attribute: [ sharedsshkey_cdap, base64private ] } - - |- - ' | base64 -d >/root/.sshkey/id_rsa - chmod 700 /root/.sshkey - chmod 600 /root/.sshkey/* - set -x - CLUSTER_INDEX=06 - CLUSTER_SIZE=7 - CLUSTER_FQDNS= - - { get_property: [ dns_cdap00, fqdn ] } - - ',' - - { get_property: [ dns_cdap01, fqdn ] } - - ',' - - { get_property: [ dns_cdap02, fqdn ] } - - ',' - - { get_property: [ dns_cdap03, fqdn ] } - - ',' - - { get_property: [ dns_cdap04, fqdn ] } - - ',' - - { get_property: [ dns_cdap05, fqdn ] } - - ',' - - { get_property: [ dns_cdap06, fqdn ] } - - "\nCLUSTER_FLOATING_IPS=" - - { get_attribute: [ floatingip_cdap00, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap01, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap02, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap03, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap04, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap05, floating_ip_address ] } - - ',' - - { get_attribute: [ floatingip_cdap06, floating_ip_address ] } - - "\nCLUSTER_LOCAL_IPS=" - - { get_attribute: [ fixedip_cdap00, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap01, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap02, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap03, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap04, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap05, fixed_ip_address ] } - - ',' - - { get_attribute: [ fixedip_cdap06, fixed_ip_address ] } - - "\nCODE_SOURCE=" - - { get_input: codesource_url } - - "\nCODE_VERSION=" - - { get_input: codesource_version } - - "\n" - - "DATACENTER=" - - { get_input: location_id } - - "\n" - - { get_input: vm_init_cdap } - relationships: - - type: cloudify.openstack.server_connected_to_port - target: fixedip_cdap06 - - type: cloudify.openstack.server_connected_to_security_group - target: security_group - - type: cloudify.openstack.server_connected_to_floating_ip - target: floatingip_cdap06 - - type: cloudify.openstack.server_connected_to_keypair - target: key_pair - - type: cloudify.relationships.depends_on - target: hostdeps_cdap - - type: cloudify.relationships.depends_on - target: sharedsshkey_cdap diff --git a/blueprints/reference_templates/centos_vm.yaml-template b/blueprints/reference_templates/centos_vm.yaml-template deleted file mode 100644 index aa3bdb4..0000000 --- a/blueprints/reference_templates/centos_vm.yaml-template +++ /dev/null @@ -1,243 +0,0 @@ -# -*- indent-tabs-mode: nil -*- # vi: set expandtab: -# -# ============LICENSE_START========================================== -# org.onap.dcae -# =================================================================== -# Copyright © 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============================================ -# -# ECOMP and OpenECOMP are trademarks -# and service marks of AT&T Intellectual Property. -# - -tosca_definitions_version: cloudify_dsl_1_3 - -imports: - - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml - - http://www.getcloudify.org/spec/openstack-plugin/1.4/plugin.yaml - - http://www.getcloudify.org/spec/fabric-plugin/1.4.1/plugin.yaml - - types/dns_types.yaml - - types/sshkey_types.yaml - -inputs: - centos7image_id: - type: string - ubuntu1604image_id: - type: string - flavor_id: - type: string - security_group: - type: string - public_net: - type: string - private_net: - type: string - openstack: {} - keypair: - type: string - location_prefix: - type: string - location_domain: - type: string - key_filename: - type: string - codesource_url: - type: string - codesource_version: - type: string - cname: - type: string - default: dcae-orcl - datacenter: - type: string - vm_init_clmg_00: - type: string - default: |- - #!/bin/sh - set -x - DATACENTER= - vm_init_clmg_01: - type: string - default: | - CONSULVER=0.8.3 - CONSULNAME=consul_${CONSULVER}_linux_amd64 - MYIP=`curl -Ss http://169.254.169.254/2009-04-04/meta-data/local-ipv4` - MYNAME=`hostname` - if [ ! -z "$(echo $MYNAME |grep '.')" ]; then MYNAME="$(echo $MYNAME | cut -f1 -d '.')"; fi - echo >>/etc/hosts - echo $MYIP $MYNAME >>/etc/hosts - mkdir -p /opt/consul/config /opt/consul/data /opt/consul/bin - yum install -y unzip - # Download Consul - curl -Ss https://releases.hashicorp.com/consul/${CONSULVER}/${CONSULNAME}.zip > ${CONSULNAME}.zip - unzip -d /opt/consul/bin ${CONSULNAME}.zip - rm ${CONSULNAME}.zip - chmod +x /opt/consul/bin/consul - cat < /opt/consul/config/consul.json - { - "bind_addr" : "0.0.0.0", - "client_addr" : "0.0.0.0", - "data_dir" : "/opt/consul/data", - "datacenter": "$DATACENTER", - "rejoin_after_leave": true, - "http_api_response_headers": { - "Access-Control-Allow-Origin" : "*" - }, - "server": false, - "ui": false, - "enable_syslog": true, - "log_level": "info" - } - EOF - cat < /lib/systemd/system/consul.service - [Unit] - Description=Consul - Requires=network-online.target - After=network.target - [Service] - Type=simple - ExecStart=/opt/consul/bin/consul agent -config-dir=/opt/consul/config - ExecReload=/bin/kill -HUP \$MAINPID - [Install] - WantedBy=multi-user.target - EOF - systemctl enable consul - systemctl start consul - yum install -y python-psycopg2 - -node_templates: - key_pair: - type: cloudify.openstack.nodes.KeyPair - properties: - private_key_path: { get_input: key_filename } - use_external_resource: True - resource_id: { get_input: keypair } - openstack_config: &open_conf - get_input: openstack - private_net: - type: cloudify.openstack.nodes.Network - properties: - use_external_resource: True - resource_id: { get_input: private_net } - openstack_config: *open_conf - security_group: - type: cloudify.openstack.nodes.SecurityGroup - properties: - use_external_resource: True - resource_id: { get_input: security_group } - openstack_config: *open_conf - fixedip_vm00: - type: cloudify.openstack.nodes.Port - properties: - port: - extra_dhcp_opts: - - opt_name: 'domain-name' - opt_value: { get_input: location_domain } - openstack_config: *open_conf - relationships: - - type: cloudify.relationships.contained_in - target: private_net - floatingip_vm00: - type: cloudify.openstack.nodes.FloatingIP - properties: - openstack_config: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - floating_network_name: { get_input: public_net } - dns_vm00: - type: ccsdk.nodes.dns.arecord - properties: - fqdn: { concat: [ { get_input: location_prefix }, 'orcl00.', { get_input: location_domain } ] } - openstack: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - ip_addresses: - - { get_attribute: [ floatingip_vm00, floating_ip_address ] } - relationships: - - type: cloudify.relationships.depends_on - target: floatingip_vm00 - dns_cm: - type: ccsdk.nodes.dns.arecord - properties: - fqdn: { concat: [ 'cloudify-manager-', { get_input: datacenter}, '.', { get_input: location_domain } ] } - openstack: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - ip_addresses: - - { get_attribute: [ floatingip_vm00, floating_ip_address ] } - relationships: - - type: cloudify.relationships.depends_on - target: floatingip_vm00 - dns_cname: - type: ccsdk.nodes.dns.cnamerecord - properties: - fqdn: { concat: [ { get_input: cname }, '.', { get_input: location_domain } ] } - openstack: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - cname: { get_property: [ dns_vm00, fqdn ] } - relationships: - - type: cloudify.relationships.depends_on - target: dns_vm00 - host_vm00: - type: cloudify.openstack.nodes.Server - properties: - install_agent: false - image: { get_input: centos7image_id } - flavor: { get_input: flavor_id } - management_network_name: { get_input: private_net } - openstack_config: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - name: { concat: [ { get_input: location_prefix }, 'orcl00' ] } - userdata: - concat: - - { get_input: vm_init_clmg_00 } - - { get_input: datacenter } - - |+ - - - { get_input: vm_init_clmg_01 } - relationships: - - type: cloudify.openstack.server_connected_to_port - target: fixedip_vm00 - - type: cloudify.openstack.server_connected_to_security_group - target: security_group - - type: cloudify.openstack.server_connected_to_floating_ip - target: floatingip_vm00 - - type: cloudify.openstack.server_connected_to_keypair - target: key_pair - - type: cloudify.relationships.depends_on - target: dns_vm00 - - type: cloudify.relationships.depends_on - target: dns_cm - -outputs: - public_ip: - value: { get_attribute: [floatingip_vm00, floating_ip_address] } diff --git a/blueprints/reference_templates/config_binding_service.yaml-template b/blueprints/reference_templates/config_binding_service.yaml-template deleted file mode 100644 index 28dfb43..0000000 --- a/blueprints/reference_templates/config_binding_service.yaml-template +++ /dev/null @@ -1,62 +0,0 @@ -# -*- indent-tabs-mode: nil -*- # vi: set expandtab: -# -# ============LICENSE_START==================================================== -# ============================================================================= -# 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 - -description: > - This blueprint installs the config binding service - -imports: - - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml - - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dockerplugin/2/dockerplugin_types.yaml - - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml -inputs: - location_id: - type: string - default: "" - - docker_host_override: - description: Target docker host to deploy applications to - default: 'platform_dockerhost' - -node_templates: - # Config binding service - service-config-binding: - type: dcae.nodes.DockerContainerForPlatforms - properties: - name: 'config_binding_service' - host_port: 10000 - container_port: 10000 - image: "{{ ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_releases }}/onap/org.onap.dcaegen2.platform.configbinding:2.1.5" - docker_config: - healthcheck: - type: "http" - endpoint: "/healthcheck" - - relationships: - - type: dcae.relationships.component_contained_in - target: docker_host - - docker_host: - type: dcae.nodes.SelectedDockerHost - properties: - location_id: - { get_input: location_id } - docker_host_override: - { get_input: docker_host_override } diff --git a/blueprints/reference_templates/consul_cluster.yaml-template b/blueprints/reference_templates/consul_cluster.yaml-template deleted file mode 100644 index a4ae89e..0000000 --- a/blueprints/reference_templates/consul_cluster.yaml-template +++ /dev/null @@ -1,384 +0,0 @@ -# -*- indent-tabs-mode: nil -*- # vi: set expandtab: -# -# ============LICENSE_START========================================== -# org.onap.dcae -# =================================================================== -# Copyright © 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============================================ -# -# ECOMP and OpenECOMP are trademarks -# and service marks of AT&T Intellectual Property. -# - -tosca_definitions_version: cloudify_dsl_1_3 - -imports: - - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml - - http://www.getcloudify.org/spec/openstack-plugin/1.4/plugin.yaml - - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/dnsdesig/dns_types.yaml" - - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/sshkeyshare/sshkey_types.yaml" - -inputs: - centos7image_id: - type: string - ubuntu1604image_id: - type: string - flavor_id: - type: string - security_group: - type: string - public_net: - type: string - private_net: - type: string - openstack: {} - keypair: - type: string - location_prefix: - type: string - location_domain: - type: string - key_filename: - type: string - codesource_url: - type: string - codesource_version: - type: string - datacenter: - type: string - vm_init_cnsl_00: - type: string - default: |- - #!/bin/sh - set -x - DATACENTER= - vm_init_cnsl_01: - type: string - default: | - CONSULVER=0.8.3 - CONSULNAME=consul_${CONSULVER}_linux_amd64 - MYIP=`wget -qO- http://169.254.169.254/2009-04-04/meta-data/local-ipv4` - MYNAME=`hostname` - echo >>/etc/hosts - echo $MYIP $MYNAME >>/etc/hosts - mkdir -p /opt/consul/config /opt/consul/data /opt/consul/bin - - # Download Consul - apt-get update - apt-get install unzip - wget https://releases.hashicorp.com/consul/${CONSULVER}/${CONSULNAME}.zip - unzip -d /opt/consul/bin ${CONSULNAME}.zip - rm ${CONSULNAME}.zip - chmod +x /opt/consul/bin/consul - - # NOTE: Not using port 80 for http to avoid port collision of user facing services - # particularly for more large scale deployments of Consul. - cat < /opt/consul/config/consul.json - { - "bind_addr" : "$MYIP", - "client_addr" : "0.0.0.0", - "bootstrap_expect" : 3, - "data_dir" : "/opt/consul/data", - "datacenter": "$DATACENTER", - "http_api_response_headers": { - "Access-Control-Allow-Origin" : "*" - }, - "server": true, - "ui": true, - "enable_syslog": true, - "log_level": "info", - "ports": { - "dns": 53 - } - } - EOF - cat < /lib/systemd/system/consul.service - [Unit] - Description=Consul - Requires=network-online.target - After=network.target - [Service] - Type=simple - ExecStart=/opt/consul/bin/consul agent -config-dir=/opt/consul/config - ExecReload=/bin/kill -HUP \$MAINPID - [Install] - WantedBy=multi-user.target - EOF - systemctl enable consul - systemctl start consul -node_templates: - key_pair: - type: cloudify.openstack.nodes.KeyPair - properties: - private_key_path: { get_input: key_filename } - use_external_resource: True - resource_id: { get_input: keypair } - openstack_config: &open_conf - get_input: openstack - private_net: - type: cloudify.openstack.nodes.Network - properties: - use_external_resource: True - resource_id: { get_input: private_net } - openstack_config: *open_conf - security_group: - type: cloudify.openstack.nodes.SecurityGroup - properties: - use_external_resource: True - resource_id: { get_input: security_group } - openstack_config: *open_conf - fixedip_cnsl00: - type: cloudify.openstack.nodes.Port - properties: - port: - extra_dhcp_opts: - - opt_name: 'domain-name' - opt_value: { get_input: location_domain } - openstack_config: *open_conf - relationships: - - type: cloudify.relationships.contained_in - target: private_net - floatingip_cnsl00: - type: cloudify.openstack.nodes.FloatingIP - properties: - openstack_config: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - floating_network_name: { get_input: public_net } - dns_cnsl00: - type: ccsdk.nodes.dns.arecord - properties: - fqdn: { concat: [ { get_input: location_prefix }, 'cnsl00.', { get_input: location_domain } ] } - openstack: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - ip_addresses: - - { get_attribute: [ floatingip_cnsl00, floating_ip_address ] } - relationships: - - type: cloudify.relationships.depends_on - target: floatingip_cnsl00 - host_cnsl00: - type: cloudify.openstack.nodes.Server - properties: - install_agent: false - image: { get_input: ubuntu1604image_id } - flavor: { get_input: flavor_id } - management_network_name: { get_input: private_net } - openstack_config: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - name: { concat: [ { get_input: location_prefix }, 'cnsl00' ] } - userdata: - concat: - - { get_input: vm_init_cnsl_00 } - - { get_input: datacenter } - - |+ - - - { get_input: vm_init_cnsl_01 } - - concat: - - 'until /opt/consul/bin/consul join ' - - { get_attribute: [host_cnsl01, ip] } - - '; do sleep 5; done; ' - - concat: - - 'until /opt/consul/bin/consul join ' - - { get_attribute: [host_cnsl02, ip]} - - '; do sleep 5; done' - - relationships: - - type: cloudify.openstack.server_connected_to_port - target: fixedip_cnsl00 - - type: cloudify.openstack.server_connected_to_security_group - target: security_group - - type: cloudify.openstack.server_connected_to_floating_ip - target: floatingip_cnsl00 - - type: cloudify.openstack.server_connected_to_keypair - target: key_pair - - type: cloudify.relationships.depends_on - target: dns_cnsl00 - - type: cloudify.relationships.depends_on - target: host_cnsl01 - - type: cloudify.relationships.depends_on - target: host_cnsl02 - fixedip_cnsl01: - type: cloudify.openstack.nodes.Port - properties: - port: - extra_dhcp_opts: - - opt_name: 'domain-name' - opt_value: { get_input: location_domain } - openstack_config: *open_conf - relationships: - - type: cloudify.relationships.contained_in - target: private_net - floatingip_cnsl01: - type: cloudify.openstack.nodes.FloatingIP - properties: - openstack_config: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - floating_network_name: { get_input: public_net } - dns_cnsl01: - type: ccsdk.nodes.dns.arecord - properties: - fqdn: { concat: [ { get_input: location_prefix }, 'cnsl01.', { get_input: location_domain } ] } - openstack: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - ip_addresses: - - { get_attribute: [ floatingip_cnsl01, floating_ip_address ] } - relationships: - - type: cloudify.relationships.depends_on - target: floatingip_cnsl01 - host_cnsl01: - type: cloudify.openstack.nodes.Server - properties: - install_agent: false - image: { get_input: ubuntu1604image_id } - flavor: { get_input: flavor_id } - management_network_name: { get_input: private_net } - openstack_config: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - name: { concat: [ { get_input: location_prefix }, 'cnsl01' ] } - userdata: - concat: - - { get_input: vm_init_cnsl_00 } - - { get_input: datacenter } - - |+ - - - { get_input: vm_init_cnsl_01 } - relationships: - - type: cloudify.openstack.server_connected_to_port - target: fixedip_cnsl01 - - type: cloudify.openstack.server_connected_to_security_group - target: security_group - - type: cloudify.openstack.server_connected_to_floating_ip - target: floatingip_cnsl01 - - type: cloudify.openstack.server_connected_to_keypair - target: key_pair - - type: cloudify.relationships.depends_on - target: dns_cnsl01 - fixedip_cnsl02: - type: cloudify.openstack.nodes.Port - properties: - port: - extra_dhcp_opts: - - opt_name: 'domain-name' - opt_value: { get_input: location_domain } - openstack_config: *open_conf - relationships: - - type: cloudify.relationships.contained_in - target: private_net - floatingip_cnsl02: - type: cloudify.openstack.nodes.FloatingIP - properties: - openstack_config: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - floating_network_name: { get_input: public_net } - dns_cnsl02: - type: ccsdk.nodes.dns.arecord - properties: - fqdn: { concat: [ { get_input: location_prefix }, 'cnsl02.', { get_input: location_domain } ] } - openstack: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - ip_addresses: - - { get_attribute: [ floatingip_cnsl02, floating_ip_address ] } - relationships: - - type: cloudify.relationships.depends_on - target: floatingip_cnsl02 - dns_cluster: - type: ccsdk.nodes.dns.arecord - properties: - fqdn: { concat: [ 'dcae-cnsl.', { get_input: location_domain } ] } - openstack: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - ip_addresses: - - { get_attribute: [ floatingip_cnsl00, floating_ip_address ] } - - { get_attribute: [ floatingip_cnsl01, floating_ip_address ] } - - { get_attribute: [ floatingip_cnsl02, floating_ip_address ] } - - relationships: - - type: cloudify.relationships.depends_on - target: floatingip_cnsl00 - - type: cloudify.relationships.depends_on - target: floatingip_cnsl01 - - type: cloudify.relationships.depends_on - target: floatingip_cnsl02 - host_cnsl02: - type: cloudify.openstack.nodes.Server - properties: - install_agent: false - image: { get_input: ubuntu1604image_id } - flavor: { get_input: flavor_id } - management_network_name: { get_input: private_net } - openstack_config: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - name: { concat: [ { get_input: location_prefix }, 'cnsl02' ] } - userdata: - concat: - - { get_input: vm_init_cnsl_00 } - - { get_input: datacenter } - - |+ - - - { get_input: vm_init_cnsl_01 } - relationships: - - type: cloudify.openstack.server_connected_to_port - target: fixedip_cnsl02 - - type: cloudify.openstack.server_connected_to_security_group - target: security_group - - type: cloudify.openstack.server_connected_to_floating_ip - target: floatingip_cnsl02 - - type: cloudify.openstack.server_connected_to_keypair - target: key_pair - - type: cloudify.relationships.depends_on - target: dns_cnsl02 - -outputs: - public_ip: - value: { get_attribute: [floatingip_cnsl00, floating_ip_address] } diff --git a/blueprints/reference_templates/heartbeat-service.yaml-template b/blueprints/reference_templates/heartbeat-service.yaml-template deleted file mode 100644 index 2654c71..0000000 --- a/blueprints/reference_templates/heartbeat-service.yaml-template +++ /dev/null @@ -1,61 +0,0 @@ -tosca_definitions_version: cloudify_dsl_1_3 -imports: -- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dockerplugin/2/dockerplugin_types.yaml" -- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml" -inputs: - dcae_CL_publish_url: - type: string - default: "http://10.0.11.1:3904/events/unauthenticated.DCAE_CL_OUTPUT" - ves_heartbeat_url: - type: string - default: "http://10.0.11.1:3904/events/unauthenticated.SEC_HEARTBEAT_OUTPUT" - docker_host_override: - type: string - default: "component_dockerhost" - dh_location_id: - type: string - default: "zone1" - tag_version: - type: string - default: "nexus3.onap.org:10001/onap/org.onap.dcaegen2.platform.heartbeat:2.0" - -node_templates: - docker_service_host: - type: dcae.nodes.SelectedDockerHost - properties: - docker_host_override: - get_input: docker_host_override - location_id: - get_input: dh_location_id - heartbeatService: - type: dcae.nodes.DockerContainerForComponentsUsingDmaap - properties: - application_config: - heartbeat_config: '{"vnfs":[{"heartbeatcountmissed":3, "heartbeatinterval": 60, "closedLoopControlName":"ControlLoopEvent1"},{"heartbeatcountmissed":3, "heartbeatinterval": 60, "closedLoopControlName":"ControlLoopEvent1"},{"heartbeatcountmissed":3, "heartbeatinterval": 60, "closedLoopControlName":"ControlLoopEvent1"}]}' - streams_publishes: - dcae_cl_out: - dmaap_info: - topic_url: - get_input: dcae_CL_publish_url - type: message_router - streams_subscribes: - heartbeat_input: - dmaap_info: - topic_url: - get_input: ves_heartbeat_url - type: message_router - docker_config: - healthcheck: - script: /app/bin/check_health.py - interval: 18s - timeout: 30s - type: docker - image: - get_input: tag_version - location_id: - get_input: dh_location_id - service_component_type: dcaegen2-services-heartbeat - relationships: - - target: docker_service_host - type: dcae.relationships.component_contained_in - diff --git a/blueprints/reference_templates/holmes-engine.yaml-template b/blueprints/reference_templates/holmes-engine.yaml-template deleted file mode 100644 index 4661299..0000000 --- a/blueprints/reference_templates/holmes-engine.yaml-template +++ /dev/null @@ -1,98 +0,0 @@ -tosca_definitions_version: cloudify_dsl_1_3 -imports: -- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dockerplugin/2/dockerplugin_types.yaml" -- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dcaepolicyplugin/1/dcaepolicyplugin_types.yaml" -- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml" -- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/pgaas/1.1.0/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" - docker_host_override: - type: string - default: "component_dockerhost" - dh_location_id: - type: string - default: "zone1" - msb_hostname: - type: string - default: "" - location_domain: - type: string - location_prefix: - type: string - pgaas_cluster_name: - type: string - # use the single-VM PG instance - default: pgvm - database_name: - type: string - default: holmes -node_templates: - pgaasvm: - type: dcae.nodes.pgaas.database - properties: - writerfqdn: { concat: [ { get_input: location_prefix }, '-', { get_input: pgaas_cluster_name }, '-write.', { get_input: location_domain } ] } - name: { get_input: database_name } - use_existing: true - docker_holmes_host: - type: dcae.nodes.SelectedDockerHost - properties: - docker_host_override: - get_input: docker_host_override - location_id: - get_input: dh_location_id - holmesengine: - type: dcae.nodes.DockerContainerForComponentsUsingDmaap - 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:9102 - image: "{{ ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_releases }}/onap/holmes/engine-management:v1.0.0" - location_id: - get_input: dh_location_id - service_component_type: dcae-analytics-holmes-engine-management - relationships: - - type: cloudify.relationships.depends_on - target: pgaasvm - - target: docker_holmes_host - type: dcae.relationships.component_contained_in - diff --git a/blueprints/reference_templates/holmes-rules.yaml-template b/blueprints/reference_templates/holmes-rules.yaml-template deleted file mode 100644 index dc0ab7d..0000000 --- a/blueprints/reference_templates/holmes-rules.yaml-template +++ /dev/null @@ -1,81 +0,0 @@ -tosca_definitions_version: cloudify_dsl_1_3 -imports: -- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dockerplugin/2/dockerplugin_types.yaml" -- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dcaepolicyplugin/1/dcaepolicyplugin_types.yaml" -- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml" -- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/pgaas/1.1.0/pgaas_types.yaml" -inputs: - docker_host_override: - type: string - default: "component_dockerhost" - dh_location_id: - type: string - default: "zone1" - msb_hostname: - type: string - default: "" - location_domain: - type: string - location_prefix: - type: string - pgaas_cluster_name: - type: string - # use the single-VM PG instance - default: pgvm - database_name: - type: string - default: holmes -node_templates: - pgaasvm: - type: dcae.nodes.pgaas.database - properties: - writerfqdn: { concat: [ { get_input: location_prefix }, '-', { get_input: pgaas_cluster_name }, '-write.', { get_input: location_domain } ] } - name: { get_input: database_name } - docker_holmes_host: - type: dcae.nodes.SelectedDockerHost - properties: - docker_host_override: - get_input: docker_host_override - location_id: - get_input: dh_location_id - holmesrules: - type: dcae.nodes.DockerContainerForComponentsUsingDmaap - 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:9101 - image: "{{ ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_releases }}/onap/holmes/rule-management:v1.0.0" - location_id: - get_input: dh_location_id - service_component_type: dcae-analytics-holmes-rule-management - relationships: - - type: cloudify.relationships.depends_on - target: pgaasvm - - target: docker_holmes_host - type: dcae.relationships.component_contained_in diff --git a/blueprints/reference_templates/inventory.yaml-template b/blueprints/reference_templates/inventory.yaml-template deleted file mode 100644 index c427f8c..0000000 --- a/blueprints/reference_templates/inventory.yaml-template +++ /dev/null @@ -1,196 +0,0 @@ -# -*- 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 - -description: > - This blueprint is used to install and to uninstall DCAE inventory and DCAE service change - handler which are platform services. These applications are Docker containers. This blueprint - depends upon the deployment of a Docker host and the deployment of a central postgres that is - registered with Consul. - -imports: - - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml - - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml - - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dockerplugin/2/dockerplugin_types.yaml - -inputs: - - location_id: - description: Location of where to deploy to - - docker_host_override: - description: Target docker host to deploy applications to - sdc_address: - description: SDC host - sdc_uri: - description: SDC url - sdc_msg_bus_address: - description: Message router hostname that SDC will send distribution events through - sdc_user: - description: SDC username - sdc_password: - description: SDC password - sdc_environment_name: - description: SDC environment name - sdc_use_secure_https: - description: Boolean to toggle whether to do certificate validation for https calls to SDC API - type: boolean - default: false - sdc_use_https_dmaap: - description: Boolean to toggle whether to use https for calls to message router API - type: boolean - default: false - - postgres_user_inventory: - description: Postgres user for inventory - postgres_password_inventory: - description: Postgres password for inventory - - service_change_handler_image: - description: Full uri to service change handler Docker image - inventory_image: - description: Full uri to inventory Docker image - -node_templates: - - service-change-handler: - type: dcae.nodes.DockerContainerForPlatforms - properties: - name: - "service-change-handler" - application_config: - asdcDistributionClient: - asdcAddress: { get_input: sdc_address } - asdcUri: { get_input: sdc_uri } - msgBusAddress: { get_input: sdc_msg_bus_address } - user: { get_input: sdc_user } - password: { get_input: sdc_password } - pollingInterval: 20 - pollingTimeout: 20 - consumerGroup: dcae - consumerId: dcae-sch - environmentName: { get_input: sdc_environment_name } - keyStorePath: - keyStorePassword: - activateServerTLSAuth: { get_input: sdc_use_secure_https } - useHttpsWithDmaap: { get_input: sdc_use_https_dmaap } - isFilterInEmptyResources: false - dcaeInventoryClient: - uri: http://inventory:8080 - docker_config: - healthcheck: - type: "docker" - interval: "30s" - timeout: "3s" - script: "/opt/health.sh" - image: - { get_input: service_change_handler_image } - relationships: - - type: cloudify.relationships.depends_on - target: inventory - - type: dcae.relationships.component_contained_in - target: docker_host - - inventory: - type: dcae.nodes.DockerContainerForPlatforms - properties: - name: - "inventory" - application_config: - database: - driverClass: org.postgresql.Driver - user: { get_input: postgres_user_inventory } - password: { get_input: postgres_password_inventory } - # NOTE: The database name here has been changed to the default "postgres" database - # to use the private postgres instance and not the central postgres database. - url: jdbc:postgresql://pstg-write:5432/postgres - properties: - charSet: UTF-8 - maxWaitForConnection: 1s - validationQuery: "/* MyService Health Check */ SELECT 1" - minSize: 2 - maxSize: 8 - initialSize: 2 - checkConnectionWhileIdle: false - evictionInterval: 10s - minIdleTime: 1 minute - databusControllerConnection: - host: databus-controller-hostname - port: 8443 - mechId: - password: - required: false - httpClient: - minThreads: 1 - maxThreads: 128 - gzipEnabled: false - gzipEnabledForRequests: false - timeout: 5000milliseconds - connectionTimeout: 5000milliseconds - docker_config: - healthcheck: - type: "http" - interval: "30s" - timeout: "3s" - endpoint: "/dcae-service-types" - image: - { get_input: inventory_image } - host_port: - 8080 - container_port: - 8080 - relationships: - - type: dcae.relationships.component_contained_in - target: docker_host - - type: cloudify.relationships.depends_on - target: postgres - - postgres: - type: dcae.nodes.DockerContainer - properties: - name: - "pstg-write" - image: - "postgres:9.5.2" - relationships: - - type: dcae.relationships.component_contained_in - target: docker_host - interfaces: - cloudify.interfaces.lifecycle: - start: - inputs: - envs: - PGDATA: - "/var/lib/postgresql/data/pgdata" - POSTGRES_PASSWORD: - { get_input: postgres_password_inventory } - SERVICE_NAME: - "pstg-write" - ports: - - "5432:5432" - - docker_host: - type: dcae.nodes.SelectedDockerHost - properties: - location_id: - { get_input: location_id } - docker_host_override: - { get_input: docker_host_override } diff --git a/blueprints/reference_templates/k8s-dashboard.yaml-template b/blueprints/reference_templates/k8s-dashboard.yaml-template deleted file mode 100644 index 1d0fa10..0000000 --- a/blueprints/reference_templates/k8s-dashboard.yaml-template +++ /dev/null @@ -1,119 +0,0 @@ -# ============LICENSE_START==================================================== -# org.onap.dcae -# ============================================================================= -# Copyright (c) 2019 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.4.13/k8splugin_types.yaml" -- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/pgaas/1.1.0/pgaas_types.yaml" - -inputs: - database_cluster_name: - type: string - default: 'dcae-pg-primary.onap' - database_cluster_fqdn: - type: string - default: 'dcae-pg-primary.onap.svc.cluster.local' - database_name: - type: string - default: 'dashboard_pg' - postgres_port: - description: 'Postgres port for dashboard' - default: '5432' - dashboard_docker_image: - description: 'Docker image for dashboard' - default: 'nexus3.onap.org:10001/onap/org.onap.ccsdk.dashboard.ccsdk-app-os:1.1.0-SNAPSHOT-latest' - cloudify_ip: - type: string - default: 'dcae-cloudify-manager' - cloudify_user: - type: string - default: 'admin' - cloudify_password: - type: string - default: 'admin' - consul_url: - type: string - default: 'consul-server-ui' - external_port: - type: string - description: Kubernetes node port for standard http - default: "30418" - external_tls_port: - type: string - description: Kubernetes node port for standard https - default: "30419" - replicas: - type: integer - description: number of instances - default: 1 -node_templates: - pgaasdb: - type: dcae.nodes.pgaas.database - properties: - writerfqdn: { get_input: database_cluster_name } - name: { get_input: database_name } - dashboard_deployment: - type: dcae.nodes.ContainerizedPlatformComponent - interfaces: - cloudify.interfaces.lifecycle: - start: - inputs: - envs: - postgres_ip: - { get_input: database_cluster_fqdn } - postgres_db_name: - { get_input: database_name } - postgres_password_dashboard: - { get_attribute: [ pgaasdb, admin, password ] } - postgres_user_dashboard: - { get_attribute: [ pgaasdb, admin, user ] } - postgres_port: { get_input: postgres_port } - cloudify_user: { get_input: cloudify_user } - cloudify_password: { get_input: cloudify_password } - #consul_url: http://consul-server.onap.svc.cluster.local - consul_url: - concat: ["http://", { get_input: consul_url },":8500"] - #cfy_url: http://dcae-cloudify-manager:8080 - cfy_url: - concat: ["http://", { get_input: cloudify_ip },"/api/v3.1"] - inventory_url: http://inventory:8080 - dhandler_url: https://deployment-handler:8443 - ports: - - concat: ["8080:", { get_input: external_port }] - - concat: ["8443:", { get_input: external_tls_port }] - properties: - name: - "dcae-dashboard" - image: - { get_input: dashboard_docker_image } - replicas: {get_input: replicas} - dns_name: 'dcae-dashboard' - tls_info: - cert_directory: '/usr/local/share/ca-certificates/' - use_tls: true - docker_config: - healthcheck: - endpoint: /ccsdk-app/health - interval: 15s - timeout: 1s - type: http - relationships: - - type: cloudify.relationships.depends_on - target: pgaasdb - diff --git a/blueprints/reference_templates/k8s-datafile-collector.yaml-template b/blueprints/reference_templates/k8s-datafile-collector.yaml-template deleted file mode 100644 index 2de0a24..0000000 --- a/blueprints/reference_templates/k8s-datafile-collector.yaml-template +++ /dev/null @@ -1,124 +0,0 @@ -# -*- indent-tabs-mode: nil -*- # vi: set expandtab: -# -# ============LICENSE_START==================================================== -# ============================================================================= -# Copyright (c) 2018-2019 AT&T Intellectual Property, 2019 Nordix Foundation. 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" - - "https://nexus.onap.org/service/local/repositories/raw/content/org.onap.dcaegen2.platform.plugins/R4/k8splugin/1.4.13/k8splugin_types.yaml" - - "https://nexus.onap.org/service/local/repositories/raw/content/org.onap.ccsdk.platform.plugins/type_files/dmaap/dmaap.yaml" - -inputs: - dmaap_mr_host: - type: string - description: dmaap messagerouter host - default: message-router.onap.svc.cluster.local - dmaap_mr_port: - type: integer - description: dmaap messagerouter port - default: 3904 - dmaap_mr_protocol: - type: string - description: dmaap messagerouter protocol - default: "http" - tag_version: - type: string - description: DFC image tag/version - default: "nexus3.onap.org:10001/onap/org.onap.dcaegen2.collectors.datafile.datafile-app-server:1.2.0" - replicas: - type: integer - description: number of instances - default: 1 - secureEnableCert: - type: boolean - description: enable certificate base connection with PNF and DMaap - default: false - feedName: - type: string - description: feed name for dmaap producerconfiguration - default: "bulk_pm_feed" - feedDescription: - type: string - default: "Feed for Bulk PM files" - -node_templates: - bulk_pm_feed: - type: ccsdk.nodes.Feed - properties: - feed_name: { get_input: feedName } - feed_description: { get_input: feedDescription } - - datafile-collector: - type: dcae.nodes.ContainerizedServiceComponentUsingDmaap - - relationships: - - type: ccsdk.relationships.publish_files - target: bulk_pm_feed - - interfaces: - cloudify.interfaces.lifecycle: - start: - inputs: - ports: - - concat: ["8100:0"] - - concat: ["8433:0"] - - properties: - service_component_type: 'dcae-datafile' - application_config: - dmaap.ftpesConfig.keyCert: "/opt/app/datafile/config/dfc.jks" - dmaap.ftpesConfig.keyPassword: "secret" - dmaap.ftpesConfig.trustedCa: "/opt/app/datafile/config/ftp.jks" - dmaap.ftpesConfig.trustedCaPassword: "secret" - dmaap.security.trustStorePath: "/opt/app/datafile/etc/cert/trust.jks" - dmaap.security.trustStorePasswordPath: "/opt/app/datafile/etc/cert/trust.pass" - dmaap.security.keyStorePath: "/opt/app/datafile/etc/cert/key.p12" - dmaap.security.keyStorePasswordPath: "/opt/app/datafile/etc/cert/key.pass" - dmaap.security.enableDmaapCertAuth: { get_input: secureEnableCert } - streams_publishes: - PM_MEAS_FILES: - dmaap_info: <> - type: data_router - streams_subscribes: - dmaap_subscriber: - type: - "message_router" - dmaap_info: - topic_url: - { concat: [{ get_input: dmaap_mr_protocol },"://",{ get_input: dmaap_mr_host }, - ":",{ get_input: dmaap_mr_port },"/events/unauthenticated.VES_NOTIFICATION_OUTPUT/OpenDcae-c12/C12"]} - streams_publishes: - - name: bulk_pm_feed - type: data_router - location: "loc00" - docker_config: - healthcheck: - endpoint: /heartbeat - interval: 15s - timeout: 1s - type: http - image: - get_input: tag_version - replicas: {get_input: replicas} - log_info: - log_directory: "/var/log/ONAP" - tls_info: - cert_directory: '/opt/app/datafile/etc/cert/' - use_tls: true - diff --git a/blueprints/reference_templates/k8s-pgaas-database.yaml-template b/blueprints/reference_templates/k8s-pgaas-database.yaml-template deleted file mode 100644 index 309c962..0000000 --- a/blueprints/reference_templates/k8s-pgaas-database.yaml-template +++ /dev/null @@ -1,57 +0,0 @@ -# -*- 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 - -description: |- - This blueprint is used to install and to uninstall a persistent database into the central postgres as a platform service. - This blueprint depends upon the deployment of the pgaas_plugin and the PGaaS service. - This blueprint is part of a suite of three blueprints: - k8s-pgaas-initdb takes control of the postgres server instance. - k8s-pgaas-database creates a database, roles and credentials associated with the database. - k8s-pgaas-getdbinfo shows how an application can access a database (including its roles and credentials) that was already created with k8s-pgaas-database. - -imports: - - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml - - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/pgaas/1.1.0/pgaas_types.yaml" - -inputs: - blueprint_version: - type: string - default: '2018-03-29T14:28:59+0000' - - # pgaas-specific info - k8s_pgaas_instance_fqdn: - type: string - - database_description: - type: string - default: 'This is a sample database' - - database_name: - type: string - default: sample - -node_templates: - pgaasdbtest: - type: dcae.nodes.pgaas.database - properties: - writerfqdn: { get_input: k8s_pgaas_instance_fqdn } - name: { get_input: database_name } diff --git a/blueprints/reference_templates/k8s-pgaas-getdbinfo.yaml-template b/blueprints/reference_templates/k8s-pgaas-getdbinfo.yaml-template deleted file mode 100644 index 6869f2c..0000000 --- a/blueprints/reference_templates/k8s-pgaas-getdbinfo.yaml-template +++ /dev/null @@ -1,99 +0,0 @@ -# -*- 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 - -description: |- - This blueprint is an example of how an application can access the needed information about - a persistent database created as part of a PGaaS cluster. - - For a given database "dbname" on a given PGaaS cluster "PGCLUSTERNAME", - there are three roles created: - admin role: has complete administrative control over that database - user role: has complete read and write access on that database - viewer role: only has read access on that database - The various attributes will return the appropriate information - that can be used with that role: host fqdn, role name and password. - - This blueprint is part of a suite of three blueprints: - k8s-pgaas-initdb takes control of the postgres server instance. - k8s-pgaas-database creates a database, roles and credentials associated with the database. - k8s-pgaas-getdbinfo shows how an application can access a database (including its roles and credentials) that was already created with k8s-pgaas-database. - -imports: - - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml - - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/pgaas/1.1.0/pgaas_types.yaml" - -inputs: - k8s_pgaas_instance_fqdn: - type: string - database_name: - type: string - -node_templates: - pgclustername_dbname: - type: dcae.nodes.pgaas.database - properties: - writerfqdn: { get_input: k8s_pgaas_instance_fqdn } - name: { get_input: database_name } - use_existing: true - -outputs: - # admin role has control over table/index/view creation/dropping - pgclustername_dbname_admin_host: - description: Hostname for PGCLUSTERNAME dbname database - value: { get_attribute: [ pgclustername_dbname, admin, host ] } - pgclustername_dbname_admin_port: - description: Portname for PGCLUSTERNAME dbname database - value: { get_attribute: [ pgclustername_dbname, admin, port ] } - pgclustername_dbname_admin_user: - description: Admin Username for PGCLUSTERNAME dbname database - value: { get_attribute: [ pgclustername_dbname, admin, user ] } - pgclustername_dbname_admin_password: - description: Admin Password for PGCLUSTERNAME dbname database - value: { get_attribute: [ pgclustername_dbname, admin, password ] } - - # user role can read and write the tables - pgclustername_dbname_user_host: - description: Hostname for PGCLUSTERNAME dbname database - value: { get_attribute: [ pgclustername_dbname, user, host ] } - pgclustername_dbname_user_port: - description: Portname for PGCLUSTERNAME dbname database - value: { get_attribute: [ pgclustername_dbname, user, port ] } - pgclustername_dbname_user_user: - description: User Username for PGCLUSTERNAME dbname database - value: { get_attribute: [ pgclustername_dbname, user, user ] } - pgclustername_dbname_user_password: - description: User Password for PGCLUSTERNAME dbname database - value: { get_attribute: [ pgclustername_dbname, user, password ] } - - # viewer role can only read from the tables - pgclustername_dbname_viewer_host: - description: Hostname for PGCLUSTERNAME dbname database - value: { get_attribute: [ pgclustername_dbname, viewer, host ] } - pgclustername_dbname_viewer_port: - description: Portname for PGCLUSTERNAME dbname database - value: { get_attribute: [ pgclustername_dbname, viewer, port ] } - pgclustername_dbname_viewer_user: - description: Viewer Username for PGCLUSTERNAME dbname database - value: { get_attribute: [ pgclustername_dbname, viewer, user ] } - pgclustername_dbname_viewer_password: - description: Viewer Password for PGCLUSTERNAME dbname database - value: { get_attribute: [ pgclustername_dbname, viewer, password ] } diff --git a/blueprints/reference_templates/pgaas-cluster.yaml-template b/blueprints/reference_templates/pgaas-cluster.yaml-template deleted file mode 100644 index d7b0cd0..0000000 --- a/blueprints/reference_templates/pgaas-cluster.yaml-template +++ /dev/null @@ -1,435 +0,0 @@ -# -*- 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 - -description: |- - This blueprint is used to install and to uninstall a central postgres as a platform service. - This blueprint depends upon the deployment of the pgaas_plugin, the PGaaS Cinder volume, and Consul. - This blueprint is part of a suite of three blueprints that allow a PGaaS - cluster to be created that has persistent databases stored in Cinder. - pgaas-disk allocates the cinder volumes. It must be run first. - pgaas-cluster creates the PG service and attaches the cinder volumes. It must be run second. - pgaas-database creates a database. It must be run third, for each persistent database. - If the cluster is uninstalled, the persistent databases are unaffected. - If a database blueprint is uninstalled, the persistent database goes away. - If the disk blueprint is uninstalled, all persistent databases go away, along with the server instance. - -imports: - - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml - - http://www.getcloudify.org/spec/openstack-plugin/1.4/plugin.yaml - - http://www.getcloudify.org/spec/fabric-plugin/1.4.1/plugin.yaml - - - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/dnsdesig/dns_types.yaml" - - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml" - - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/pgaas/1.1.0/pgaas_types.yaml" - -inputs: - blueprint_version: - type: string - default: '2018-04-27T00:31:38+0000' - - # pgaas-specific info - pgaas_cluster_name: - type: string - default: pgcl - -{{ ONAPTEMPLATE_STANDARD_INPUTS_TYPES }} - - vm_init_pgrs: - type: string - default: | - #!/bin/sh - echo All output will be found in /tmp/ins.out and /tmp/ins.err - exec > /tmp/ins.out 2> /tmp/ins.err - set -x - if [ "$(dnsdomainname 2>/dev/null)" = "" ] - then - echo WARNING WARNING WARNING - echo The DNS DHCP settings did not work properly. - for i in $(seq 20) - do - echo Sleeping... - sleep 10 - if [ "$(dnsdomainname 2>/dev/null)" != "" ] - then break - fi - echo The DNS DHCP settings still did not work properly. - done - if [ "$(dnsdomainname 2>/dev/null)" = "" ] - then - echo Exiting - exit 1 - fi - fi - - CONFDIR=/var/config/DCAE/chef/ - mkdir -p $CONFDIR - - CONF=$CONFDIR/pgaas-postgres.conf - cat < $CONF - master: ${MASTER%%.*} - secondmaster: notused - DRTR_NODE_KSTOREFILE: /opt/app/dcae-certificate/keystore.jks - DRTR_NODE_KSTOREPASS: "No Certificate" - DRTR_NODE_PVTKEYPASS: "No Certificate" - PG_NODES: $PG_NODES - PG_JAVA_HOME : /opt/app/java/jdk/jdk170 - PG_CLUSTER: central - EOF - - apt-get update - - # invoking apt-get separately allows a failure to be ignored - for i in openjdk-7-jdk openjdk-8-jdk python-pip python3-pip curl gawk; do apt-get install -y $i;done - pip install pyyaml - - # prevent servers from starting - echo "exit 101" > /usr/sbin/policy-rc.d; chmod a+x /usr/sbin/policy-rc.d - - # invoking apt-get separately allows a failure to be ignored - for i in postgresql libpq5 repmgr python-psycopg2 python3-psycopg2 libgetopt-java; do apt-get install -y $i; done - - # allow servers to autostart again - rm -f /usr/sbin/policy-rc.d - - ( umask 077; sed 's/^/*:*:*:postgres:/' < /root/.pgrspw > ~postgres/.pgpass; chown postgres:postgres ~postgres/.pgpass ) - - if [ ! -f $CONF ] - then echo "$CONF does not exist" 1>&2; exit 1 - fi - - echo Look in /tmp/pgaas.out for output from installing PGaaS - NEXUS={{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_storage_pgaas_debs_releases }}/debs - for pkg in cdf.deb-1.0.0 pgaas.deb-1.0.0 - do - OUT=/tmp/$pkg - curl -s -k -f -o $OUT $NEXUS/$pkg - dpkg --install $OUT - done - - case $(hostname) in - *00 ) WRITE=-write ;; - *01 ) WRITE= ;; - esac - curl -v -X PUT -H "Content-Type: application/json" "http://${LOCATION_PREFIX}cnsl00.${LOCATION_DOMAIN}:8500/v1/agent/service/register" -d "{\"name\" : \"${CLUSTER_NAME}${WRITE}\", \"Address\" : \"${LOCAL_IP}\", \"Port\" : 5432}" - - echo ALL DONE - -node_templates: - key_pair: - type: cloudify.openstack.nodes.KeyPair - properties: - private_key_path: { get_input: key_filename } - use_external_resource: True - resource_id: { get_input: keypair } - openstack_config: &open_conf - get_input: openstack - private_net: - type: cloudify.openstack.nodes.Network - properties: - use_external_resource: True - resource_id: { get_input: private_net } - openstack_config: *open_conf - security_group: - type: cloudify.openstack.nodes.SecurityGroup - properties: - use_external_resource: True - resource_id: { get_input: security_group } - openstack_config: *open_conf - - fixedip_pgrs00: - type: cloudify.openstack.nodes.Port - properties: - port: - extra_dhcp_opts: - - opt_name: 'domain-name' - opt_value: { get_input: location_domain } - openstack_config: *open_conf - relationships: - - type: cloudify.relationships.contained_in - target: private_net - floatingip_pgrs00: - type: cloudify.openstack.nodes.FloatingIP - properties: - openstack_config: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - floating_network_name: { get_input: public_net } - dns_pgrs00: - type: ccsdk.nodes.dns.arecord - properties: - fqdn: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '00.', { get_input: location_domain } ] } - openstack: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - ip_addresses: - - { get_attribute: [ floatingip_pgrs00, floating_ip_address ] } - relationships: - - type: cloudify.relationships.depends_on - target: floatingip_pgrs00 - host_pgrs00: - type: cloudify.openstack.nodes.Server - properties: - install_agent: false - image: { get_input: ubuntu1604image_id } - flavor: { get_input: flavor_id } - management_network_name: { get_input: private_net } - openstack_config: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - name: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '00' ] } - userdata: - concat: - - |- - #!/bin/sh - mkdir /root/.sshkey - echo ' - - { get_attribute: [ pgaas_cluster, public ] } - - |- - ' >/root/.sshkey/id_rsa.pub - echo ' - - { get_attribute: [ pgaas_cluster, base64private ] } - - |- - ' | base64 -d >/root/.sshkey/id_rsa - chmod 700 /root/.sshkey - chmod 600 /root/.sshkey/* - ( umask 077; echo -n postgres | cat - /root/.sshkey/id_rsa | md5sum | awk '{ print $1 }' > /root/.pgrspw ) - set -x - - "\n" - - "CLUSTER_NAME='" - - { get_input: pgaas_cluster_name } - - "'\n" - - "LOCATION_PREFIX='" - - { get_input: location_prefix } - - "'\n" - - "LOCATION_DOMAIN='" - - { get_input: location_domain } - - "'\n" - - "MASTER='" - - { get_property: [ dns_pgrs00, fqdn ] } - - "'\n" - - "LOCAL_IP='" - - { get_attribute: [ floatingip_pgrs00, floating_ip_address ] } - - "'\n" - - "PG_NODES='" - - { get_property: [ dns_pgrs00, fqdn ] } - - '|' - - { get_property: [ dns_pgrs01, fqdn ] } - - "'\n" - - { get_input: vm_init_pgrs } - relationships: - - type: cloudify.openstack.server_connected_to_port - target: fixedip_pgrs00 - - type: cloudify.openstack.server_connected_to_security_group - target: security_group - - type: cloudify.openstack.server_connected_to_floating_ip - target: floatingip_pgrs00 - - type: cloudify.openstack.server_connected_to_keypair - target: key_pair - - type: cloudify.relationships.depends_on - target: dns_pgrs00 - - type: cloudify.relationships.depends_on - target: pgaas_cluster - fixedip_pgrs01: - type: cloudify.openstack.nodes.Port - properties: - port: - extra_dhcp_opts: - - opt_name: 'domain-name' - opt_value: { get_input: location_domain } - openstack_config: *open_conf - relationships: - - type: cloudify.relationships.contained_in - target: private_net - floatingip_pgrs01: - type: cloudify.openstack.nodes.FloatingIP - properties: - openstack_config: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - floating_network_name: { get_input: public_net } - dns_pgrs01: - type: ccsdk.nodes.dns.arecord - properties: - fqdn: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '01.', { get_input: location_domain } ] } - openstack: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - ip_addresses: - - { get_attribute: [ floatingip_pgrs01, floating_ip_address ] } - relationships: - - type: cloudify.relationships.depends_on - target: floatingip_pgrs01 - host_pgrs01: - type: cloudify.openstack.nodes.Server - properties: - install_agent: false - image: { get_input: ubuntu1604image_id } - flavor: { get_input: flavor_id } - management_network_name: { get_input: private_net } - openstack_config: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - name: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '01' ] } - userdata: - concat: - - |- - #!/bin/sh - mkdir /root/.sshkey - echo ' - - { get_attribute: [ pgaas_cluster, public ] } - - |- - ' >/root/.sshkey/id_rsa.pub - echo ' - - { get_attribute: [ pgaas_cluster, base64private ] } - - |- - ' | base64 -d >/root/.sshkey/id_rsa - chmod 700 /root/.sshkey - chmod 600 /root/.sshkey/* - ( umask 077; echo -n postgres | cat - /root/.sshkey/id_rsa | md5sum | awk '{ print $1 }' > /root/.pgrspw ) - set -x - - "\n" - - "CLUSTER_NAME='" - - { get_input: pgaas_cluster_name } - - "'\n" - - "LOCATION_PREFIX='" - - { get_input: location_prefix } - - "'\n" - - "LOCATION_DOMAIN='" - - { get_input: location_domain } - - "'\n" - - "MASTER='" - - { get_property: [ dns_pgrs00, fqdn ] } - - "'\n" - - "LOCAL_IP='" - - { get_attribute: [ floatingip_pgrs01, floating_ip_address ] } - - "'\n" - - "PG_NODES='" - - { get_property: [ dns_pgrs00, fqdn ] } - - '|' - - { get_property: [ dns_pgrs01, fqdn ] } - - "'\n" - - { get_input: vm_init_pgrs } - relationships: - - type: cloudify.openstack.server_connected_to_port - target: fixedip_pgrs01 - - type: cloudify.openstack.server_connected_to_security_group - target: security_group - - type: cloudify.openstack.server_connected_to_floating_ip - target: floatingip_pgrs01 - - type: cloudify.openstack.server_connected_to_keypair - target: key_pair - - type: cloudify.relationships.depends_on - target: dns_pgrs01 - - type: cloudify.relationships.depends_on - target: pgaas_cluster - - # cinder connections - volume_pgrs00: - type: cloudify.openstack.nodes.Volume - properties: - resource_id: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '00' ] } - openstack_config: *open_conf - use_external_resource: True - relationships: - - type: cloudify.openstack.volume_attached_to_server - target: host_pgrs00 - - volume_pgrs01: - type: cloudify.openstack.nodes.Volume - properties: - resource_id: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '01' ] } - openstack_config: *open_conf - use_external_resource: True - relationships: - - type: cloudify.openstack.volume_attached_to_server - target: host_pgrs01 - - # CNAME records - dns_pgrs_rw: - type: ccsdk.nodes.dns.cnamerecord - properties: - fqdn: { concat: [ { get_input: location_prefix }, '-', { get_input: pgaas_cluster_name }, '-write.', { get_input: location_domain } ] } - openstack: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - cname: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '00.', { get_input: location_domain } ] } - - dns_pgrs_ro: - type: ccsdk.nodes.dns.cnamerecord - properties: - fqdn: { concat: [ { get_input: location_prefix }, '-', { get_input: pgaas_cluster_name }, '.', { get_input: location_domain } ] } - openstack: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - cname: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '00.', { get_input: location_domain } ] } - - # tie to pgaas_plugin database - pgaas_cluster: - type: dcae.nodes.pgaas.cluster - properties: - writerfqdn: { get_property: [ dns_pgrs_rw, fqdn ] } - use_existing: true - relationships: - - type: cloudify.relationships.depends_on - target: dns_pgrs_rw - - type: cloudify.relationships.depends_on - target: dns_pgrs_ro - -outputs: - public_ip00: - value: { get_attribute: [host_pgrs00, ip] } - public_ip01: - value: { get_attribute: [host_pgrs01, ip] } - writerfqdn: - value: { get_property: [ dns_pgrs_rw, fqdn ] } - readerfqdn: - value: { get_property: [ dns_pgrs_ro, fqdn ] } - dns_pgrs00: - value: { get_property: [ dns_pgrs00, fqdn ] } - dns_pgrs01: - value: { get_property: [ dns_pgrs01, fqdn ] } - blueprint_version: - value: { get_input: blueprint_version } diff --git a/blueprints/reference_templates/pgaas-database.yaml-template b/blueprints/reference_templates/pgaas-database.yaml-template deleted file mode 100644 index a89d638..0000000 --- a/blueprints/reference_templates/pgaas-database.yaml-template +++ /dev/null @@ -1,63 +0,0 @@ -# -*- 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 - -description: |- - This blueprint is used to install and to uninstall a persistent database into the central postgres as a platform service. - This blueprint depends upon the deployment of the pgaas_plugin, the PGaaS Cinder volume, the PGaaS service, and Consul. - This blueprint is part of a suite of three blueprints that allow a PGaaS - cluster to be created that has persistent databases stored in Cinder. - pgaas-disk allocates the cinder volumes. It must be run first. - pgaas-cluster creates the PG service and attaches the cinder volumes. It must be run second. - pgaas-database creates a database. It must be run third, for each persistent database. - If the cluster is uninstalled, the persistent databases are unaffected. - If a database blueprint is uninstalled, the persistent database goes away. - If the disk blueprint is uninstalled, all persistent databases go away, along with the server instance. - -imports: - - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml - - - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/pgaas/1.1.0/pgaas_types.yaml" - -inputs: - blueprint_version: - type: string - default: '2018-03-29T14:28:59+0000' - - # pgaas-specific info - pgaas_cluster_name: - type: string - default: pgcl - database_description: - type: string - default: 'This is a sample database' - database_name: - type: string - default: sample - -{{ ONAPTEMPLATE_STANDARD_INPUTS_TYPES }} - -node_templates: - pgaasdbtest: - type: dcae.nodes.pgaas.database - properties: - writerfqdn: { concat: [ { get_input: location_prefix }, '-', { get_input: pgaas_cluster_name }, '-write.', { get_input: location_domain } ] } - name: { get_input: database_name } diff --git a/blueprints/reference_templates/pgaas-disk.yaml-template b/blueprints/reference_templates/pgaas-disk.yaml-template deleted file mode 100644 index 3f96bae..0000000 --- a/blueprints/reference_templates/pgaas-disk.yaml-template +++ /dev/null @@ -1,123 +0,0 @@ -# -*- 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 - -description: |- - This blueprint is used to install and to uninstall the cinder volumes for - a central postgres as a platform service. - This blueprint depends upon the deployment of Consul and the pgaas_plugin. - This blueprint is part of a suite of three blueprints that allow a PGaaS - cluster to be created that has persistent databases stored in Cinder. - pgaas-disk allocates the cinder volumes. It must be run first. - pgaas-cluster creates the PG service and attaches the cinder volumes. It must be run second. - pgaas-database creates a database. It must be run third, for each persistent database. - If the cluster is uninstalled, the persistent databases are unaffected. - If a database blueprint is uninstalled, the persistent database goes away. - If the disk blueprint is uninstalled, all persistent databases go away, along with the server instance. - -imports: - - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml - - http://www.getcloudify.org/spec/openstack-plugin/1.4/plugin.yaml - - http://www.getcloudify.org/spec/fabric-plugin/1.4.1/plugin.yaml - - - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/dnsdesig/dns_types.yaml" - - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/sshkeyshare/sshkey_types.yaml" - - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml" - - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/pgaas/1.1.0/pgaas_types.yaml" - -inputs: - blueprint_version: - type: string - default: '2018-04-27T00:31:38+0000' - - # pgaas-specific info - pgaas_cluster_name: - type: string - default: pgcl - cinder_volume_size: - type: string - default: 300 - -{{ ONAPTEMPLATE_STANDARD_INPUTS_TYPES }} - -node_templates: - key_pair: - type: cloudify.openstack.nodes.KeyPair - properties: - private_key_path: { get_input: key_filename } - use_external_resource: True - resource_id: { get_input: keypair } - openstack_config: &open_conf - get_input: openstack - - sharedsshkey_pgrs: - type: ccsdk.nodes.ssh.keypair - - private_net: - type: cloudify.openstack.nodes.Network - properties: - use_external_resource: True - resource_id: { get_input: private_net } - openstack_config: *open_conf - - security_group: - type: cloudify.openstack.nodes.SecurityGroup - properties: - use_external_resource: True - resource_id: { get_input: security_group } - openstack_config: *open_conf - - volume_pgrs00: - type: cloudify.openstack.nodes.Volume - properties: - resource_id: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '00' ] } - openstack_config: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - size: { get_input: cinder_volume_size } - - volume_pgrs01: - type: cloudify.openstack.nodes.Volume - properties: - resource_id: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '01' ] } - openstack_config: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - size: { get_input: cinder_volume_size } - - pgaas_cluster: - type: dcae.nodes.pgaas.cluster - properties: - writerfqdn: { concat: [ { get_input: location_prefix }, '-', { get_input: pgaas_cluster_name }, '-write.', { get_input: location_domain } ] } - readerfqdn: { concat: [ { get_input: location_prefix }, '-', { get_input: pgaas_cluster_name }, '.', { get_input: location_domain } ] } - relationships: - - type: dcae.relationships.pgaas_cluster_uses_sshkeypair - target: sharedsshkey_pgrs - -outputs: - blueprint_version: - value: { get_input: blueprint_version } diff --git a/blueprints/reference_templates/pgaas-getdbinfo.yaml-template b/blueprints/reference_templates/pgaas-getdbinfo.yaml-template deleted file mode 100644 index 8672f04..0000000 --- a/blueprints/reference_templates/pgaas-getdbinfo.yaml-template +++ /dev/null @@ -1,92 +0,0 @@ -# -*- 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 - -description: |- - This blueprint is an example of how an application can access the needed information about - a persistent database created as part of a PGaaS cluster. - - For a given database "dbname" on a given PGaaS cluster "PGCLUSTERNAME", - there are three roles created: - admin role: has complete administrative control over that database - user role: has complete read and write access on that database - viewer role: only has read access on that database - The various attributes will return the appropriate information - that can be used with that role: host fqdn, role name and password. - -imports: - - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml - - - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/pgaas/1.1.0/pgaas_types.yaml" - -inputs: - location_domain: - type: string - location_prefix: - type: string - pgaas_cluster_name: - type: string - default: pgcl - database_name: - type: string - default: sample - -node_templates: - pgclustername_dbname: - type: dcae.nodes.pgaas.database - properties: - writerfqdn: { concat: [ { get_input: location_prefix }, '-', { get_input: pgaas_cluster_name }, '-write.', { get_input: location_domain } ] } - name: { get_input: database_name } - use_existing: true - -outputs: - # admin role has control over table/index/view creation/dropping - pgclustername_dbname_admin_host: - description: Hostname for PGCLUSTERNAME dbname database - value: { get_attribute: [ pgclustername_dbname, admin, host ] } - pgclustername_dbname_admin_user: - description: Admin Username for PGCLUSTERNAME dbname database - value: { get_attribute: [ pgclustername_dbname, admin, user ] } - pgclustername_dbname_admin_password: - description: Admin Password for PGCLUSTERNAME dbname database - value: { get_attribute: [ pgclustername_dbname, admin, password ] } - - # user role can read and write the tables - pgclustername_dbname_user_host: - description: Hostname for PGCLUSTERNAME dbname database - value: { get_attribute: [ pgclustername_dbname, user, host ] } - pgclustername_dbname_user_user: - description: User Username for PGCLUSTERNAME dbname database - value: { get_attribute: [ pgclustername_dbname, user, user ] } - pgclustername_dbname_user_password: - description: User Password for PGCLUSTERNAME dbname database - value: { get_attribute: [ pgclustername_dbname, user, password ] } - - # viewer role can only read from the tables - pgclustername_dbname_viewer_host: - description: Hostname for PGCLUSTERNAME dbname database - value: { get_attribute: [ pgclustername_dbname, viewer, host ] } - pgclustername_dbname_viewer_user: - description: Viewer Username for PGCLUSTERNAME dbname database - value: { get_attribute: [ pgclustername_dbname, viewer, user ] } - pgclustername_dbname_viewer_password: - description: Viewer Password for PGCLUSTERNAME dbname database - value: { get_attribute: [ pgclustername_dbname, viewer, password ] } diff --git a/blueprints/reference_templates/pgaas-onevm.yaml-template b/blueprints/reference_templates/pgaas-onevm.yaml-template deleted file mode 100644 index be2d044..0000000 --- a/blueprints/reference_templates/pgaas-onevm.yaml-template +++ /dev/null @@ -1,300 +0,0 @@ -# -*- 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 - -description: |- - This blueprint is used to install and to uninstall a single-VM central postgres as a platform service. - This blueprint depends upon the deployment of the pgaas_plugin and Consul. - -imports: - - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml - - http://www.getcloudify.org/spec/openstack-plugin/1.4/plugin.yaml - - http://www.getcloudify.org/spec/fabric-plugin/1.4.1/plugin.yaml - - - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/dnsdesig/dns_types.yaml" - - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/sshkeyshare/sshkey_types.yaml" - - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml" - - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/pgaas/1.1.0/pgaas_types.yaml" - -inputs: - blueprint_version: - type: string - default: '2018-04-27T00:31:38+0000' - - # pgaas-specific info - pgaas_cluster_name: - type: string - default: pgvm - -{{ ONAPTEMPLATE_STANDARD_INPUTS_TYPES }} - - vm_init_pgrs: - type: string - default: | - #!/bin/sh - echo All output will be found in /tmp/ins.out and /tmp/ins.err - exec > /tmp/ins.out 2> /tmp/ins.err - set -x - if [ "$(dnsdomainname 2>/dev/null)" = "" ] - then - echo WARNING WARNING WARNING - echo The DNS DHCP settings did not work properly. - for i in $(seq 20) - do - echo Sleeping... - sleep 10 - if [ "$(dnsdomainname 2>/dev/null)" != "" ] - then break - fi - echo The DNS DHCP settings still did not work properly. - done - if [ "$(dnsdomainname 2>/dev/null)" = "" ] - then - echo Exiting - exit 1 - fi - fi - - CONFDIR=/var/config/DCAE/chef/ - mkdir -p $CONFDIR - - CONF=$CONFDIR/pgaas-postgres.conf - cat < $CONF - master: ${MASTER%%.*} - secondmaster: notused - DRTR_NODE_KSTOREFILE: /opt/app/dcae-certificate/keystore.jks - DRTR_NODE_KSTOREPASS: "No Certificate" - DRTR_NODE_PVTKEYPASS: "No Certificate" - PG_NODES: $PG_NODES - PG_JAVA_HOME : /opt/app/java/jdk/jdk170 - PG_CLUSTER: central - EOF - - apt-get update - - # invoking apt-get separately allows a failure to be ignored - for i in openjdk-7-jdk openjdk-8-jdk python-pip python3-pip curl gawk; do apt-get install -y $i;done - pip install pyyaml - - # prevent servers from starting - echo "exit 101" > /usr/sbin/policy-rc.d; chmod a+x /usr/sbin/policy-rc.d - - # invoking apt-get separately allows a failure to be ignored - for i in postgresql libpq5 repmgr python-psycopg2 python3-psycopg2 libgetopt-java; do apt-get install -y $i; done - - # allow servers to autostart again - rm -f /usr/sbin/policy-rc.d - - ( umask 077; sed 's/^/*:*:*:postgres:/' < /root/.pgrspw > ~postgres/.pgpass; chown postgres:postgres ~postgres/.pgpass ) - - if [ ! -f $CONF ] - then echo "$CONF does not exist" 1>&2; exit 1 - fi - - echo Look in /tmp/pgaas.out for output from installing PGaaS - NEXUS={{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_storage_pgaas_debs_releases }}/debs - for pkg in cdf.deb-1.0.0 pgaas.deb-1.0.0 - do - OUT=/tmp/$pkg - curl -s -k -f -o $OUT $NEXUS/$pkg - dpkg --install $OUT - done - - curl -v -X PUT -H "Content-Type: application/json" "http://${LOCATION_PREFIX}cnsl00.${LOCATION_DOMAIN}:8500/v1/agent/service/register" -d "{\"name\" : \"${CLUSTER_NAME}-write\", \"Address\" : \"${LOCAL_IP}\", \"Port\" : 5432}\"" - curl -v -X PUT -H "Content-Type: application/json" "http://${LOCATION_PREFIX}cnsl00.${LOCATION_DOMAIN}:8500/v1/agent/service/register" -d "{\"name\" : \"${CLUSTER_NAME}\", \"Address\" : \"${LOCAL_IP}\", \"Port\" : 5432}" - - echo ALL DONE - -node_templates: - key_pair: - type: cloudify.openstack.nodes.KeyPair - properties: - private_key_path: { get_input: key_filename } - use_external_resource: True - resource_id: { get_input: keypair } - openstack_config: &open_conf - get_input: openstack - private_net: - type: cloudify.openstack.nodes.Network - properties: - use_external_resource: True - resource_id: { get_input: private_net } - openstack_config: *open_conf - security_group: - type: cloudify.openstack.nodes.SecurityGroup - properties: - use_external_resource: True - resource_id: { get_input: security_group } - openstack_config: *open_conf - - sharedsshkey_pgrs: - type: ccsdk.nodes.ssh.keypair - - fixedip_pgrs00: - type: cloudify.openstack.nodes.Port - properties: - port: - extra_dhcp_opts: - - opt_name: 'domain-name' - opt_value: { get_input: location_domain } - openstack_config: *open_conf - relationships: - - type: cloudify.relationships.contained_in - target: private_net - floatingip_pgrs00: - type: cloudify.openstack.nodes.FloatingIP - properties: - openstack_config: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - floating_network_name: { get_input: public_net } - dns_pgrs00: - type: ccsdk.nodes.dns.arecord - properties: - fqdn: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '00.', { get_input: location_domain } ] } - openstack: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - ip_addresses: - - { get_attribute: [ floatingip_pgrs00, floating_ip_address ] } - relationships: - - type: cloudify.relationships.depends_on - target: floatingip_pgrs00 - host_pgrs00: - type: cloudify.openstack.nodes.Server - properties: - install_agent: false - image: { get_input: ubuntu1604image_id } - flavor: { get_input: flavor_id } - management_network_name: { get_input: private_net } - openstack_config: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - name: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '00' ] } - userdata: - concat: - - |- - #!/bin/sh - mkdir /root/.sshkey - echo ' - - { get_attribute: [ sharedsshkey_pgrs, public ] } - - |- - ' >/root/.sshkey/id_rsa.pub - echo ' - - { get_attribute: [ sharedsshkey_pgrs, base64private ] } - - |- - ' | base64 -d >/root/.sshkey/id_rsa - chmod 700 /root/.sshkey - chmod 600 /root/.sshkey/* - ( umask 077; echo -n postgres | cat - /root/.sshkey/id_rsa | md5sum | awk '{ print $1 }' > /root/.pgrspw ) - set -x - - "\n" - - "CLUSTER_NAME='" - - { get_input: pgaas_cluster_name } - - "'\n" - - "LOCATION_PREFIX='" - - { get_input: location_prefix } - - "'\n" - - "LOCATION_DOMAIN='" - - { get_input: location_domain } - - "'\n" - - "MASTER='" - - { get_property: [ dns_pgrs00, fqdn ] } - - "'\n" - - "LOCAL_IP='" - - { get_attribute: [ floatingip_pgrs00, floating_ip_address ] } - - "'\n" - - "PG_NODES='" - - { get_property: [ dns_pgrs00, fqdn ] } - - "'\n" - - { get_input: vm_init_pgrs } - relationships: - - type: cloudify.openstack.server_connected_to_port - target: fixedip_pgrs00 - - type: cloudify.openstack.server_connected_to_security_group - target: security_group - - type: cloudify.openstack.server_connected_to_floating_ip - target: floatingip_pgrs00 - - type: cloudify.openstack.server_connected_to_keypair - target: key_pair - - type: cloudify.relationships.depends_on - target: dns_pgrs00 - - type: cloudify.relationships.depends_on - target: sharedsshkey_pgrs - # CNAME records - dns_pgrs_rw: - type: ccsdk.nodes.dns.cnamerecord - properties: - fqdn: { concat: [ { get_input: location_prefix }, '-', { get_input: pgaas_cluster_name }, '-write.', { get_input: location_domain } ] } - openstack: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - cname: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '00.', { get_input: location_domain } ] } - - dns_pgrs_ro: - type: ccsdk.nodes.dns.cnamerecord - properties: - fqdn: { concat: [ { get_input: location_prefix }, '-', { get_input: pgaas_cluster_name }, '.', { get_input: location_domain } ] } - openstack: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - cname: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '00.', { get_input: location_domain } ] } - - # tie to pgaas_plugin database - pgaas_cluster: - type: dcae.nodes.pgaas.cluster - properties: - writerfqdn: { get_property: [ dns_pgrs_rw, fqdn ] } - readerfqdn: { get_property: [ dns_pgrs_ro, fqdn ] } - relationships: - - type: dcae.relationships.pgaas_cluster_uses_sshkeypair - target: sharedsshkey_pgrs - - type: cloudify.relationships.depends_on - target: dns_pgrs_rw - - type: cloudify.relationships.depends_on - target: dns_pgrs_ro - -outputs: - public_ip00: - value: { get_attribute: [host_pgrs00, ip] } - writerfqdn: - value: { get_property: [ dns_pgrs_rw, fqdn ] } - readerfqdn: - value: { get_property: [ dns_pgrs_ro, fqdn ] } - dns_pgrs00: - value: { get_property: [ dns_pgrs00, fqdn ] } - blueprint_version: - value: { get_input: blueprint_version } diff --git a/blueprints/reference_templates/pgaas.yaml-template b/blueprints/reference_templates/pgaas.yaml-template deleted file mode 100644 index 4a7e16a..0000000 --- a/blueprints/reference_templates/pgaas.yaml-template +++ /dev/null @@ -1,412 +0,0 @@ -# -*- 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 - -description: |- - This blueprint is used to install and to uninstall a two-VM central postgres as a platform service. - This blueprint depends upon the deployment of the pgaas_plugin and Consul. - -imports: - - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml - - http://www.getcloudify.org/spec/openstack-plugin/1.4/plugin.yaml - - http://www.getcloudify.org/spec/fabric-plugin/1.4.1/plugin.yaml - - - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/dnsdesig/dns_types.yaml" - - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/sshkeyshare/sshkey_types.yaml" - - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml" - - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/pgaas/1.1.0/pgaas_types.yaml" - -inputs: - blueprint_version: - type: string - default: '2018-04-27T00:31:38+0000' - - # pgaas-specific info - pgaas_cluster_name: - type: string - default: pstg - -{{ ONAPTEMPLATE_STANDARD_INPUTS_TYPES }} - - vm_init_pgrs: - type: string - default: | - #!/bin/sh - echo All output will be found in /tmp/ins.out and /tmp/ins.err - exec > /tmp/ins.out 2> /tmp/ins.err - set -x - if [ "$(dnsdomainname 2>/dev/null)" = "" ] - then - echo WARNING WARNING WARNING - echo The DNS DHCP settings did not work properly. - for i in $(seq 20) - do - echo Sleeping... - sleep 10 - if [ "$(dnsdomainname 2>/dev/null)" != "" ] - then break - fi - echo The DNS DHCP settings still did not work properly. - done - if [ "$(dnsdomainname 2>/dev/null)" = "" ] - then - echo Exiting - exit 1 - fi - fi - - CONFDIR=/var/config/DCAE/chef/ - mkdir -p $CONFDIR - - CONF=$CONFDIR/pgaas-postgres.conf - cat < $CONF - master: ${MASTER%%.*} - secondmaster: notused - DRTR_NODE_KSTOREFILE: /opt/app/dcae-certificate/keystore.jks - DRTR_NODE_KSTOREPASS: "No Certificate" - DRTR_NODE_PVTKEYPASS: "No Certificate" - PG_NODES: $PG_NODES - PG_JAVA_HOME : /opt/app/java/jdk/jdk170 - PG_CLUSTER: central - EOF - - apt-get update - - # invoking apt-get separately allows a failure to be ignored - for i in openjdk-7-jdk openjdk-8-jdk python-pip python3-pip curl gawk; do apt-get install -y $i;done - pip install pyyaml - - # prevent servers from starting - echo "exit 101" > /usr/sbin/policy-rc.d; chmod a+x /usr/sbin/policy-rc.d - - # invoking apt-get separately allows a failure to be ignored - for i in postgresql libpq5 repmgr python-psycopg2 python3-psycopg2 libgetopt-java; do apt-get install -y $i; done - - # allow servers to autostart again - rm -f /usr/sbin/policy-rc.d - - ( umask 077; sed 's/^/*:*:*:postgres:/' < /root/.pgrspw > ~postgres/.pgpass; chown postgres:postgres ~postgres/.pgpass ) - - if [ ! -f $CONF ] - then echo "$CONF does not exist" 1>&2; exit 1 - fi - - echo Look in /tmp/pgaas.out for output from installing PGaaS - NEXUS={{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_storage_pgaas_debs_releases }}/debs - for pkg in cdf.deb-1.0.0 pgaas.deb-1.0.0 - do - OUT=/tmp/$pkg - curl -s -k -f -o $OUT $NEXUS/$pkg - dpkg --install $OUT - done - - case $(hostname) in - *00 ) WRITE=-write ;; - *01 ) WRITE= ;; - esac - curl -v -X PUT -H "Content-Type: application/json" "http://${LOCATION_PREFIX}cnsl00.${LOCATION_DOMAIN}:8500/v1/agent/service/register" -d "{\"name\" : \"${CLUSTER_NAME}${WRITE}\", \"Address\" : \"${LOCAL_IP}\", \"Port\" : 5432}" - - echo ALL DONE - -node_templates: - key_pair: - type: cloudify.openstack.nodes.KeyPair - properties: - private_key_path: { get_input: key_filename } - use_external_resource: True - resource_id: { get_input: keypair } - openstack_config: &open_conf - get_input: openstack - private_net: - type: cloudify.openstack.nodes.Network - properties: - use_external_resource: True - resource_id: { get_input: private_net } - openstack_config: *open_conf - security_group: - type: cloudify.openstack.nodes.SecurityGroup - properties: - use_external_resource: True - resource_id: { get_input: security_group } - openstack_config: *open_conf - - sharedsshkey_pgrs: - type: ccsdk.nodes.ssh.keypair - - fixedip_pgrs00: - type: cloudify.openstack.nodes.Port - properties: - port: - extra_dhcp_opts: - - opt_name: 'domain-name' - opt_value: { get_input: location_domain } - openstack_config: *open_conf - relationships: - - type: cloudify.relationships.contained_in - target: private_net - floatingip_pgrs00: - type: cloudify.openstack.nodes.FloatingIP - properties: - openstack_config: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - floating_network_name: { get_input: public_net } - dns_pgrs00: - type: ccsdk.nodes.dns.arecord - properties: - fqdn: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '00.', { get_input: location_domain } ] } - openstack: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - ip_addresses: - - { get_attribute: [ floatingip_pgrs00, floating_ip_address ] } - relationships: - - type: cloudify.relationships.depends_on - target: floatingip_pgrs00 - host_pgrs00: - type: cloudify.openstack.nodes.Server - properties: - install_agent: false - image: { get_input: ubuntu1604image_id } - flavor: { get_input: flavor_id } - management_network_name: { get_input: private_net } - openstack_config: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - name: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '00' ] } - userdata: - concat: - - |- - #!/bin/sh - mkdir /root/.sshkey - echo ' - - { get_attribute: [ sharedsshkey_pgrs, public ] } - - |- - ' >/root/.sshkey/id_rsa.pub - echo ' - - { get_attribute: [ sharedsshkey_pgrs, base64private ] } - - |- - ' | base64 -d >/root/.sshkey/id_rsa - chmod 700 /root/.sshkey - chmod 600 /root/.sshkey/* - ( umask 077; echo -n postgres | cat - /root/.sshkey/id_rsa | md5sum | awk '{ print $1 }' > /root/.pgrspw ) - set -x - - "\n" - - "CLUSTER_NAME='" - - { get_input: pgaas_cluster_name } - - "'\n" - - "LOCATION_PREFIX='" - - { get_input: location_prefix } - - "'\n" - - "LOCATION_DOMAIN='" - - { get_input: location_domain } - - "'\n" - - "MASTER='" - - { get_property: [ dns_pgrs00, fqdn ] } - - "'\n" - - "LOCAL_IP='" - - { get_attribute: [ floatingip_pgrs00, floating_ip_address ] } - - "'\n" - - "PG_NODES='" - - { get_property: [ dns_pgrs00, fqdn ] } - - '|' - - { get_property: [ dns_pgrs01, fqdn ] } - - "'\n" - - { get_input: vm_init_pgrs } - relationships: - - type: cloudify.openstack.server_connected_to_port - target: fixedip_pgrs00 - - type: cloudify.openstack.server_connected_to_security_group - target: security_group - - type: cloudify.openstack.server_connected_to_floating_ip - target: floatingip_pgrs00 - - type: cloudify.openstack.server_connected_to_keypair - target: key_pair - - type: cloudify.relationships.depends_on - target: dns_pgrs00 - - type: cloudify.relationships.depends_on - target: sharedsshkey_pgrs - fixedip_pgrs01: - type: cloudify.openstack.nodes.Port - properties: - port: - extra_dhcp_opts: - - opt_name: 'domain-name' - opt_value: { get_input: location_domain } - openstack_config: *open_conf - relationships: - - type: cloudify.relationships.contained_in - target: private_net - floatingip_pgrs01: - type: cloudify.openstack.nodes.FloatingIP - properties: - openstack_config: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - floating_network_name: { get_input: public_net } - dns_pgrs01: - type: ccsdk.nodes.dns.arecord - properties: - fqdn: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '01.', { get_input: location_domain } ] } - openstack: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - ip_addresses: - - { get_attribute: [ floatingip_pgrs01, floating_ip_address ] } - relationships: - - type: cloudify.relationships.depends_on - target: floatingip_pgrs01 - host_pgrs01: - type: cloudify.openstack.nodes.Server - properties: - install_agent: false - image: { get_input: ubuntu1604image_id } - flavor: { get_input: flavor_id } - management_network_name: { get_input: private_net } - openstack_config: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - name: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '01' ] } - userdata: - concat: - - |- - #!/bin/sh - mkdir /root/.sshkey - echo ' - - { get_attribute: [ sharedsshkey_pgrs, public ] } - - |- - ' >/root/.sshkey/id_rsa.pub - echo ' - - { get_attribute: [ sharedsshkey_pgrs, base64private ] } - - |- - ' | base64 -d >/root/.sshkey/id_rsa - chmod 700 /root/.sshkey - chmod 600 /root/.sshkey/* - ( umask 077; echo -n postgres | cat - /root/.sshkey/id_rsa | md5sum | awk '{ print $1 }' > /root/.pgrspw ) - set -x - - "\n" - - "CLUSTER_NAME='" - - { get_input: pgaas_cluster_name } - - "'\n" - - "LOCATION_PREFIX='" - - { get_input: location_prefix } - - "'\n" - - "LOCATION_DOMAIN='" - - { get_input: location_domain } - - "'\n" - - "MASTER='" - - { get_property: [ dns_pgrs00, fqdn ] } - - "'\n" - - "LOCAL_IP='" - - { get_attribute: [ floatingip_pgrs01, floating_ip_address ] } - - "'\n" - - "PG_NODES='" - - { get_property: [ dns_pgrs00, fqdn ] } - - '|' - - { get_property: [ dns_pgrs01, fqdn ] } - - "'\n" - - { get_input: vm_init_pgrs } - relationships: - - type: cloudify.openstack.server_connected_to_port - target: fixedip_pgrs01 - - type: cloudify.openstack.server_connected_to_security_group - target: security_group - - type: cloudify.openstack.server_connected_to_floating_ip - target: floatingip_pgrs01 - - type: cloudify.openstack.server_connected_to_keypair - target: key_pair - - type: cloudify.relationships.depends_on - target: dns_pgrs01 - - type: cloudify.relationships.depends_on - target: sharedsshkey_pgrs - - # CNAME records - dns_pgrs_rw: - type: ccsdk.nodes.dns.cnamerecord - properties: - fqdn: { concat: [ { get_input: location_prefix }, '-', { get_input: pgaas_cluster_name }, '-write.', { get_input: location_domain } ] } - openstack: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - cname: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '00.', { get_input: location_domain } ] } - - dns_pgrs_ro: - type: ccsdk.nodes.dns.cnamerecord - properties: - fqdn: { concat: [ { get_input: location_prefix }, '-', { get_input: pgaas_cluster_name }, '.', { get_input: location_domain } ] } - openstack: *open_conf - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - cname: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '00.', { get_input: location_domain } ] } - - # tie to pgaas_plugin database - pgaas_cluster: - type: dcae.nodes.pgaas.cluster - properties: - writerfqdn: { get_property: [ dns_pgrs_rw, fqdn ] } - readerfqdn: { get_property: [ dns_pgrs_ro, fqdn ] } - relationships: - - type: dcae.relationships.pgaas_cluster_uses_sshkeypair - target: sharedsshkey_pgrs - - type: cloudify.relationships.depends_on - target: dns_pgrs_rw - - type: cloudify.relationships.depends_on - target: dns_pgrs_ro - -outputs: - public_ip00: - value: { get_attribute: [host_pgrs00, ip] } - public_ip01: - value: { get_attribute: [host_pgrs01, ip] } - writerfqdn: - value: { get_property: [ dns_pgrs_rw, fqdn ] } - readerfqdn: - value: { get_property: [ dns_pgrs_ro, fqdn ] } - dns_pgrs00: - value: { get_property: [ dns_pgrs00, fqdn ] } - dns_pgrs01: - value: { get_property: [ dns_pgrs01, fqdn ] } - blueprint_version: - value: { get_input: blueprint_version } diff --git a/blueprints/reference_templates/policy_handler.yaml-template b/blueprints/reference_templates/policy_handler.yaml-template deleted file mode 100644 index 29e66e6..0000000 --- a/blueprints/reference_templates/policy_handler.yaml-template +++ /dev/null @@ -1,70 +0,0 @@ -# -*- indent-tabs-mode: nil -*- # vi: set expandtab: -# -# ============LICENSE_START======================================================= -# 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========================================================= -# -# ECOMP is a trademark and service mark of AT&T Intellectual Property. - -tosca_definitions_version: cloudify_dsl_1_3 - -description: > - This blueprint deploys/manages the DCAE policy-handler as a Docker container - -imports: - - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml - - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dockerplugin/3/dockerplugin_types.yaml - - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml - -inputs: - - location_id: - description: Deployment location - - docker_host_override: - description: Target docker host - default: 'platform_dockerhost' - - policy_handler_image: - description: Docker image for policy_handler - default: '{{ ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_releases }}/onap/org.onap.dcaegen2.platform.policy-handler:5.0.0' - - application_config: - description: policy handler application configuration - requires info on policy-engine - default: {} - -node_templates: - policy_handler: - type: dcae.nodes.DockerContainerForPlatforms - properties: - name: 'policy_handler' - image: { get_input: policy_handler_image } - application_config: { get_input: application_config } - docker_config: - healthcheck: - type: 'http' - interval: '300s' - timeout: '25s' - endpoint: '/healthcheck' - relationships: - - type: dcae.relationships.component_contained_in - target: docker_host - - # Docker host - docker_host: - type: dcae.nodes.SelectedDockerHost - properties: - location_id: { get_input: location_id } - docker_host_override: { get_input: docker_host_override } diff --git a/blueprints/reference_templates/prh-service.yaml-template b/blueprints/reference_templates/prh-service.yaml-template deleted file mode 100644 index 77d681b..0000000 --- a/blueprints/reference_templates/prh-service.yaml-template +++ /dev/null @@ -1,61 +0,0 @@ -tosca_definitions_version: cloudify_dsl_1_3 -imports: -- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dockerplugin/2/dockerplugin_types.yaml" -- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml" -inputs: - prh_publish_url: - type: string - default: "http://10.0.11.1:3904/events/unauthenticated.SO_OUTPUT" - prh_subscribe_url: - type: string - default: "http://10.0.11.1:3904/events/unauthenticated.SEC_OTHER_OUTPUT" - docker_host_override: - type: string - default: "component_dockerhost" - dh_location_id: - type: string - default: "zone1" - tag_version: - type: string - default: "nexus3.onap.org:10001/onap/org.onap.dcaegen2.services.prh:1.2.2" - - -node_templates: - docker_service_host: - type: dcae.nodes.SelectedDockerHost - properties: - docker_host_override: - get_input: docker_host_override - location_id: - get_input: dh_location_id - heartbeatService: - type: dcae.nodes.DockerContainerForComponentsUsingDmaap - properties: - application_config: - streams_publishes: - dcae_cl_out: - dmaap_info: - topic_url: - get_input: prh_publish_url - type: message_router - streams_subscribes: - heartbeat_fault: - dmaap_info: - topic_url: - get_input: prh_subcribe_url - type: message_router - docker_config: - healthcheck: - script: /app/bin/check_health.py - interval: 18s - timeout: 30s - type: docker - image: - get_input: tag_version - location_id: - get_input: dh_location_id - service_component_type: dcaegen2-services-prh - relationships: - - target: docker_service_host - type: dcae.relationships.component_contained_in - diff --git a/blueprints/reference_templates/snmptrap-collector.yaml-template b/blueprints/reference_templates/snmptrap-collector.yaml-template deleted file mode 100644 index 694fde5..0000000 --- a/blueprints/reference_templates/snmptrap-collector.yaml-template +++ /dev/null @@ -1,95 +0,0 @@ -tosca_definitions_version: cloudify_dsl_1_3 -imports: -- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dockerplugin/2/dockerplugin_types.yaml" -- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml" -inputs: - snmp_publish_url: - type: string - default: "http://10.0.11.1:3904/events/unauthenticated.ONAP-COLLECTOR-SNMPTRAP" - docker_host_override: - type: string - default: "component_dockerhost" - dh_location_id: - type: string - default: "zone1" - tag_version: - type: string - default: "nexus3.onap.org:10001/onap/org.onap.dcaegen2.collectors.snmptrap:1.3" - -node_templates: - docker_service_host: - type: dcae.nodes.SelectedDockerHost - properties: - docker_host_override: - get_input: docker_host_override - location_id: - get_input: dh_location_id - heartbeatService: - type: dcae.nodes.DockerContainerForComponentsUsingDmaap - properties: - application_config: - streams_publishes: - dcae_cl_out: - dmaap_info: - topic_url: - get_input: snmp_publish_url - type: message_router - snmptrap.version: "1.3.0" - snmptrap.title: "ONAP SNMP Trap Receiver" - protocols.transport: "udp" - protocols.ipv4_interface: "0.0.0.0" - protocols.ipv4_port: 162 - protocols.ipv6_interface: "::1" - protocols.ipv6_port: 162 - cache.dns_cache_ttl_seconds: 60 - publisher.http_timeout_milliseconds: 1500 - publisher.http_retries: 3 - publisher.http_milliseconds_between_retries: 750 - publisher.http_primary_publisher: "true" - publisher.http_peer_publisher: "unavailable" - publisher.max_traps_between_publishes: 10 - publisher.max_milliseconds_between_publishes: 10000 - files.runtime_base_dir: "/opt/app/snmptrap" - files.log_dir: "logs" - files.data_dir: "data" - files.pid_dir: "tmp" - files.arriving_traps_log: "snmptrapd_arriving_traps.log" - files.snmptrapd_diag: "snmptrapd_prog_diag.log" - files.traps_stats_log: "snmptrapd_stats.csv" - files.perm_status_file: "snmptrapd_status.log" - files.eelf_base_dir: "/opt/app/snmptrap/logs" - files.eelf_error: "error.log" - files.eelf_debug: "debug.log" - files.eelf_audit: "audit.log" - files.eelf_metrics: "metrics.log" - files.roll_frequency: "hour" - files.minimum_severity_to_log: 2 - trap_def.1.trap_oid" : ".1.3.6.1.4.1.74.2.46.12.1.1" - trap_def.1.trap_category: "DCAE-SNMP-TRAPS" - trap_def.2.trap_oid" : "*" - trap_def.2.trap_category: "DCAE-SNMP-TRAPS" - stormwatch.1.stormwatch_oid" : ".1.3.6.1.4.1.74.2.46.12.1.1" - stormwatch.1.low_water_rearm_per_minute" : "5" - stormwatch.1.high_water_arm_per_minute" : "100" - stormwatch.2.stormwatch_oid" : ".1.3.6.1.4.1.74.2.46.12.1.2" - stormwatch.2.low_water_rearm_per_minute" : "2" - stormwatch.2.high_water_arm_per_minute" : "200" - stormwatch.3.stormwatch_oid" : ".1.3.6.1.4.1.74.2.46.12.1.2" - stormwatch.3.low_water_rearm_per_minute" : "2" - stormwatch.3.high_water_arm_per_minute" : "200" - docker_config: - healthcheck: - script: /app/bin/check_health.py - interval: 18s - timeout: 30s - type: docker - image: - get_input: tag_version - - location_id: - get_input: dh_location_id - service_component_type: dcaegen2-collectors-snmptrap - relationships: - - target: docker_service_host - type: dcae.relationships.component_contained_in - diff --git a/blueprints/reference_templates/tca.yaml-template b/blueprints/reference_templates/tca.yaml-template deleted file mode 100644 index 9699456..0000000 --- a/blueprints/reference_templates/tca.yaml-template +++ /dev/null @@ -1,92 +0,0 @@ -tosca_definitions_version: cloudify_dsl_1_3 -imports: - - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dockerplugin/2/dockerplugin_types.yaml - - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/cdapcloudify/14/cdapcloudify_types.yaml - - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dcaepolicyplugin/1/dcaepolicyplugin_types.yaml - - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml - -inputs: - connected_broker_dns_name: - type: string - default: cdap_broker - aaiEnrichmentHost: - type: string - enableAAIEnrichment: - type: string - default: false - subscriberHostName: - type: string - publisherHostName: - type: string -node_templates: - tca_tca: - type: dcae.nodes.MicroService.cdap - properties: - app_config: - appDescription: DCAE Analytics Threshold Crossing Alert Application - appName: dcae-tca - tcaAlertsAbatementTableName: TCAAlertsAbatementTable - tcaAlertsAbatementTableTTLSeconds: '1728000' - tcaSubscriberOutputStreamName: TCASubscriberOutputStream - tcaVESAlertsTableName: TCAVESAlertsTable - tcaVESAlertsTableTTLSeconds: '1728000' - tcaVESMessageStatusTableName: TCAVESMessageStatusTable - tcaVESMessageStatusTableTTLSeconds: '86400' - thresholdCalculatorFlowletInstances: '2' - app_preferences: - aaiEnrichmentHost: - get_input: aaiEnrichmentHost - aaiEnrichmentIgnoreSSLCertificateErrors: 'true' - aaiEnrichmentPortNumber: '8443' - aaiEnrichmentProtocol: https - aaiEnrichmentUserName: DCAE - aaiEnrichmentUserPassword: DCAE - aaiVMEnrichmentAPIPath: /aai/v11/search/nodes-query - aaiVNFEnrichmentAPIPath: /aai/v11/network/generic-vnfs/generic-vnf - enableAAIEnrichment: - get_input: enableAAIEnrichment - enableAlertCEFFormat: 'false' - publisherContentType: application/json - publisherHostName: - get_input: publisherHostName - publisherHostPort: '3904' - publisherMaxBatchSize: '1' - publisherMaxRecoveryQueueSize: '100000' - publisherPollingInterval: '20000' - publisherProtocol: http - publisherTopicName: unauthenticated.DCAE_CL_OUTPUT - subscriberConsumerGroup: OpenDCAE-c12 - subscriberConsumerId: c12 - subscriberContentType: application/json - subscriberHostName: - get_input: subscriberHostName - subscriberHostPort: '3904' - subscriberMessageLimit: '-1' - subscriberPollingInterval: '30000' - subscriberProtocol: http - subscriberTimeoutMS: '-1' - subscriberTopicName: unauthenticated.VES_MEASUREMENT_OUTPUT - 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.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"}]}]}' - artifact_name: dcae-analytics-cdap-tca - artifact_version: 2.0.0 - connections: - streams_publishes: [] - streams_subscribes: [] - jar_url: https://nexus.onap.org/service/local/repositories/releases/content/org/onap/dcaegen2/analytics/tca/dcae-analytics-cdap-tca/2.0.0/dcae-analytics-cdap-tca-2.0.0.jar - namespace: cdap_tca_hi_lo - programs: - - program_id: TCAVESCollectorFlow - program_type: flows - - program_id: TCADMaaPMRSubscriberWorker - program_type: workers - - program_id: TCADMaaPMRPublisherWorker - program_type: workers - service_component_type: cdap_app_tca - streamname: TCASubscriberOutputStream - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - connected_broker_dns_name: - get_input: connected_broker_dns_name - diff --git a/blueprints/reference_templates/tcadocker-service.yaml-template b/blueprints/reference_templates/tcadocker-service.yaml-template deleted file mode 100644 index 92deaa4..0000000 --- a/blueprints/reference_templates/tcadocker-service.yaml-template +++ /dev/null @@ -1,192 +0,0 @@ -# -# ============LICENSE_START==================================================== -# org.onap.dcae -# ============================================================================= -# Copyright (c) 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: - - "http://www.getcloudify.org/spec/cloudify/3.4/types.yaml" - - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/dockerplugin/3.2.1/dockerplugin_types.yaml" - - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml" - - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/dcaepolicyplugin/2.3.0/dcaepolicyplugin_types.yaml" -inputs: - aaiEnrichmentHost: - default: none - type: string - aaiEnrichmentPort: - default: 8443 - type: string - cbs_host: - default: config-binding-service.dcae - type: string - cbs_port: - default: "10000" - type: string - consul_host: - default: consul-server.onap-consul - type: string - consul_port: - default: "8500" - type: string - dh_location_id: - default: zone1 - type: string - dh_override: - default: component_dockerhost - type: string - dmaap_host: - default: dmaap.onap-message-router - type: string - dmaap_port: - default: 3904 - type: string - enableAAIEnrichment: - default: false - type: string - enableRedisCaching: - default: false - type: string - external_port: - default: "32016" - description: "Port for CDAPgui to be exposed" - type: string - policy_id: - default: none - type: string - redisHosts: - type: string - tag_version: - default: "{{ ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_releases }}/onap/org.onap.dcaegen2.deployments.tca-cdap-container:1.0.0" - type: string -node_templates: - docker_service_host: - properties: - docker_host_override: - get_input: dh_override - location_id: - get_input: dh_location_id - type: dcae.nodes.SelectedDockerHost - tca_docker: - interfaces: - cloudify.interfaces.lifecycle: - start: - inputs: - envs: - AAIHOST: - get_input: aaiEnrichmentHost - AAIPORT: - get_input: aaiEnrichmentPort - CBS_HOST: - get_input: cbs_host - CBS_PORT: - get_input: cbs_port - CONFIG_BINDING_SERVICE: config_binding_service - CONSUL_HOST: - get_input: consul_host - CONSUL_PORT: - get_input: consul_port - DMAAPHOST: - get_input: dmaap_host - DMAAPPORT: - get_input: dmaap_port - DMAAPPUBTOPIC: unauthenticated.DCAE_CL_OUTPUT - DMAAPSUBTOPIC: unauthenticated.VES_MEASUREMENT_OUTPUT -# SERVICE_11011_IGNORE: "true" - SERVICE_11015_IGNORE: "true" - ports: - - concat: ["11011:", { get_input: external_port }] - stop: - inputs: - cleanup_image: true - properties: - application_config: - app_config: - appDescription: "DCAE Analytics Threshold Crossing Alert Application" - appName: dcae-tca - tcaAlertsAbatementTableName: TCAAlertsAbatementTable - tcaAlertsAbatementTableTTLSeconds: "1728000" - tcaSubscriberOutputStreamName: TCASubscriberOutputStream - tcaVESAlertsTableName: TCAVESAlertsTable - tcaVESAlertsTableTTLSeconds: "1728000" - tcaVESMessageStatusTableName: TCAVESMessageStatusTable - tcaVESMessageStatusTableTTLSeconds: "86400" - thresholdCalculatorFlowletInstances: "2" - app_preferences: - aaiEnrichmentHost: - get_input: aaiEnrichmentHost - aaiEnrichmentIgnoreSSLCertificateErrors: "true" - aaiEnrichmentPortNumber: "8443" - aaiEnrichmentProtocol: https - aaiEnrichmentUserName: DCAE - aaiEnrichmentUserPassword: DCAE - aaiVMEnrichmentAPIPath: /aai/v11/search/nodes-query - aaiVNFEnrichmentAPIPath: /aai/v11/network/generic-vnfs/generic-vnf - enableAAIEnrichment: - get_input: enableAAIEnrichment - enableAlertCEFFormat: "false" - enableRedisCaching: - get_input: enableRedisCaching - publisherContentType: application/json - publisherHostName: - get_input: dmaap_host - publisherHostPort: - get_input: dmaap_port - publisherMaxBatchSize: "1" - publisherMaxRecoveryQueueSize: "100000" - publisherPollingInterval: "20000" - publisherProtocol: http - publisherTopicName: unauthenticated.DCAE_CL_OUTPUT - redisHosts: - get_input: redisHosts - subscriberConsumerGroup: OpenDCAE-c12 - subscriberConsumerId: c12 - subscriberContentType: application/json - subscriberHostName: - get_input: dmaap_host - subscriberHostPort: - get_input: dmaap_port - subscriberMessageLimit: "-1" - subscriberPollingInterval: "30000" - subscriberProtocol: http - subscriberTimeoutMS: "-1" - subscriberTopicName: unauthenticated.VES_MEASUREMENT_OUTPUT - 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.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\"}]}]}" - docker_config: - healthcheck: - endpoint: / - interval: 15s - timeout: 1s - type: http - image: - get_input: tag_version - service_component_type: dcaegen2-analytics_tca - relationships: - - - target: docker_service_host - type: dcae.relationships.component_contained_in - - - target: tca_policy - type: cloudify.relationships.depends_on - type: dcae.nodes.DockerContainerForComponentsUsingDmaap - tca_policy: - properties: - policy_id: - get_input: policy_id - type: dcae.nodes.policy - diff --git a/blueprints/reference_templates/test_dr_mr.yaml-template b/blueprints/reference_templates/test_dr_mr.yaml-template deleted file mode 100644 index 4667186..0000000 --- a/blueprints/reference_templates/test_dr_mr.yaml-template +++ /dev/null @@ -1,121 +0,0 @@ -# ================================================================================ -# Copyright (c) 2019 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.4.13/k8splugin_types.yaml - - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/dmaap/dmaap.yaml - -inputs: - topic00_name: - type: string - default: "topic00" - feed00_name: - type: string - default: "feed00" - feed00_desc: - type: string - default: "Test feed from orchestrator" - location: - type: string - default: "san-francisco" - username: - type: string - default: "drdeliver" - password: - type: string - default: "1loveDataR0uter" - delivery_url: - type: string - default: "https://example.com/whatever" - -node_templates: - - feed00: - type: ccsdk.nodes.Feed - properties: - feed_name: { get_input: feed00_name } - feed_description: { get_input: feed00_desc } - feed_version: 7.0.19 - aspr_classification: "unclassified" - - topic00: - type: ccsdk.nodes.Topic - properties: - topic_name: { get_input: topic00_name } - - - client00: - type: dcae.nodes.ContainerizedServiceComponentUsingDmaap - - properties: - service_component_type: 'nginx-web' - image: nginx - docker_config: - healthcheck: - type: "http" - endpoint: "/" - streams_publishes: - - name: feed00 - location: { get_input: location } - client_role: org.onap.dcae.pnfPublisher - type: data_router - username: { get_input: username } - password: { get_input: password } - delivery_url: { get_input: delivery_url } - streams_subscribes: - - name: topic00 - location: { get_input: location } - client_role: org.onap.dcae.pnfSubscriber - type: message_router - - relationships: - - type: ccsdk.relationships.publish_files - target: feed00 - - type: ccsdk.relationships.subscribe_to_events - target: topic00 - - interfaces: - cloudify.interfaces.lifecycle: - start: - inputs: - ports: - - '80:0' - -outputs: - - feed00_publish_url: - description: "Feed 00 publish URL" - value: { get_attribute: [feed00, publish_url]} - - feed00_logurl: - description: "Feed 00 logging URL" - value: { get_attribute: [feed00, log_url]} - - feed00_feed_id: - description: "Feed 00 feed id" - value: { get_attribute: [feed00, feed_id]} - - client00_feed00: - description: "Feed 00 data on client00" - value: { get_attribute: [client00, feed00]} - - client00_topic00: - description: "Topic 00 data on client00" - value: { get_attribute: [client00, topic00]} - diff --git a/blueprints/reference_templates/test_dr_pubsub.yaml-template b/blueprints/reference_templates/test_dr_pubsub.yaml-template deleted file mode 100644 index dfde13a..0000000 --- a/blueprints/reference_templates/test_dr_pubsub.yaml-template +++ /dev/null @@ -1,145 +0,0 @@ -# ================================================================================ -# Copyright (c) 2019 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.4.13/k8splugin_types.yaml - - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/dmaap/dmaap.yaml - -inputs: - feed00_name: - type: string - default: "feed00" - feed00_desc: - type: string - default: "Test feed from orchestrator" - location: - type: string - default: "san-francisco" - username: - type: string - default: "drdeliver" - password: - type: string - default: "1loveDataR0uter" - delivery_url: - type: string - default: "https://example.com/whatever" - -node_templates: - - feed00: - type: ccsdk.nodes.Feed - properties: - feed_name: { get_input: feed00_name } - feed_description: { get_input: feed00_desc } - feed_version: 1.0.9 - aspr_classification: "unclassified" - - client00: - type: dcae.nodes.ContainerizedServiceComponentUsingDmaap - - properties: - service_component_type: 'nginx-web' - image: nginx - docker_config: - healthcheck: - type: "http" - endpoint: "/" - streams_publishes: - - name: feed00 - location: { get_input: location } - client_role: org.onap.dcae.pnfPublisher - type: data_router - username: { get_input: username } - password: { get_input: password } - delivery_url: { get_input: delivery_url } - - relationships: - - type: ccsdk.relationships.publish_files - target: feed00 - - interfaces: - cloudify.interfaces.lifecycle: - start: - inputs: - ports: - - '80:0' - - client01: - type: dcae.nodes.ContainerizedServiceComponentUsingDmaap - - properties: - service_component_type: 'nginx-web' - image: nginx - docker_config: - healthcheck: - type: "http" - endpoint: "/" - application_config: - isSelfServeComponent: false - services_calls: {} - streams_subscribes: - ONAP-TEST-SUB-DR: - dmaap_info: <> - type: data_router - streams_subscribes: - - name: feed00 - location: { get_input: location } - client_role: org.onap.dcae.pnfSubscriber - type: data_router - route: ONAP-TEST-SUB-DR - username: { get_input: username } - password: { get_input: password } - delivery_url: { get_input: delivery_url } - - relationships: - - type: ccsdk.relationships.subscribe_to_files - target: feed00 - - interfaces: - cloudify.interfaces.lifecycle: - start: - inputs: - ports: - - '80:0' - - -outputs: - - feed00_publish_url: - description: "Feed 00 publish URL" - value: { get_attribute: [feed00, publish_url]} - - feed00_logurl: - description: "Feed 00 logging URL" - value: { get_attribute: [feed00, log_url]} - - feed00_feed_id: - description: "Feed 00 feed id" - value: { get_attribute: [feed00, feed_id]} - - client00_feed00: - description: "Feed 00 data on client00" - value: { get_attribute: [client00, feed00]} - - client01_feed00: - description: "Feed 00 data on client01" - value: { get_attribute: [client01, feed00]} - - diff --git a/blueprints/reference_templates/test_mr_multipub.yaml-template b/blueprints/reference_templates/test_mr_multipub.yaml-template deleted file mode 100644 index 84ae247..0000000 --- a/blueprints/reference_templates/test_mr_multipub.yaml-template +++ /dev/null @@ -1,178 +0,0 @@ -# ================================================================================ -# Copyright (c) 2019 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.4.13/k8splugin_types.yaml - - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/dmaap/dmaap.yaml - -inputs: - topic00_name: - type: string - default: "topic00" - topic01_name: - type: string - default: "topic01" - topic02_name: - type: string - default: "topic02" - topic03_name: - type: string - default: "topic03" - topic04_name: - type: string - default: "topic04" - topic05_name: - type: string - default: "topic05" - topic06_name: - type: string - default: "topic06" - location: - type: string - default: "san-francisco" - -node_templates: - - topic00: - type: ccsdk.nodes.Topic - properties: - topic_name: { get_input: topic00_name } - - topic01: - type: ccsdk.nodes.Topic - properties: - topic_name: { get_input: topic01_name } - - topic02: - type: ccsdk.nodes.Topic - properties: - topic_name: { get_input: topic02_name } - - topic03: - type: ccsdk.nodes.Topic - properties: - topic_name: { get_input: topic03_name } - - topic04: - type: ccsdk.nodes.Topic - properties: - topic_name: { get_input: topic04_name } - - topic05: - type: ccsdk.nodes.Topic - properties: - topic_name: { get_input: topic05_name } - - topic06: - type: ccsdk.nodes.Topic - properties: - topic_name: { get_input: topic06_name } - - client00: - type: dcae.nodes.ContainerizedServiceComponentUsingDmaap - - properties: - service_component_type: 'nginx-web' - image: nginx - docker_config: - healthcheck: - type: "http" - endpoint: "/" - streams_publishes: - - name: topic00 - location: { get_input: location } - client_role: org.onap.dcae.pnfPublisher - type: message_router - - name: topic01 - location: { get_input: location } - client_role: org.onap.dcae.pnfPublisher - type: message_router - - name: topic02 - location: { get_input: location } - client_role: org.onap.dcae.pnfPublisher - type: message_router - - name: topic03 - location: { get_input: location } - client_role: org.onap.dcae.pnfPublisher - type: message_router - - name: topic04 - location: { get_input: location } - client_role: org.onap.dcae.pnfPublisher - type: message_router - - name: topic05 - location: { get_input: location } - client_role: org.onap.dcae.pnfPublisher - type: message_router - - name: topic06 - location: { get_input: location } - client_role: org.onap.dcae.pnfPublisher - type: message_router - - relationships: - - type: ccsdk.relationships.publish_events - target: topic00 - - type: ccsdk.relationships.publish_events - target: topic01 - - type: ccsdk.relationships.publish_events - target: topic02 - - type: ccsdk.relationships.publish_events - target: topic03 - - type: ccsdk.relationships.publish_events - target: topic04 - - type: ccsdk.relationships.publish_events - target: topic05 - - type: ccsdk.relationships.publish_events - target: topic06 - - interfaces: - cloudify.interfaces.lifecycle: - start: - inputs: - ports: - - '80:0' - -outputs: - topic00_data: - description: "Topic 00 data on client00" - value: { get_attribute: [client00, topic00]} - - topic01_data: - description: "Topic 01 data on client00" - value: { get_attribute: [client00, topic01]} - - topic02_data: - description: "Topic 02 data on client00" - value: { get_attribute: [client00, topic02]} - - topic03_data: - description: "Topic 03 data on client00" - value: { get_attribute: [client00, topic03]} - - topic04_data: - description: "Topic 04 data on client00" - value: { get_attribute: [client00, topic04]} - - topic05_data: - description: "Topic 05 data on client00" - value: { get_attribute: [client00, topic05]} - - topic06_data: - description: "Topic 06 data on client00" - value: { get_attribute: [client00, topic06]} - diff --git a/blueprints/reference_templates/test_mr_multisub.yaml-template b/blueprints/reference_templates/test_mr_multisub.yaml-template deleted file mode 100644 index ad84a9c..0000000 --- a/blueprints/reference_templates/test_mr_multisub.yaml-template +++ /dev/null @@ -1,186 +0,0 @@ -# ================================================================================ -# Copyright (c) 2019 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.4.13/k8splugin_types.yaml - - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/dmaap/dmaap.yaml - -inputs: - topic00_name: - type: string - default: "topic00" - topic01_name: - type: string - default: "topic01" - topic02_name: -inputs: - topic00_name: - type: string - default: "topic00" - topic01_name: - type: string - default: "topic01" - topic02_name: - type: string - default: "topic02" - topic03_name: - type: string - default: "topic03" - topic04_name: - type: string - default: "topic04" - topic05_name: - type: string - default: "topic05" - topic06_name: - type: string - default: "topic06" - location: - type: string - default: "san-francisco" - -node_templates: - - topic00: - type: ccsdk.nodes.Topic - properties: - topic_name: { get_input: topic00_name } - - topic01: - type: ccsdk.nodes.Topic - properties: - topic_name: { get_input: topic01_name } - - topic02: - type: ccsdk.nodes.Topic - properties: - topic_name: { get_input: topic02_name } - - topic03: - type: ccsdk.nodes.Topic - properties: - topic_name: { get_input: topic03_name } - - topic04: - type: ccsdk.nodes.Topic - properties: - topic_name: { get_input: topic04_name } - - topic05: - type: ccsdk.nodes.Topic - properties: - topic_name: { get_input: topic05_name } - - topic06: - type: ccsdk.nodes.Topic - properties: - topic_name: { get_input: topic06_name } - - client00: - type: dcae.nodes.ContainerizedServiceComponentUsingDmaap - - properties: - service_component_type: 'nginx-web' - image: nginx - docker_config: - healthcheck: - type: "http" - endpoint: "/" - streams_subscribes: - - name: topic00 - location: { get_input: location } - client_role: org.onap.dcae.pnfPublisher - type: message_router - - name: topic01 - location: { get_input: location } - client_role: org.onap.dcae.pnfPublisher - type: message_router - - name: topic02 - location: { get_input: location } - client_role: org.onap.dcae.pnfPublisher - type: message_router - - name: topic03 - location: { get_input: location } - client_role: org.onap.dcae.pnfPublisher - type: message_router - - name: topic04 - location: { get_input: location } - client_role: org.onap.dcae.pnfPublisher - type: message_router - - name: topic05 - location: { get_input: location } - client_role: org.onap.dcae.pnfPublisher - type: message_router - - name: topic06 - location: { get_input: location } - client_role: org.onap.dcae.pnfPublisher - type: message_router - - relationships: - - type: ccsdk.relationships.subscribe_to_events - target: topic00 - - type: ccsdk.relationships.subscribe_to_events - target: topic01 - - type: ccsdk.relationships.subscribe_to_events - target: topic02 - - type: ccsdk.relationships.subscribe_to_events - target: topic03 - - type: ccsdk.relationships.subscribe_to_events - target: topic04 - - type: ccsdk.relationships.subscribe_to_events - target: topic05 - - type: ccsdk.relationships.subscribe_to_events - target: topic06 - - interfaces: - cloudify.interfaces.lifecycle: - start: - inputs: - ports: - - '80:0' - -outputs: - topic00_data: - description: "Topic 00 data on client00" - value: { get_attribute: [client00, topic00]} - - topic01_data: - description: "Topic 01 data on client00" - value: { get_attribute: [client00, topic01]} - - topic02_data: - description: "Topic 02 data on client00" - value: { get_attribute: [client00, topic02]} - - topic03_data: - description: "Topic 03 data on client00" - value: { get_attribute: [client00, topic03]} - - topic04_data: - description: "Topic 04 data on client00" - value: { get_attribute: [client00, topic04]} - - topic05_data: - description: "Topic 05 data on client00" - value: { get_attribute: [client00, topic05]} - - topic06_data: - description: "Topic 06 data on client00" - value: { get_attribute: [client00, topic06]} - diff --git a/blueprints/reference_templates/test_mr_pubsub.yaml-template b/blueprints/reference_templates/test_mr_pubsub.yaml-template deleted file mode 100644 index 0d09216..0000000 --- a/blueprints/reference_templates/test_mr_pubsub.yaml-template +++ /dev/null @@ -1,89 +0,0 @@ -# ================================================================================ -# Copyright (c) 2019 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.4.13/k8splugin_types.yaml - - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/dmaap/dmaap.yaml - -inputs: - topic00_name: - type: string - default: "topic00" - topic01_name: - type: string - default: "topic01" - location: - type: string - default: "san-francisco" - -node_templates: - - topic00: - type: ccsdk.nodes.Topic - properties: - topic_name: { get_input: topic00_name } - - topic01: - type: ccsdk.nodes.Topic - properties: - topic_name: { get_input: topic01_name } - - web_server: - type: dcae.nodes.ContainerizedServiceComponentUsingDmaap - - properties: - service_component_type: 'nginx-web' - image: nginx - docker_config: - healthcheck: - type: "http" - endpoint: "/" - streams_publishes: - - name: topic00 - location: { get_input: location } - client_role: org.onap.dcae.pnfPublisher - type: message_router - streams_subscribes: - - name: topic01 - location: { get_input: location } - client_role: org.onap.dcae.pnfSubscriber - type: message_router - - relationships: - - type: ccsdk.relationships.publish_events - target: topic00 - - type: ccsdk.relationships.subscribe_to_events - target: topic01 - - interfaces: - cloudify.interfaces.lifecycle: - start: - inputs: - ports: - - '80:0' -outputs: - - topic00_data: - description: "Topic 00 data on client00" - value: { get_attribute: [web_server, topic00]} - - topic01_data: - description: "Topic 01 data on client00" - value: { get_attribute: [web_server, topic01]} - diff --git a/blueprints/reference_templates/test_mr_pubsub_extra.yaml-template b/blueprints/reference_templates/test_mr_pubsub_extra.yaml-template deleted file mode 100644 index f034e6c..0000000 --- a/blueprints/reference_templates/test_mr_pubsub_extra.yaml-template +++ /dev/null @@ -1,93 +0,0 @@ -# ================================================================================ -# Copyright (c) 2019 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.4.13/k8splugin_types.yaml - - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/dmaap/dmaap.yaml - -inputs: - topic00_name: - type: string - default: "topic00" - topic01_name: - type: string - default: "topic01" - location: - type: string - default: "san-francisco" - -node_templates: - - topic00: - type: ccsdk.nodes.Topic - properties: - topic_name: { get_input: topic00_name } - replication_case: REPLICATION_EDGE_TO_CENTRAL_TO_GLOBAL - global_mr_url: message-router - - topic01: - type: ccsdk.nodes.Topic - properties: - topic_name: { get_input: topic01_name } - replication_case: REPLICATION_EDGE_TO_CENTRAL - - client00: - type: dcae.nodes.ContainerizedServiceComponentUsingDmaap - - properties: - service_component_type: 'nginx-web' - image: nginx - docker_config: - healthcheck: - type: "http" - endpoint: "/" - streams_publishes: - - name: topic00 - location: { get_input: location } - client_role: org.onap.dcae.pnfPublisher - type: message_router - streams_subscribes: - - name: topic01 - location: { get_input: location } - client_role: org.onap.dcae.pnfSubscriber - type: message_router - - relationships: - - type: ccsdk.relationships.publish_events - target: topic00 - - type: ccsdk.relationships.subscribe_to_events - target: topic01 - - interfaces: - cloudify.interfaces.lifecycle: - start: - inputs: - ports: - - '80:0' - -outputs: - - topic00_data: - description: "Topic 00 data on client00" - value: { get_attribute: [client00, topic00]} - - topic01_data: - description: "Topic 01 data on client00" - value: { get_attribute: [client00, topic01]} - diff --git a/blueprints/reference_templates/ves.yaml-template b/blueprints/reference_templates/ves.yaml-template deleted file mode 100644 index 0653e3d..0000000 --- a/blueprints/reference_templates/ves.yaml-template +++ /dev/null @@ -1,135 +0,0 @@ -# -*- 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 }}/type_files/dockerplugin/2/dockerplugin_types.yaml" - - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_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.VES_MEASUREMENT_OUTPUT" - ves_notification_publish_url: - type: string - default: "http://10.0.11.1:3904/events/unauthenticated.VES_NOTIFICATION_OUTPUT" - ves_pnfRegistration_publish_url: - type: string - default: "http://10.0.11.1:3904/events/unauthenticated.VES_PNFREG_OUTPUT" - dh_override: - type: string - default: "component_dockerhost" - dh_location_id: - type: string - default: "zone1" - tag_version: - type: string - default: "nexus3.onap.org:10001/onap/org.onap.dcaegen2.collectors.ves.vescollector:1.3.1" - -node_templates: - docker_collector_host: - properties: - docker_host_override: - get_input: dh_override - location_id: - get_input: dh_location_id - type: dcae.nodes.SelectedDockerHost - ves: - interfaces: - cloudify.interfaces.lifecycle: - stop: - inputs: - cleanup_image: true - start: - inputs: - ports: - - '8080:8080' - properties: - 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|notification=ves-notification|pnfRegistration=ves-pnfRegistration - 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\",\"v7\":\"./etc/CommonEventFormat_30.0.1.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 - ves-notification: - dmaap_info: - topic_url: - get_input: ves_notification_publish_url - type: message_router - ves-pnfRegistration: - dmaap_info: - topic_url: - get_input: ves_pnfRegistration_publish_url - type: message_router - ves-heartbeat: - dmaap_info: - topic_url: - get_input: ves_heartbeat_publish_url - type: message_router - ves-other: - dmaap_info: - topic_url: - get_input: ves_other_publish_url - type: message_router - collector.dynamic.config.update.frequency: "5" - docker_config: - healthcheck: - endpoint: /healthcheck - interval: 15s - timeout: 1s - type: http - image: - get_input: tag_version - service_component_type: dcaegen2-collectors-ves - relationships: - - type: dcae.relationships.component_contained_in - target: docker_collector_host - type: dcae.nodes.DockerContainerForComponentsUsingDmaap diff --git a/check-blueprint-vs-input/bin/check-blueprint-vs-input b/check-blueprint-vs-input/bin/check-blueprint-vs-input deleted file mode 100755 index c6b271b..0000000 --- a/check-blueprint-vs-input/bin/check-blueprint-vs-input +++ /dev/null @@ -1,262 +0,0 @@ -#!/usr/bin/env python3 -# -*- indent-tabs-mode: nil -*- -# 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 code 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. - -from __future__ import print_function - -""" - - NAME - check-blueprint-vs-input - given a blueprint and inputs file pair, validate them against each other - - USAGE - check-blueprint-vs-input [-v] [-t] -b BLUEPRINT [-B exclusion-list] -i INPUTS [-B exclusion-list] - - DESCRIPTION -""" -description = """ - Validate a blueprint and inputs file against each other. This looks for the inputs: node of the blueprint - file, the inputs used by {get_input} within the blueprint, and the values found in the inputs file. The - files may be in either YAML or JSON formats. The names default to blueprint.yaml and inputs.yaml. If - a blueprint inputs name has a default value, it is not considered an error if it is not in the inputs file. - - If using a template inputs file, add the -t/--template option. This will look for the inputs under - an "inputs:" node instead of at the top level. - - If there are blueprint nodes or inputs nodes that should not be considered an error, specify them - using the -B/--blueprint-exclusion-list and -I/inputs-exclusion-list parameters. - - "check-blueprint-vs-input --help" will list all of the available options. -""" - -import sys, argparse, json, yaml -from yaml.composer import Composer -from yaml.constructor import Constructor -from yaml.constructor import SafeConstructor -from yaml.constructor import ScalarNode - -def main(): - DEF_BLUEPRINT_NAME = "blueprint.yaml" - DEF_INPUTS_NAME = "inputs.yaml" - parser = argparse.ArgumentParser(description=description) - parser.add_argument("-b", "--blueprint", type=str, help="Path to blueprint file, defaults to '%s'" % DEF_BLUEPRINT_NAME, - default=DEF_BLUEPRINT_NAME) - parser.add_argument("-i", "--inputs", type=str, help="Port to listen on, defaults to '%s'" % DEF_INPUTS_NAME, - default=DEF_INPUTS_NAME) - parser.add_argument("-B", "--blueprint-exclusion-list", type=str, help="Comma-separated list of names not to warn about not being in the blueprint file", default="") - parser.add_argument("-I", "--inputs-exclusion-list", type=str, help="Comma-separated list of names not to warn about not being in the inputs file", default="") - parser.add_argument("-t", "--inputs-template", help="Treat inputs file as coming from template area", action="store_true") - parser.add_argument("-v", "--verbose", help="Verbose, may be specified multiple times", action="count", default=0) - args = parser.parse_args() - - blueprintExclusionList = args.blueprint_exclusion_list.split(",") - if args.verbose: print("blueprintExclusionList=%s" % blueprintExclusionList) - - inputsExclusionList = args.inputs_exclusion_list.split(",") - if args.verbose: print("inputsExclusionList=%s" % inputsExclusionList) - - def loadYaml(filename, where): - """ - Load a YAML file - - Line number manipulation is inspired by: - https://stackoverflow.com/questions/13319067/parsing-yaml-return-with-line-number - - The YAML loader parses the file first into a set of nodes. Capture the - line numbers and column numbers during that parsing pass. - The YAML object is then created from those objects. - """ - - def compose_node(parent, index): - lineno = loader.line # the line number where the previous token has ended (plus empty lines) - # column = loader.column - node = Composer.compose_node(loader, parent, index) - node.__lineno__ = lineno + 1 - # node.__column__ = column + 1 - return node - - def construct_scalar(node): - where[node.value] = str(node.__lineno__) # + ":" + str(node.__column__) - return SafeConstructor.construct_scalar(loader, node) - - def construct_mapping(node, deep=False): - mapping = SafeConstructor.construct_mapping(loader, node, deep=deep) - mapping['__lineno__'] = str(node.__lineno__) # + ":" + str(node.__column__) - return mapping - - yread = None - try: - with open(filename, "r") as fd: - yread = fd.read() - except: - type, value, traceback = sys.exc_info() - sys.exit(value) - - loader = yaml.SafeLoader(yread) - loader.compose_node = compose_node - loader.construct_mapping = construct_mapping - loader.construct_scalar = construct_scalar - data = loader.get_single_data() - if args.verbose > 2: - print("================ %s ================" % filename) - yaml.dump(data, sys.stdout) - print("================================") - return data - - blueprint = loadYaml(args.blueprint, {}) - inputsWhere = { } - inputs = loadYaml(args.inputs, inputsWhere) - - # if inputs file is empty, provide an empty dictionary - if inputs is None: inputs = { } - - # blueprint file has inputs under the inputs: node - blueprintInputs = blueprint['inputs'] - - # inputs file normally has inputs at the top level, - # but templated inputs files have themunder the inputs: node - if args.inputs_template: inputs = inputs['inputs'] - - - exitval = 0 - - def check_blueprint_inputs(blueprintInputs, inputs, inputsExclusionList): - """ - check the blueprint inputs against the inputs file - """ - foundone = False - for input in blueprintInputs: - if input == '__lineno__': continue - if args.verbose: print("blueprint input=%s\n%s" % (input, blueprintInputs[input])) - if input in inputs: - if args.verbose: print("\tIS in inputs file") - else: - # print("blueprintInputs.get(input)=%s and blueprintInputs[input].get('default')=%s" % (blueprintInputs.get(input), blueprintInputs[input].get('default'))) - if blueprintInputs.get(input) and blueprintInputs[input].get('default'): - if args.verbose: print("\tHAS a default value") - elif input not in inputsExclusionList: - print("<<<<<<<<<<<<<<<< %s (blueprint line %s) not in inputs file" % (input, blueprintInputs[input].get('__lineno__'))) - foundone = True - else: - if args.verbose: print("<<<<<<<<<<<<<<<< %s not in inputs file, but being ignored" % input) - return foundone - - # check the blueprint inputs: against the inputs file - if args.verbose: print("================ check the blueprint inputs: against the inputs file") - foundone = check_blueprint_inputs(blueprintInputs, inputs, inputsExclusionList) - if foundone: print("") - if foundone: exitval = 1 - - def prettyprint(msg,j): - print(msg) - json.dump(j, sys.stdout, indent=4, sort_keys=True) - print("") - - def check_get_inputs(blueprint, blueprintInputs, inputs, inputsExclusionList): - """ - check the blueprint get_input values against the inputs file - """ - - def findInputs(d, where): - if args.verbose > 2: print("check_get_inputs(): d=%s" % d) - ret = [ ] - if isinstance(d, dict): - if args.verbose: print("type(d) is dict") - for key,val in d.items(): - linecol = d.get('__lineno__') - if args.verbose: print("looking at d[key=%s], line=%s" % (key, linecol)) - if key == '__lineno__': continue - if key == "get_input": - if args.verbose: print("found get_input, adding '%s'" % val) - ret += [ val ] - if not where.get(val): where[val] = str(linecol) - else: where[val] += "," + str(linecol) - return ret - else: - if args.verbose: print("going recursive on '%s'" % val) - ret += findInputs(val, where) - elif isinstance(d, list): - if args.verbose: print("type(d) is list") - for val in d: - if args.verbose: print("going recursive on '%s'" % val) - ret += findInputs(val, where) - else: - if args.verbose: print("type(d) is scalar: %s" % d) - return ret - - foundone = False - where = {} - inputList = findInputs(blueprint, where) - if args.verbose: - print("done looking for get_input, found:\n%s" % inputList) - prettyprint("where=",where) - alreadySeen = { } - for input in inputList: - if input not in alreadySeen: - alreadySeen[input] = True - if args.verbose: print("checking input %s" % input) - if input in inputs: - if args.verbose: print("\tIS in input file") - else: - if blueprintInputs.get(input) and blueprintInputs[input].get('default'): - if args.verbose: print("\tHAS a default value") - elif input not in inputsExclusionList: - line = where[input] - s = "s" if line.find(",") >= 0 else "" - print(":::::::::::::::: get_input: {0} is NOT in input file (blueprint line{1} {2})".format(input, s, line)) - foundone = True - else: - if args.verbose: - line = where[input] - s = "s" if line.find(",") >= 0 else "" - print(":::::::::::::::: get_input: %s is NOT in input file (blueprint line{1} {2}), but being ignored" % (input, s, line)) - - return foundone - - - - # check the blueprint's get_input calls against the inputs file - if args.verbose: print("================ check the blueprint's get_input calls against the inputs file ================") - foundone = check_get_inputs(blueprint, blueprintInputs, inputs, inputsExclusionList) - if foundone: print("") - if foundone: exitval = 1 - - def check_inputs(blueprintInputs, inputs, blueprintExclusionList): - """ - check the inputs file against the blueprints inputs list - """ - foundone = False - # prettyprint("inputs=", inputs) - for key,val in inputs.items(): - if key == '__lineno__': continue - if args.verbose: print("inputs key=%s" % key) - # print("inputs key=%s, line=%s, val=%s" % (key,inputsWhere[key],val)) # DELETE - if key in blueprintInputs: - if args.verbose: print("\tIS in blueprint") - else: - if key not in blueprintExclusionList: - print(">>>>>>>>>>>>>>>> %s is in inputs file (around line %s) but not in blueprint file" % (key, inputsWhere[key])) - foundone = True - else: - if args.verbose: print(">>>>>>>>>>>>>>>> %s is in inputs file (around line %s), but not in blueprint file and being ignored" % (key, inputsWhere[key])) - return foundone - - # check the inputs file against the blueprints input: section - if args.verbose: print("================ check the inputs file against the blueprints input: section ================") - foundone = check_inputs(blueprintInputs, inputs, blueprintExclusionList) - if foundone: exitval = 1 - sys.exit(exitval) - -if __name__ == "__main__": - main() diff --git a/check-blueprint-vs-input/lib/sample-inputs.yaml b/check-blueprint-vs-input/lib/sample-inputs.yaml deleted file mode 100644 index a56652b..0000000 --- a/check-blueprint-vs-input/lib/sample-inputs.yaml +++ /dev/null @@ -1,35 +0,0 @@ -# ================================================================================ -# 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========================================================= -# -# ECOMP is a trademark and service mark of AT&T Intellectual Property. -centos7image_id: 'some-value-in-guid-format' -ubuntu1604image_id: 'another-value-in-guid-format' -flavor_id: '4' -security_group: '55a11193-6559-4f6c-b2d2-0119a9817062' -public_net: 'admin_floating_228_net' -private_net: 'onap-f-net' -openstack: - username: 'MY_LOGIN' - password: 'MY_PASSWORD' - tenant_name: 'TENANT_NAME' - auth_url: 'KEYSTONE_AUTH_URL' - region: 'RegionOne' -keypair: 'KEYNME' -key_filename: '/opt/dcae/key' -location_prefix: 'onapr1' -location_domain: 'onapdevlab.onap.org' -codesource_url: 'https://nexus.onap.org/service/local/repositories/raw/content' -codesource_version: 'org.onap.dcaegen2.deployments/releases/scripts' diff --git a/check-blueprint-vs-input/man/check-blueprint-vs-input.1 b/check-blueprint-vs-input/man/check-blueprint-vs-input.1 deleted file mode 100644 index 247fbc6..0000000 --- a/check-blueprint-vs-input/man/check-blueprint-vs-input.1 +++ /dev/null @@ -1,50 +0,0 @@ -check-blueprint-vs-input(1UTIL) ONAP check-blueprint-vs-input(1UTIL) - - - -NNAAMMEE - check-blueprint-vs-input - -SSYYNNOOPPSSIISS - check-blueprint-vs-input [-h] [-b BLUEPRINT] [-i INPUTS] - [-B BLUEPRINT_EXCLUSION_LIST] - [-I INPUTS_EXCLUSION_LIST] [-t] [-v] - -DDEESSCCRRIIPPTTIIOONN - Validate a blueprint and inputs file against each other. This looks for - the inputs: node of the blueprint file, the inputs used by {get_input} - within the blueprint, and the values found in the inputs file. The - files may be in either YAML or JSON formats. The names default to blue‐ - print.yaml and inputs.yaml. If a blueprint inputs name has a default - value, it is not considered an error if it is not in the inputs file. - If using a template inputs file, add the -t/--template option. This - will look for the inputs under an "inputs:" node instead of at the top - level. If there are blueprint nodes or inputs nodes that should not be - considered an error, specify them using the -B/--blueprint- exclusion- - list and -I/inputs-exclusion-list parameters. "check-blueprint-vs- - input --help" will list all of the available options. - - OOPPTTIIOONNSS - -h, --help show this help message and exit - - -b BLUEPRINT, --blueprint BLUEPRINT Path to blueprint file, defaults to - 'blueprint.yaml' - - -i INPUTS, --inputs INPUTS Port to listen on, defaults to 'inputs.yaml' - - -B BLUEPRINT_EXCLUSION_LIST, --blueprint-exclusion-list BLUE‐ - PRINT_EXCLUSION_LIST Comma-separated list of names - not to warn about not - being in the blueprint file - - -I INPUTS_EXCLUSION_LIST, --inputs-exclusion-list INPUTS_EXCLUSION_LIST - Comma-separated list of names not to warn about not - being in the inputs file - - -t, --inputs-template Treat inputs file as coming from template area - - -v, --verbose Verbose, may be specified multiple times - - - -ONAP {{DATE}} check-blueprint-vs-input(1UTIL) diff --git a/check-blueprint-vs-input/man/check-blueprint-vs-input.man b/check-blueprint-vs-input/man/check-blueprint-vs-input.man deleted file mode 100644 index 017d529..0000000 --- a/check-blueprint-vs-input/man/check-blueprint-vs-input.man +++ /dev/null @@ -1,55 +0,0 @@ -'\" 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 code 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. -.TH check-blueprint-vs-input 1UTIL {{DATE}} ONAP ONAP -.SH NAME -check-blueprint-vs-input -.SH SYNOPSIS -check-blueprint-vs-input [-h] [-b BLUEPRINT] [-i INPUTS] - [-B BLUEPRINT_EXCLUSION_LIST] - [-I INPUTS_EXCLUSION_LIST] [-t] [-v] -.SH DESCRIPTION -Validate a blueprint and inputs file against each other. This looks for the -inputs: node of the blueprint file, the inputs used by {get_input} within the -blueprint, and the values found in the inputs file. The files may be in either -YAML or JSON formats. The names default to blueprint.yaml and inputs.yaml. If -a blueprint inputs name has a default value, it is not considered an error if -it is not in the inputs file. If using a template inputs file, add the --t/--template option. This will look for the inputs under an "inputs:" node -instead of at the top level. If there are blueprint nodes or inputs nodes that -should not be considered an error, specify them using the -B/--blueprint- -exclusion-list and -I/inputs-exclusion-list parameters. "check-blueprint-vs- -input --help" will list all of the available options. -.SS OPTIONS -.HP 20 --h, --help -show this help message and exit -.HP 20 --b BLUEPRINT, --blueprint BLUEPRINT -Path to blueprint file, defaults to 'blueprint.yaml' -.HP 20 --i INPUTS, --inputs INPUTS -Port to listen on, defaults to 'inputs.yaml' -.HP 20 --B BLUEPRINT_EXCLUSION_LIST, --blueprint-exclusion-list BLUEPRINT_EXCLUSION_LIST -Comma-separated list of names not to warn about not - being in the blueprint file -.HP 20 --I INPUTS_EXCLUSION_LIST, --inputs-exclusion-list INPUTS_EXCLUSION_LIST -Comma-separated list of names not to warn about not - being in the inputs file -.HP 20 --t, --inputs-template -Treat inputs file as coming from template area -.HP 20 --v, --verbose -Verbose, may be specified multiple times diff --git a/check-blueprint-vs-input/pom.xml b/check-blueprint-vs-input/pom.xml deleted file mode 100644 index 14b4d50..0000000 --- a/check-blueprint-vs-input/pom.xml +++ /dev/null @@ -1,250 +0,0 @@ - - - - 4.0.0 - - org.onap.dcaegen2.platform.blueprints - blueprints - 1.2.0-SNAPSHOT - - org.onap.dcaegen2.plaform.blueprints - check-blueprint-vs-input - dcaegen2-plaform-blueprints-check-blueprint-vs-input - 1.0.0-SNAPSHOT - http://maven.apache.org - - - UTF-8 - true - . - - - - - py - Python - **/*.py - - - - - ${project.artifactId}-${project.version} - - - - - org.sonatype.plugins - nexus-staging-maven-plugin - 1.6.7 - - true - - - - org.apache.maven.plugins - maven-deploy-plugin - - 2.8 - - true - - - - - - org.apache.maven.plugins - maven-resources-plugin - 2.6 - - true - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.1 - - true - - - - - org.apache.maven.plugins - maven-jar-plugin - 2.4 - - - default-jar - - - - - - - org.apache.maven.plugins - maven-install-plugin - 2.4 - - true - - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.12.4 - - true - - - - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.2.1 - - - clean phase script - clean - - exec - - - - ${project.artifactId} - clean - - - - - generate-sources script - generate-sources - - exec - - - - ${project.artifactId} - generate-sources - - - - - compile script - compile - - exec - - - - ${project.artifactId} - compile - - - - - package script - package - - exec - - - - ${project.artifactId} - package - - - - - test script - test - - exec - - - - ${project.artifactId} - test - - - - - install script - install - - exec - - - - ${project.artifactId} - install - - - - - deploy script - deploy - - exec - - - - ${project.artifactId} - deploy - bin/check-blueprint-vs-input - man/check-blueprint-vs-input.1 - - - - - - - - diff --git a/config/00-consul.json b/config/00-consul.json new file mode 100644 index 0000000..a7d6ff4 --- /dev/null +++ b/config/00-consul.json @@ -0,0 +1,9 @@ +{ + "datacenter": "dc1", + "data_dir": "/opt/consul", + "log_level": "INFO", + "server": false, + "retry_join": ["consul"], + "node_name": "dcae-bootstrap", + "disable_update_check": true + } \ No newline at end of file diff --git a/input-templates/cdap-sdk-inputs.yaml b/input-templates/cdap-sdk-inputs.yaml deleted file mode 100644 index e55c796..0000000 --- a/input-templates/cdap-sdk-inputs.yaml +++ /dev/null @@ -1,22 +0,0 @@ -# ================================================================================ -# Copyright (c) 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 is a trademark and service mark of AT&T Intellectual Property. -{ - "dh_location_id": "{{ dcae_zone }}", - "dh_override": "component_dockerhost", - "cdap_cluster_name": "cdap" -} diff --git a/input-templates/cdapinputs.yaml b/input-templates/cdapinputs.yaml deleted file mode 100644 index 879b59c..0000000 --- a/input-templates/cdapinputs.yaml +++ /dev/null @@ -1,35 +0,0 @@ -# ================================================================================ -# 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========================================================= -# -# ECOMP is a trademark and service mark of AT&T Intellectual Property. -ubuntu1604image_id: '{{ ubuntu_1604_image }}' -centos7image_id: '{{ centos_7_image }}' -flavor_id: '{{ flavor_id_cdap }}' -security_group: '{{ security_group }}' -public_net: '{{ public_net_id }}' -private_net: '{{ openstack_private_network_name }}' -openstack: - username: '{{ openstack_user }}' - password: '{{ openstack_password }}' - tenant_name: '{{ tenant_name }}' - auth_url: '{{ keystone_url }}' - region: '{{ openstack_region }}' -keypair: '{{ key_name }}' -key_filename: '/opt/dcae/key' -location_prefix: 'dcae' -location_domain: '{{ dcae_zone }}.{{ dcae_domain }}' -codesource_url: 'https://nexus.onap.org/service/local/repositories/raw/content' -codesource_version: 'org.onap.dcaegen2.deployments/releases' diff --git a/input-templates/datafile-collector-input.yaml b/input-templates/datafile-collector-input.yaml deleted file mode 100644 index 242eba2..0000000 --- a/input-templates/datafile-collector-input.yaml +++ /dev/null @@ -1,22 +0,0 @@ -# ================================================================================ -# 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========================================================= - -#dmaap_host: '{{ dmaap_host }}' -#dmaap_port: '{{ dmaap_port }}' -#dmaap_user: '{{ dmaap_user }}' -#dmaap_passwd: '{{ dmaap_passwd }}' -#tag_version: '{{ tag_version }}' -#replicas: '{{ replicas }}' \ No newline at end of file diff --git a/input-templates/dhinputs.yaml b/input-templates/dhinputs.yaml deleted file mode 100644 index 9014ac6..0000000 --- a/input-templates/dhinputs.yaml +++ /dev/null @@ -1,22 +0,0 @@ -# ================================================================================ -# 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========================================================= -# -# ECOMP is a trademark and service mark of AT&T Intellectual Property. -application_config: - cloudify: - protocol: "http" - inventory: - protocol: "http" diff --git a/input-templates/he-ip.yaml b/input-templates/he-ip.yaml deleted file mode 100644 index 284aa2d..0000000 --- a/input-templates/he-ip.yaml +++ /dev/null @@ -1,28 +0,0 @@ -# ================================================================================ -# 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========================================================= -# -# ECOMP is a trademark and service mark of AT&T Intellectual Property. -{ - "dh_location_id": "{{ dcae_zone }}", - "docker_host_override": "component_dockerhost", - "msb_hostname": "{{ openo_ip_addr }}", - "dcae_CL_publish_url": "http://{{ mr_ip_addr }}:3904/events/unauthenticated.DCAE_CL_OUTPUT", - "ves_fault_publish_url": "http://{{ mr_ip_addr }}:3904/events/unauthenticated.SEC_FAULT_OUTPUT", - "location_domain" : "{{ dcae_zone }}.{{ dcae_domain }}", - "location_prefix" : "dcae", - "pgaas_cluster_name" : "pgvm", - "database_name":"holmes" -} diff --git a/input-templates/heartbeat-input.json b/input-templates/heartbeat-input.json deleted file mode 100644 index eaf13a3..0000000 --- a/input-templates/heartbeat-input.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "dh_location_id": "{{ dcae_zone }}", - "docker_host_override": "component_dockerhost", - "dcae_CL_publish_url": "http://{{ mr_ip_addr }}:3904/events/unauthenticated.DCAE_CL_OUTPUT/", - "ves_heartbeat_url": "http://{{ mr_ip_addr }}:3904/events/unauthenticated.SEC_HEARTBEAT_OUTPUT/", - "tag_version": "nexus3.onap.org:10001/onap/org.onap.dcaegen2.platform.heartbeat:2.0" -} diff --git a/input-templates/hr-ip.yaml b/input-templates/hr-ip.yaml deleted file mode 100644 index 10c65e0..0000000 --- a/input-templates/hr-ip.yaml +++ /dev/null @@ -1,26 +0,0 @@ -# ================================================================================ -# 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========================================================= -# -# ECOMP is a trademark and service mark of AT&T Intellectual Property. -{ - "dh_location_id": "{{ dcae_zone }}", - "docker_host_override": "component_dockerhost", - "msb_hostname": "{{ openo_ip_addr }}", - "location_domain" : "{{ dcae_zone }}.{{ dcae_domain }}", - "location_prefix" : "dcae", - "pgaas_cluster_name" : "pgvm", - "database_name":"holmes" -} diff --git a/input-templates/inputs.yaml b/input-templates/inputs.yaml deleted file mode 100644 index b87a760..0000000 --- a/input-templates/inputs.yaml +++ /dev/null @@ -1,35 +0,0 @@ -# ================================================================================ -# 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========================================================= -# -# ECOMP is a trademark and service mark of AT&T Intellectual Property. -ubuntu1604image_id: '{{ ubuntu_1604_image }}' -centos7image_id: '{{ centos_7_image }}' -flavor_id: '{{ flavor_id }}' -security_group: '{{ security_group }}' -public_net: '{{ public_net_id }}' -private_net: '{{ openstack_private_network_name }}' -openstack: - username: '{{ openstack_user }}' - password: '{{ openstack_password }}' - tenant_name: '{{ tenant_name }}' - auth_url: '{{ keystone_url }}' - region: '{{ openstack_region }}' -keypair: '{{ key_name }}' -key_filename: '/opt/dcae/key' -location_prefix: 'dcae' -location_domain: '{{ dcae_zone }}.{{ dcae_domain }}' -codesource_url: 'https://nexus.onap.org/service/local/repositories/raw/content' -codesource_version: 'org.onap.dcaegen2.deployments/releases' diff --git a/input-templates/invinputs.yaml b/input-templates/invinputs.yaml deleted file mode 100644 index 9701b9b..0000000 --- a/input-templates/invinputs.yaml +++ /dev/null @@ -1,27 +0,0 @@ -# ================================================================================ -# 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========================================================= -# -# ECOMP is a trademark and service mark of AT&T Intellectual Property. -docker_host_override: "platform_dockerhost" -asdc_address: '{{ sdc_ip_addr }}:8443' -asdc_uri: 'https://{{ sdc_ip_addr }}:8443' -asdc_user: "dcae" -asdc_password: !!str Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U -asdc_environment_name: "AUTO" -postgres_user_inventory: "postgres" -postgres_password_inventory: "onap123" -service_change_handler_image: "{{ nexus_docker_repo }}/onap/org.onap.dcaegen2.platform.servicechange-handler:v1.0.0" -inventory_image: "{{ nexus_docker_repo }}/onap/org.onap.dcaegen2.platform.inventory-api:v1.2.0" diff --git a/input-templates/phinputs.yaml b/input-templates/phinputs.yaml deleted file mode 100644 index bbdab63..0000000 --- a/input-templates/phinputs.yaml +++ /dev/null @@ -1,108 +0,0 @@ -# ================================================================================ -# 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========================================================= -# -# ECOMP is a trademark and service mark of AT&T Intellectual Property. - -application_config: - policy_handler : - # parallelize the getConfig queries to policy-engine on each policy-update notification - thread_pool_size : 4 - - # parallelize requests to policy-engine and keep them alive - pool_connections : 20 - - # retry to getConfig from policy-engine on policy-update notification - policy_retry_count : 5 - policy_retry_sleep : 5 - - # mode of operation for the policy-handler - # either active or passive - # in passive mode the policy-hanlder will not listen to - # and will not bring the policy-updates from policy-engine - mode_of_operation : "active" - - # config of automatic catch_up for resiliency - catch_up : - # interval in seconds on how often to call automatic catch_up - # example: 1200 is 20*60 seconds that is 20 minutes - interval : 1200 - - # config of periodic reconfigure-rediscover for adaptability - reconfigure: - # interval in seconds on how often to call automatic reconfigure - # example: 600 is 10*60 seconds that is 10 minutes - interval : 600 - - # policy-engine config - # These are the url of and the auth for the external system, namely the policy-engine (PDP). - # We obtain that info manually from PDP folks at the moment. - # In long run we should figure out a way of bringing that info into consul record - # related to policy-engine itself. - policy_engine : - url : "http://{{ policy_ip_addr }}:8081" - path_decision : "/decision/v1" - path_notifications : "/pdp/notifications" - path_api : "/pdp/api/" - headers : - Accept : "application/json" - "Content-Type" : "application/json" - ClientAuth : "cHl0aG9uOnRlc3Q=" - Authorization : "Basic dGVzdHBkcDphbHBoYTEyMw==" - Environment : "TEST" - target_entity : "policy_engine" - # optional tls_ca_mode specifies where to find the cacert.pem for tls - # can be one of these: - # "cert_directory" - use the cacert.pem stored locally in cert_directory. - # this is the default if cacert.pem file is found - # - # "os_ca_bundle" - use the public ca_bundle provided by linux system. - # this is the default if cacert.pem file not found - # - # "do_not_verify" - special hack to turn off the verification by cacert and hostname - tls_ca_mode : "cert_directory" - # optional tls_wss_ca_mode specifies the same for the tls based web-socket - tls_wss_ca_mode : "cert_directory" - # optional timeout_in_secs specifies the timeout for the http requests - timeout_in_secs: 60 - # optional ws_ping_interval_in_secs specifies the ping interval for the web-socket connection - ws_ping_interval_in_secs: 30 - # deploy_handler config - # changed from string "deployment_handler" in 2.3.1 to structure in 2.4.0 - deploy_handler : - # name of deployment-handler service used by policy-handler for logging - target_entity : "deployment_handler" - # url of the deployment-handler service for policy-handler to direct the policy-updates to - # - expecting dns to resolve the hostname deployment-handler to ip address - url : "http://deployment-handler:8188" - # limit the size of a single data segment for policy-update messages - # from policy-handler to deployment-handler in megabytes - max_msg_length_mb : 5 - query : - # optionally specify the tenant name for the cloudify under deployment-handler - # if not specified the "default_tenant" is used by the deployment-handler - cfy_tenant_name : "default_tenant" - # optional tls_ca_mode specifies where to find the cacert.pem or skip tls verification - # can be one of these: - # "cert_directory" - use the cacert.pem stored locally in cert_directory. - # this is the default if cacert.pem file is found - # - # "os_ca_bundle" - use the public ca_bundle provided by linux system. - # this is the default if cacert.pem file not found - # - # "do_not_verify" - special hack to turn off the verification by cacert and hostname - tls_ca_mode : "cert_directory" - # optional timeout_in_secs specifies the timeout for the http requests - timeout_in_secs: 60 diff --git a/input-templates/pom.xml b/input-templates/pom.xml deleted file mode 100644 index c0d7a75..0000000 --- a/input-templates/pom.xml +++ /dev/null @@ -1,174 +0,0 @@ - - - - 4.0.0 - - org.onap.dcaegen2.platform - blueprints - 1.2.0-SNAPSHOT - - org.onap.dcaegen2.platform.blueprints - input-templates - dcaegen2-platform-blueprints-input-templates - 1.0.0-SNAPSHOT - http://maven.apache.org - - - UTF-8 - true - . - - - - - py - Python - **/*.py - - - - - ${project.artifactId}-${project.version} - - - - - org.codehaus.mojo - exec-maven-plugin - 1.2.1 - - - clean phase script - clean - - exec - - - - ${project.artifactId} - clean - - - - - generate-sources script - generate-sources - - exec - - - - ${project.artifactId} - generate-sources - - - - - compile script - compile - - exec - - - - ${project.artifactId} - compile - - - - - package script - package - - exec - - - - ${project.artifactId} - package - - - - - test script - test - - exec - - - - ${project.artifactId} - test - - - - - install script - install - - exec - - - - ${project.artifactId} - install - - - - - deploy script - deploy - - exec - - - - ${project.artifactId} - deploy - - - - - - - - diff --git a/input-templates/prh-input.json b/input-templates/prh-input.json deleted file mode 100644 index 5dab4f5..0000000 --- a/input-templates/prh-input.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "dh_location_id": "{{ dcae_zone }}", - "docker_host_override": "component_dockerhost", - "prh_publish_url": "http://{{ mr_ip_addr }}:3904/events/unauthenticated.unauthenticated.PNF_READY/", - "prh_subscribe_url": "http://{{ mr_ip_addr }}:3904/events/unauthenticated.VES_PNFREG_OUTPUT/", - "tag_version": "nexus3.onap.org:10001/onap/org.onap.dcaegen2.services.prh:1.2.2" -} diff --git a/input-templates/prh-input.yaml b/input-templates/prh-input.yaml deleted file mode 100644 index 6b54630..0000000 --- a/input-templates/prh-input.yaml +++ /dev/null @@ -1,26 +0,0 @@ -# ================================================================================ -# 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========================================================= - -#aaiEnrichmentHost: '{{ aaiEnrichmentHost }}' -#aaiEnrichmentPort: '{{ aaiEnrichmentPort }}' -#aaiEnrichmentUser: '{{ aaiEnrichmentUser }}' -#aaiEnrichmentPasswd: '{{ aaiEnrichmentPasswd }}' -#dmaap_host: '{{ dmaap_host }}' -#dmaap_port: '{{ dmaap_port }}' -#dmaap_user: '{{ dmaap_user }}' -#dmaap_passwd: '{{ dmaap_passwd }}' -#tag_version: '{{ tag_version }}' -#replicas: '{{ replicas }}' \ No newline at end of file diff --git a/input-templates/snmptrap-input.json b/input-templates/snmptrap-input.json deleted file mode 100644 index b3be3df..0000000 --- a/input-templates/snmptrap-input.json +++ /dev/null @@ -1,7 +0,0 @@ - -{ - "dh_location_id": "{{ dcae_zone }}", - "docker_host_override": "component_dockerhost", - "snmp_publish_url": "http://{{ mr_ip_addr }}:3904/events/unauthenticated.ONAP-COLLECTOR-SNMPTRAP/", - "tag_version": "nexus3.onap.org:10001/onap/org.onap.dcaegen2.collectors.snmptrap:1.3" -} diff --git a/input-templates/tcadocker-input.json b/input-templates/tcadocker-input.json deleted file mode 100644 index 56a1681..0000000 --- a/input-templates/tcadocker-input.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "aaiEnrichmentHost": "{{ aai1_ip_addr }}", - "enableAAIEnrichment": true, - "subscriberHostName": "{{ mr_ip_addr }}", - "publisherHostName": "{{ mr_ip_addr }}", - "dh_location_id": "{{ dcae_zone }}", - "dh_override": "component_dockerhost", - "redisHosts": "{{ redis_ip_port_addr }}", - "enableRedisCaching": true, - "tag_version": "nexus3.onap.org:10001/onap/tca-cdap-container:1.0" -} diff --git a/input-templates/tcainputs.yaml b/input-templates/tcainputs.yaml deleted file mode 100644 index a4d3828..0000000 --- a/input-templates/tcainputs.yaml +++ /dev/null @@ -1,21 +0,0 @@ -# ================================================================================ -# 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========================================================= -# -# ECOMP is a trademark and service mark of AT&T Intellectual Property. -aaiEnrichmentHost: '{{ aai1_ip_addr }}' -enableAAIEnrichment: true -subscriberHostName: '{{ mr_ip_addr }}' -publisherHostName: '{{ mr_ip_addr }}' diff --git a/input-templates/vesinput.yaml b/input-templates/vesinput.yaml deleted file mode 100644 index 8ddfb2c..0000000 --- a/input-templates/vesinput.yaml +++ /dev/null @@ -1,27 +0,0 @@ -# ================================================================================ -# 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========================================================= -# -# ECOMP is a trademark and service mark of AT&T Intellectual Property. -{ - "dh_location_id": "{{ dcae_zone }}", - "dh_override": "component_dockerhost", - "ves_other_publish_url": "http://{{ mr_ip_addr }}:3904/events/unauthenticated.SEC_OTHER_OUTPUT/", - "ves_heartbeat_publish_url": "http://{{ mr_ip_addr }}:3904/events/unauthenticated.SEC_HEARTBEAT_OUTPUT/", - "ves_fault_publish_url": "http://{{ mr_ip_addr }}:3904/events/unauthenticated.SEC_FAULT_OUTPUT/", - "ves_measurement_publish_url": "http://{{ mr_ip_addr }}:3904/events/unauthenticated.SEC_MEASUREMENT_OUTPUT/", - "ves_pnfRegistration_publish_url": "http://{{ mr_ip_addr }}:3904/events/unauthenticated.VES_PNFREG_OUTPUT/", - "ves_notification_publish_url": "http://{{ mr_ip_addr }}:3904/events/unauthenticated.VES_NOTIFICATION_OUTPUT/" -} diff --git a/mvn-phase-script.sh b/mvn-phase-script.sh index 892ea23..2f43cff 100755 --- a/mvn-phase-script.sh +++ b/mvn-phase-script.sh @@ -1,7 +1,7 @@ #!/bin/bash # ================================================================================ -# Copyright (c) 2017-2018 AT&T Intellectual Property. All rights reserved. +# Copyright (c) 2017-2020 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. @@ -60,7 +60,7 @@ if [ -z "$SETTINGS_FILE" ]; then echo "SETTINGS_FILE environment variable not set. Cannot proceed" exit fi - + # mvn phase in life cycle @@ -122,12 +122,7 @@ install) echo "==> install phase script" ;; deploy) - echo "==> deploy phase script" - if [ -z "$MVN_PROJECT_MODULEID" ]; then - upload_files_of_extension yaml - else - upload_files_of_extension yaml "$MVN_PROJECT_MODULEID" - fi + build_and_push_docker ;; *) echo "==> unprocessed phase" diff --git a/pom.xml b/pom.xml index c0caee5..9f97f47 100644 --- a/pom.xml +++ b/pom.xml @@ -25,16 +25,12 @@ ECOMP is a trademark and service mark of AT&T Intellectual Property. oparent 1.2.0 - org.onap.dcaegen2.platform - blueprints - dcaegen2-platform-blueprints - 1.2.0-SNAPSHOT + org.onap.dcaegen2.deployments + k8s-bootstrap-container + dcaegen2-deployments-k8s-bootstrap-container + 1.9.0-SNAPSHOT http://maven.apache.org pom - - blueprints - input-templates - https://nexus.onap.org @@ -92,7 +88,7 @@ ECOMP is a trademark and service mark of AT&T Intellectual Property. - org.apache.maven.plugins @@ -123,7 +119,7 @@ ECOMP is a trademark and service mark of AT&T Intellectual Property. - org.apache.maven.plugins @@ -173,5 +169,106 @@ ECOMP is a trademark and service mark of AT&T Intellectual Property. + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + clean phase script + clean + + exec + + + + ${project.artifactId} + clean + + + + + generate-sources script + generate-sources + + exec + + + + ${project.artifactId} + generate-sources + + + + + compile script + compile + + exec + + + + ${project.artifactId} + compile + + + + + package script + package + + exec + + + + ${project.artifactId} + package + + + + + test script + test + + exec + + + + ${project.artifactId} + test + + + + + install script + install + + exec + + + + ${project.artifactId} + install + + + + + deploy script + deploy + + exec + + + + ${project.artifactId} + deploy + + + + + + diff --git a/reference_templates/DeploymentHandler-README.md b/reference_templates/DeploymentHandler-README.md new file mode 100644 index 0000000..8b76890 --- /dev/null +++ b/reference_templates/DeploymentHandler-README.md @@ -0,0 +1,23 @@ +## Deployment Handler Installation Blueprint +[`DeploymentHandler.yaml`](./DeploymentHandler.yaml) is a Cloudify blueprint that can be used to deploy an instance of the DCAE Deployment Handler (DH) as a Docker container in the DCAE Docker environment. + +### Input parameters +Some deployment parameters can be controlled via inputs supplied to Cloudify at the time a deployment is created from the blueprint. +The table below describes the available input parameters. + +Parameter|Description|Required?|Default +---------|-----------|---------|------- +`location_id`|Location where DH is to be deployed; should point to a central site|Yes|None +`docker_host_override`|Registered service name of the Docker host where DH should be deployed|Yes|`platform_dockerhost` +`deployment_handler_image`|Fully qualified name of the Docker image to use for DH|Yes|Current stable version of image +`application_config`|Application-specific configuration parameters (see below)|No|`{}` +`host_log_root`|root directory for logs in the Docker host file system|Yes|`/opt/onap/log` + +### Application configuration +The DH has sensible defaults for its configuration. The `application_config` input can be used to supply additional configuration information to override defaults and/or to set values for optional parameters. The content of this input is a dictionary with parameter names as keys and parameter values as values. See the documentation for the DH for the available configuration parameters. + +### Additional configuration +`DeploymentHandler.yaml` relies on the DCAE Docker plugin to carry out the actual deployment. The plugin gathers information from the blueprint and the inputs and uses this information to make API calls to a Docker Engine running in the DCAE environment. + +Certain aspects of Docker behavior are controlled through inputs to the plugin's `create` operation. This includes mapping directories and files from the host file system into the Docker container's file system. It is also possible to pass environment variables to the container. The inputs to the `create` operation are specified inside the blueprint in the `interfaces` section of node definition for the deployment handler. + diff --git a/reference_templates/DeploymentHandler.yaml-template b/reference_templates/DeploymentHandler.yaml-template new file mode 100644 index 0000000..4856636 --- /dev/null +++ b/reference_templates/DeploymentHandler.yaml-template @@ -0,0 +1,102 @@ +# -*- indent-tabs-mode: nil -*- # vi: set expandtab: +# +# ============LICENSE_START========================================== +# org.onap.dcae +# =================================================================== +# Copyright © 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============================================ +# +# 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 DCAE deployment handler as a Docker container + +imports: + - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dockerplugin/2/dockerplugin_types.yaml + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml + + +inputs: + + location_id: + description: Deployment location + + docker_host_override: + description: Target docker host + default: 'platform_dockerhost' + + deployment_handler_image: + description: Docker image for deployment handler + default: '{{ ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_releases }}/onap/org.onap.dcaegen2.platform.deployment-handler:3.2.0' + + application_config: + description: deployment handler application configuration (to override defaults) + default: {} + + host_log_root: + description: root directory for logs in the Docker host file system + default: '/opt/onap/log' + +node_templates: + + # Deployment Handler + deployment-handler: + type: dcae.nodes.DockerContainerForPlatforms + properties: + name: + 'deployment_handler' + image: + { get_input: deployment_handler_image } + application_config: + { get_input: application_config } + host_port: + 8188 + container_port: + 8443 + docker_config: + healthcheck: + type: 'http' + interval: '300s' + timeout: '5s' + endpoint: '/' + relationships: + - type: dcae.relationships.component_contained_in + target: docker_host + interfaces: + cloudify.interfaces.lifecycle: + start: + inputs: + envs: + SOMEVAR: somevalue + #volumes: + #- host: + #path: { concat: [ { get_input: host_log_root }, '/dcae/deployment_handler' ] } + #container: + #bind: /opt/app/dh/log + #mode: rw + + # Docker host + docker_host: + type: dcae.nodes.SelectedDockerHost + properties: + location_id: + { get_input: location_id } + docker_host_override: + { get_input: docker_host_override } diff --git a/reference_templates/DockerBP.yaml-template b/reference_templates/DockerBP.yaml-template new file mode 100644 index 0000000..e655063 --- /dev/null +++ b/reference_templates/DockerBP.yaml-template @@ -0,0 +1,345 @@ +# -*- 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 + - http://www.getcloudify.org/spec/openstack-plugin/1.4/plugin.yaml + - http://www.getcloudify.org/spec/fabric-plugin/1.4.1/plugin.yaml + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/dnsdesig/dns_types.yaml + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/sshkeyshare/sshkey_types.yaml + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dockerplugin/2/dockerplugin_types.yaml + + + +inputs: + registered_dockerhost_name: + description: the name that this Dockerhost is registered as + location_id: + description: the location ID for the location where the Docker hsot is being deployed + type: string + target_datacenter: + description: |- + This is the name of the target Consul datacenter that the docker host will try to join + type: string + registrator_image: + description: |- + Full uri to registrator Docker image. Note! You should be using the forked version of + registrator in order to have Consul health checks for Docker containers. + type: string + centos7image_id: + type: string + default: '' + ubuntu1604image_id: + type: string + flavor_id: + type: string + security_group: + type: string + public_net: + type: string + private_net: + type: string + openstack: {} + keypair: + type: string + location_prefix: + type: string + location_domain: + type: string + node_name: + description: Used to construct the fqdn of the docker host + type: string + default: dokr00 + key_filename: + type: string + codesource_url: + type: string + codesource_version: + type: string + vm_init_dokr_00: + type: string + default: |- + #!/bin/sh + set -x + DATACENTER= + vm_init_dokr_01: + type: string + default: |- + REGNAME= + vm_init_dokr_fqdn: + type: string + description: |- + The FQDN environment variable is to be used in the cloud init script for the Docker host. + This is to be applied as metadata on the Consul node for the Docker host under the key + "fqdn". + default: |- + FQDN= + vm_init_dokr_service_tags: + type: string + description: |- + Environment variable assigned to a list of strings that are to be used as tags to label + the docker host. These tags are used when registering the docker host as a service in + Consul. The format of this input parameter is a string that is a shell script variable + assignment of the variable SERVICE_TAGS. It must be either null or a json array of strings. + Here is a valid example of when the value is a json array: + + 'SERVICE_TAGS="[\"foo\", \"bar\"]"' + + Note how the double quotes per array element are escaped. + default: "SERVICE_TAGS=null" + vm_init_dokr_02: + type: string + default: | + MYIP=`wget -qO- http://169.254.169.254/2009-04-04/meta-data/local-ipv4` + while [ -z "$MYPUB" ]; do + MYPUB=`wget -qO- http://169.254.169.254/2009-04-04/meta-data/public-ipv4` + sleep 5 + done + echo "My public IP: $MYPUB" + MYNAME=`hostname` + echo >>/etc/hosts + echo $MYIP $MYNAME >>/etc/hosts + + # Grab nameservers to be used to setup recursors for Consul + cat < /tmp/grab_nameservers.py + with open("/etc/resolv.conf", "r") as f: + nss = [line.split(" ")[1].strip() for line in f.readlines() if line.startswith("nameserver")] + print("[\"{0}\"]".format("\",\"".join(nss))) + EOF + NAMESERVERS=$(python3 /tmp/grab_nameservers.py) + + mkdir -p /opt/consul/config /opt/consul/data /opt/consul/bin + # Download Consul from Nexus + apt-get update + DEBIAN_FRONTEND=noninteractive apt-get install -y -q unzip + CONSUL_BIN_DIR=/opt/consul/bin + curl -Ss https://releases.hashicorp.com/consul/0.8.3/consul_0.8.3_linux_amd64.zip > $CONSUL_BIN_DIR/consul_0.8.3_linux_amd64.zip + unzip $CONSUL_BIN_DIR/consul_0.8.3_linux_amd64.zip -d $CONSUL_BIN_DIR + # NOTE: The health check for the docker host is a simple existence look up for + # registrator (name is hardcoded). It does not check if registrator is running. + # This would require a script health check which means we might need to turn on + # "enable_script_check". + # NOTE: At the time of this change, there is no issue but there could be a + # chicken-and-egg issue where the health check might depend upon future downstream + # nodes (registrator) that downstream node requires a *healthy* docker host. + cat < /opt/consul/config/consul.json + { + "bind_addr" : "0.0.0.0", + "client_addr" : "0.0.0.0", + "advertise_addr" : "$MYIP", + "data_dir" : "/opt/consul/data", + "datacenter": "$DATACENTER", + "http_api_response_headers": { + "Access-Control-Allow-Origin" : "*" + }, + "rejoin_after_leave": true, + "server": false, + "ui": false, + "enable_syslog": true, + "log_level": "info", + "ports": { + "dns": 53 + }, + "recursors": $NAMESERVERS, + "service" : { + "id": "$REGNAME", + "name": "$REGNAME", + "address": "$MYPUB", + "port": 2376, + "tags": $SERVICE_TAGS, + "checks": [ + { + "http": "http://$MYPUB:2376/containers/registrator/json", + "interval": "30s" + } + ] + }, + "node_meta": { + "fqdn": "$FQDN" + } + } + EOF + + # Specify DOCKER_HOST environment variable to support healthchecks for Docker containers + # in Consul. Tried using the local unix socket but that did not work (possible bug in Consul) + # so forcing to use the http connection to Docker engine. + cat < /lib/systemd/system/consul.service + [Unit] + Description=Consul + Requires=network-online.target + After=network.target + [Service] + Type=simple + Environment=DOCKER_HOST=tcp://localhost:2376 + ExecStart=/opt/consul/bin/consul agent -config-dir=/opt/consul/config + ExecReload=/bin/kill -HUP \$MAINPID + [Install] + WantedBy=multi-user.target + EOF + systemctl enable consul + systemctl start consul + until /opt/consul/bin/consul join "cloudify-manager-${DATACENTER}" + do + echo Waiting to join Consul cluster + sleep 60 + done + + DEBIAN_FRONTEND=noninteractive apt-get install -y -q linux-image-extra-`uname -r` linux-image-extra-virtual apparmor dirmngr + DEBIAN_FRONTEND=noninteractive apt-get install -y -q docker.io + echo 'DOCKER_OPTS="--raw-logs -H tcp://0.0.0.0:2376 -H unix:///var/run/docker.sock"' >>/etc/default/docker + systemctl restart docker +node_templates: + key_pair: + type: cloudify.openstack.nodes.KeyPair + properties: + private_key_path: { get_input: key_filename } + use_external_resource: True + resource_id: { get_input: keypair } + openstack_config: &open_conf + get_input: openstack + private_net: + type: cloudify.openstack.nodes.Network + properties: + use_external_resource: True + resource_id: { get_input: private_net } + openstack_config: *open_conf + security_group: + type: cloudify.openstack.nodes.SecurityGroup + properties: + use_external_resource: True + resource_id: { get_input: security_group } + openstack_config: *open_conf + fixedip_dokr00: + type: cloudify.openstack.nodes.Port + properties: + port: + extra_dhcp_opts: + - opt_name: 'domain-name' + opt_value: { get_input: location_domain } + openstack_config: *open_conf + relationships: + - type: cloudify.relationships.contained_in + target: private_net + floatingip_dokr00: + type: cloudify.openstack.nodes.FloatingIP + properties: + openstack_config: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + floating_network_name: { get_input: public_net } + dns_dokr00: + type: ccsdk.nodes.dns.arecord + properties: + fqdn: { concat: [ { get_input: location_prefix }, { get_input: node_name }, '.', { get_input: location_domain } ] } + openstack: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + ip_addresses: + - { get_attribute: [ floatingip_dokr00, floating_ip_address ] } + relationships: + - type: cloudify.relationships.depends_on + target: floatingip_dokr00 + host_dokr00: + type: cloudify.openstack.nodes.Server + properties: + install_agent: false + image: { get_input: ubuntu1604image_id } + flavor: { get_input: flavor_id } + management_network_name: { get_input: private_net } + openstack_config: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + name: { concat: [ { get_input: location_prefix }, { get_input: node_name }] } + userdata: + concat: + - { get_input: vm_init_dokr_00 } + - { get_input: target_datacenter } + - |+ + + - { get_input: vm_init_dokr_01 } + - { get_input: registered_dockerhost_name } + - |+ + + - { get_input: vm_init_dokr_fqdn } + - { get_property: [ dns_dokr00, fqdn ] } + - |+ + + - { get_input: vm_init_dokr_service_tags } + - |+ + + - { get_input: vm_init_dokr_02 } + relationships: + - type: cloudify.openstack.server_connected_to_port + target: fixedip_dokr00 + - type: cloudify.openstack.server_connected_to_security_group + target: security_group + - type: cloudify.openstack.server_connected_to_floating_ip + target: floatingip_dokr00 + - type: cloudify.openstack.server_connected_to_keypair + target: key_pair + - type: cloudify.relationships.depends_on + target: dns_dokr00 + + registrator: + type: dcae.nodes.DockerContainer + properties: + name: + 'registrator' + image: + { get_input: registrator_image } + relationships: + - type: dcae.relationships.component_contained_in + target: docker_host + interfaces: + cloudify.interfaces.lifecycle: + start: + inputs: + envs: + EXTERNAL_IP: + get_attribute: [ floatingip_dokr00, floating_ip_address ] + volumes: + - host: + path: '/var/run/docker.sock' + container: + bind: '/tmp/docker.sock' + mode: 'ro' + + docker_host: + type: dcae.nodes.SelectedDockerHost + properties: + location_id: + { get_input: location_id } + docker_host_override: + { get_input: registered_dockerhost_name } + relationships: + - type: cloudify.relationships.depends_on #this is to avoid a race condition + target: host_dokr00 diff --git a/reference_templates/README.txt b/reference_templates/README.txt new file mode 100644 index 0000000..3834c38 --- /dev/null +++ b/reference_templates/README.txt @@ -0,0 +1,52 @@ +Blueprints used for deployment of VM's and cluster for DCAE deployment (Amsterdam release) +========================================================================================= +centos_vm.yaml-template +DockerBP.yaml-template +consul_cluster.yaml-template +cdap-sdk.yaml-template +cdapbp7.yaml-template +pgaas-database.yaml-template +pgaas-cluster.yaml-template +pgaas-onevm.yaml-template +pgaas-getdbinfo.yaml-template +pgaas-disk.yaml-template +pgaas.yaml-template + + +Blueprint used for spinning up Platform components in VM's (Amsterdam release) +============================================================================== +centos_vm.yaml-template +inventory.yaml-template +cdap_broker.yaml-template +policy_handler.yaml-template +DeploymentHandler.yaml-template +config_binding_service.yaml-template + +Blueprint used for spinning up Service components in VM's (Amsterdam release) +============================================================================== +holmes-rules.yaml-template +holmes-engine.yaml-template +heartbeat-service.yaml-template +ves.yaml-template +tca.yaml-template +snmptrap-collector.yaml-template +prh-service.yaml-template +tcadocker-service.yaml-template + + +Blueprints used for K8S deployment through K8SPlugin +==================================================== +k8s-policy_handler.yaml-template +k8s-inventory.yaml-template +k8s-deployment_handler.yaml-template +k8s-config_binding_service.yaml-template + + +Blueprints used for testing dmaap plugin +======================================== +test_dr_mr.yaml-template +test_dr_pubsub.yaml-template +test_mr_multipub.yaml-template +test_mr_multisub.yaml-template +test_mr_pubsub_extra.yaml-template +test_mr_pubsub.yaml-template diff --git a/reference_templates/cdap-sdk.yaml-template b/reference_templates/cdap-sdk.yaml-template new file mode 100644 index 0000000..cd1244f --- /dev/null +++ b/reference_templates/cdap-sdk.yaml-template @@ -0,0 +1,71 @@ +# ============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: + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dockerplugin/2/dockerplugin_types.yaml + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml + +inputs: + dh_override: + type: string + default: "component_dockerhost" + dh_location_id: + type: string + default: "dcaeams" + cdap_cluster_name: + type: string + default: "cdap" +node_templates: + docker_cdap_host: + properties: + docker_host_override: + get_input: dh_override + location_id: + get_input: dh_location_id + type: dcae.nodes.SelectedDockerHost + cdapdocker: + interfaces: + cloudify.interfaces.lifecycle: + stop: + inputs: + cleanup_image: true + start: + inputs: + ports: + - '11011:11011' + envs: + SERVICE_11015_NAME: { get_input: cdap_cluster_name } + SERVICE_11011_IGNORE: 'true' + properties: + host_port: 11015 + container_port: 11015 + docker_config: + healthcheck: + endpoint: "/status" + interval: "15s" + timeout: "15s" + type: "http" + name: 'cdap_docker' + image: "caskdata/cdap-standalone:4.1.2" + relationships: + - type: dcae.relationships.component_contained_in + target: docker_cdap_host + type: dcae.nodes.DockerContainerForPlatforms + diff --git a/reference_templates/cdap_broker.yaml-template b/reference_templates/cdap_broker.yaml-template new file mode 100644 index 0000000..3c29634 --- /dev/null +++ b/reference_templates/cdap_broker.yaml-template @@ -0,0 +1,97 @@ +# -*- 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 + +description: > + This blueprint is for managing the CDAP infrastructure + +imports: + - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/cdapcloudify/14/cdapcloudify_types.yaml + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dockerplugin/2/dockerplugin_types.yaml + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml + +inputs: + location_id: + type: string + default: "" + cdap_cluster_name: + type: string + default: "cdap" + +node_templates: + + broker_deleter: + #does nothing on install, but deletes all registered apps when broker is uninstalled + #uninstalling the broker without doing this leaves them in purgatory forever, unless CDAP was also uninstalled, but that may or may not be true or in the same blueprint. + type: dcae.nodes.broker_deleter + interfaces: + cloudify.interfaces.lifecycle: + delete: + inputs: + connected_broker_dns_name: { get_property: [cdap_broker, name] } + relationships: + - type: cloudify.relationships.depends_on + target: cdap_broker + + cdap_broker: + type: dcae.nodes.DockerContainerForPlatforms + properties: + name: 'cdap_broker' + application_config: + bindingttw: 5 + hcinterval: 60s + autoderegisterafter: 10m + pipelinehealthlimit: 2 + host_port: 7777 + container_port: 7777 + docker_config: + healthcheck: + type: "http" + #broker has a semi healthcheck endpoint at root right now, TODO would be to add a real /healtcheck endpoint + endpoint: "/" + interval: "120s" + timeout: "60s" + image: "{{ ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_releases }}/onap/org.onap.dcaegen2.platform.cdapbroker:v4.0.0" + interfaces: + cloudify.interfaces.lifecycle: + start: + inputs: + envs: + CDAP_CLUSTER_TO_MANAGE: { get_input: cdap_cluster_name } + volumes: + - host: + path: '/tmp/log/cdapbroker/' + container: + bind: '/tmp/log/cdapbroker/' #Broker EELF log directory + mode: 'rw' + relationships: + - type: dcae.relationships.component_contained_in + target: docker_host + + docker_host: + type: dcae.nodes.SelectedDockerHost + properties: + location_id: + { get_input: location_id } + docker_host_override: + 'platform_dockerhost' + #WARNING: ASSUMES THIS EXISTS AND IS ALREADY REGISTERED diff --git a/reference_templates/cdapbp7.yaml-template b/reference_templates/cdapbp7.yaml-template new file mode 100644 index 0000000..7fddaa1 --- /dev/null +++ b/reference_templates/cdapbp7.yaml-template @@ -0,0 +1,1054 @@ +# -*- 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 + - http://www.getcloudify.org/spec/openstack-plugin/1.4/plugin.yaml + - http://www.getcloudify.org/spec/fabric-plugin/1.4.1/plugin.yaml + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/dnsdesig/dns_types.yaml + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/sshkeyshare/sshkey_types.yaml + +inputs: + centos7image_id: + type: string + default: '' + ubuntu1404image_id: + type: string + default: '' + ubuntu1604image_id: + type: string + flavor_id: + type: string + security_group: + type: string + public_net: + type: string + private_net: + type: string + openstack: {} + keypair: + type: string + location_prefix: + type: string + location_domain: + type: string + key_filename: + type: string + codesource_url: + type: string + codesource_version: + type: string + + vm_init_cdap: + type: string + default: | + wget -qO- $CODE_SOURCE/${CODE_VERSION}/cloud_init/cdap-init.sh >/tmp/cdap-init.sh + sh /tmp/cdap-init.sh "$CODE_SOURCE" "$CODE_VERSION" "$CLUSTER_INDEX" "$CLUSTER_SIZE" "$CLUSTER_FQDNS" "$CLUSTER_LOCAL_IPS" "$CLUSTER_FLOATING_IPS" "$DATACENTER" "$REGISTERED_NAME" + location_id: + default: "solutioning-central" + cdap_cluster_name: + type: string + default: "cdap" + +node_templates: + key_pair: + type: cloudify.openstack.nodes.KeyPair + properties: + private_key_path: { get_input: key_filename } + use_external_resource: True + resource_id: { get_input: keypair } + openstack_config: &open_conf + get_input: openstack + private_net: + type: cloudify.openstack.nodes.Network + properties: + use_external_resource: True + resource_id: { get_input: private_net } + openstack_config: *open_conf + security_group: + type: cloudify.openstack.nodes.SecurityGroup + properties: + use_external_resource: True + resource_id: { get_input: security_group } + openstack_config: *open_conf + + sharedsshkey_cdap: + type: ccsdk.nodes.ssh.keypair + hostdeps_cdap: + type: cloudify.nodes.Root + relationships: + - type: cloudify.relationships.depends_on + target: dns_cdap00 + - type: cloudify.relationships.depends_on + target: fixedip_cdap00 + - type: cloudify.relationships.depends_on + target: dns_cdap01 + - type: cloudify.relationships.depends_on + target: fixedip_cdap01 + - type: cloudify.relationships.depends_on + target: dns_cdap02 + - type: cloudify.relationships.depends_on + target: fixedip_cdap02 + - type: cloudify.relationships.depends_on + target: dns_cdap03 + - type: cloudify.relationships.depends_on + target: fixedip_cdap03 + - type: cloudify.relationships.depends_on + target: dns_cdap04 + - type: cloudify.relationships.depends_on + target: fixedip_cdap04 + - type: cloudify.relationships.depends_on + target: dns_cdap05 + - type: cloudify.relationships.depends_on + target: fixedip_cdap05 + - type: cloudify.relationships.depends_on + target: dns_cdap06 + - type: cloudify.relationships.depends_on + target: fixedip_cdap06 + fixedip_cdap00: + type: cloudify.openstack.nodes.Port + properties: + port: + extra_dhcp_opts: + - opt_name: 'domain-name' + opt_value: { get_input: location_domain } + openstack_config: *open_conf + relationships: + - type: cloudify.relationships.contained_in + target: private_net + floatingip_cdap00: + type: cloudify.openstack.nodes.FloatingIP + properties: + openstack_config: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + floating_network_name: { get_input: public_net } + dns_cdap00: + type: ccsdk.nodes.dns.arecord + properties: + fqdn: { concat: [ { get_input: location_prefix }, 'cdap00.', { get_input: location_domain } ] } + openstack: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + ip_addresses: + - { get_attribute: [ floatingip_cdap00, floating_ip_address ] } + relationships: + - type: cloudify.relationships.depends_on + target: floatingip_cdap00 + host_cdap00: + type: cloudify.openstack.nodes.Server + properties: + install_agent: false + image: { get_input: ubuntu1604image_id } + flavor: { get_input: flavor_id } + management_network_name: { get_input: private_net } + openstack_config: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + name: { concat: [ { get_input: location_prefix }, 'cdap00' ] } + userdata: + concat: + - |- + #!/bin/sh + mkdir /root/.sshkey + echo ' + - { get_attribute: [ sharedsshkey_cdap, public ] } + - |- + ' >/root/.sshkey/id_rsa.pub + echo ' + - { get_attribute: [ sharedsshkey_cdap, base64private ] } + - |- + ' | base64 -d >/root/.sshkey/id_rsa + chmod 700 /root/.sshkey + chmod 600 /root/.sshkey/* + set -x + CLUSTER_INDEX=00 + CLUSTER_SIZE=7 + CLUSTER_FQDNS= + - { get_property: [ dns_cdap00, fqdn ] } + - ',' + - { get_property: [ dns_cdap01, fqdn ] } + - ',' + - { get_property: [ dns_cdap02, fqdn ] } + - ',' + - { get_property: [ dns_cdap03, fqdn ] } + - ',' + - { get_property: [ dns_cdap04, fqdn ] } + - ',' + - { get_property: [ dns_cdap05, fqdn ] } + - ',' + - { get_property: [ dns_cdap06, fqdn ] } + - "\nCLUSTER_FLOATING_IPS=" + - { get_attribute: [ floatingip_cdap00, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap01, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap02, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap03, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap04, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap05, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap06, floating_ip_address ] } + - "\nCLUSTER_LOCAL_IPS=" + - { get_attribute: [ fixedip_cdap00, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap01, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap02, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap03, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap04, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap05, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap06, fixed_ip_address ] } + - "\nCODE_SOURCE=" + - { get_input: codesource_url } + - "\nCODE_VERSION=" + - { get_input: codesource_version } + - "\n" + - "DATACENTER=" + - { get_input: location_id } + - "\n" + - { get_input: vm_init_cdap } + relationships: + - type: cloudify.openstack.server_connected_to_port + target: fixedip_cdap00 + - type: cloudify.openstack.server_connected_to_security_group + target: security_group + - type: cloudify.openstack.server_connected_to_floating_ip + target: floatingip_cdap00 + - type: cloudify.openstack.server_connected_to_keypair + target: key_pair + - type: cloudify.relationships.depends_on + target: hostdeps_cdap + - type: cloudify.relationships.depends_on + target: sharedsshkey_cdap + fixedip_cdap01: + type: cloudify.openstack.nodes.Port + properties: + port: + extra_dhcp_opts: + - opt_name: 'domain-name' + opt_value: { get_input: location_domain } + openstack_config: *open_conf + relationships: + - type: cloudify.relationships.contained_in + target: private_net + floatingip_cdap01: + type: cloudify.openstack.nodes.FloatingIP + properties: + openstack_config: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + floating_network_name: { get_input: public_net } + dns_cdap01: + type: ccsdk.nodes.dns.arecord + properties: + fqdn: { concat: [ { get_input: location_prefix }, 'cdap01.', { get_input: location_domain } ] } + openstack: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + ip_addresses: + - { get_attribute: [ floatingip_cdap01, floating_ip_address ] } + relationships: + - type: cloudify.relationships.depends_on + target: floatingip_cdap01 + host_cdap01: + type: cloudify.openstack.nodes.Server + properties: + install_agent: false + image: { get_input: ubuntu1604image_id } + flavor: { get_input: flavor_id } + management_network_name: { get_input: private_net } + openstack_config: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + name: { concat: [ { get_input: location_prefix }, 'cdap01' ] } + userdata: + concat: + - |- + #!/bin/sh + mkdir /root/.sshkey + echo ' + - { get_attribute: [ sharedsshkey_cdap, public ] } + - |- + ' >/root/.sshkey/id_rsa.pub + echo ' + - { get_attribute: [ sharedsshkey_cdap, base64private ] } + - |- + ' | base64 -d >/root/.sshkey/id_rsa + chmod 700 /root/.sshkey + chmod 600 /root/.sshkey/* + set -x + CLUSTER_INDEX=01 + CLUSTER_SIZE=7 + CLUSTER_FQDNS= + - { get_property: [ dns_cdap00, fqdn ] } + - ',' + - { get_property: [ dns_cdap01, fqdn ] } + - ',' + - { get_property: [ dns_cdap02, fqdn ] } + - ',' + - { get_property: [ dns_cdap03, fqdn ] } + - ',' + - { get_property: [ dns_cdap04, fqdn ] } + - ',' + - { get_property: [ dns_cdap05, fqdn ] } + - ',' + - { get_property: [ dns_cdap06, fqdn ] } + - "\nCLUSTER_FLOATING_IPS=" + - { get_attribute: [ floatingip_cdap00, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap01, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap02, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap03, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap04, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap05, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap06, floating_ip_address ] } + - "\nCLUSTER_LOCAL_IPS=" + - { get_attribute: [ fixedip_cdap00, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap01, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap02, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap03, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap04, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap05, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap06, fixed_ip_address ] } + - "\nCODE_SOURCE=" + - { get_input: codesource_url } + - "\nCODE_VERSION=" + - { get_input: codesource_version } + - "\n" + - "DATACENTER=" + - { get_input: location_id } + - "\n" + - { get_input: vm_init_cdap } + relationships: + - type: cloudify.openstack.server_connected_to_port + target: fixedip_cdap01 + - type: cloudify.openstack.server_connected_to_security_group + target: security_group + - type: cloudify.openstack.server_connected_to_floating_ip + target: floatingip_cdap01 + - type: cloudify.openstack.server_connected_to_keypair + target: key_pair + - type: cloudify.relationships.depends_on + target: hostdeps_cdap + - type: cloudify.relationships.depends_on + target: sharedsshkey_cdap + fixedip_cdap02: + type: cloudify.openstack.nodes.Port + properties: + port: + extra_dhcp_opts: + - opt_name: 'domain-name' + opt_value: { get_input: location_domain } + openstack_config: *open_conf + relationships: + - type: cloudify.relationships.contained_in + target: private_net + floatingip_cdap02: + type: cloudify.openstack.nodes.FloatingIP + properties: + openstack_config: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + floating_network_name: { get_input: public_net } + dns_cdap02: + type: ccsdk.nodes.dns.arecord + properties: + fqdn: { concat: [ { get_input: location_prefix }, 'cdap02.', { get_input: location_domain } ] } + openstack: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + ip_addresses: + - { get_attribute: [ floatingip_cdap02, floating_ip_address ] } + relationships: + - type: cloudify.relationships.depends_on + target: floatingip_cdap02 + host_cdap02: + type: cloudify.openstack.nodes.Server + properties: + install_agent: false + image: { get_input: ubuntu1604image_id } + flavor: { get_input: flavor_id } + management_network_name: { get_input: private_net } + openstack_config: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + name: { concat: [ { get_input: location_prefix }, 'cdap02' ] } + userdata: + concat: + - |- + #!/bin/sh + mkdir /root/.sshkey + echo ' + - { get_attribute: [ sharedsshkey_cdap, public ] } + - |- + ' >/root/.sshkey/id_rsa.pub + echo ' + - { get_attribute: [ sharedsshkey_cdap, base64private ] } + - |- + ' | base64 -d >/root/.sshkey/id_rsa + chmod 700 /root/.sshkey + chmod 600 /root/.sshkey/* + set -x + CLUSTER_INDEX=02 + CLUSTER_SIZE=7 + CLUSTER_FQDNS= + - { get_property: [ dns_cdap00, fqdn ] } + - ',' + - { get_property: [ dns_cdap01, fqdn ] } + - ',' + - { get_property: [ dns_cdap02, fqdn ] } + - ',' + - { get_property: [ dns_cdap03, fqdn ] } + - ',' + - { get_property: [ dns_cdap04, fqdn ] } + - ',' + - { get_property: [ dns_cdap05, fqdn ] } + - ',' + - { get_property: [ dns_cdap06, fqdn ] } + - "\nCLUSTER_FLOATING_IPS=" + - { get_attribute: [ floatingip_cdap00, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap01, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap02, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap03, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap04, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap05, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap06, floating_ip_address ] } + - "\nCLUSTER_LOCAL_IPS=" + - { get_attribute: [ fixedip_cdap00, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap01, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap02, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap03, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap04, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap05, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap06, fixed_ip_address ] } + - "\nCODE_SOURCE=" + - { get_input: codesource_url } + - "\nCODE_VERSION=" + - { get_input: codesource_version } + - "\n" + - "DATACENTER=" + - { get_input: location_id } + - "\n" + - "REGISTERED_NAME=" + - { get_input: cdap_cluster_name } + - "\n" + - { get_input: vm_init_cdap } + relationships: + - type: cloudify.openstack.server_connected_to_port + target: fixedip_cdap02 + - type: cloudify.openstack.server_connected_to_security_group + target: security_group + - type: cloudify.openstack.server_connected_to_floating_ip + target: floatingip_cdap02 + - type: cloudify.openstack.server_connected_to_keypair + target: key_pair + - type: cloudify.relationships.depends_on + target: hostdeps_cdap + - type: cloudify.relationships.depends_on + target: sharedsshkey_cdap + + fixedip_cdap03: + type: cloudify.openstack.nodes.Port + properties: + port: + extra_dhcp_opts: + - opt_name: 'domain-name' + opt_value: { get_input: location_domain } + openstack_config: *open_conf + relationships: + - type: cloudify.relationships.contained_in + target: private_net + floatingip_cdap03: + type: cloudify.openstack.nodes.FloatingIP + properties: + openstack_config: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + floating_network_name: { get_input: public_net } + dns_cdap03: + type: ccsdk.nodes.dns.arecord + properties: + fqdn: { concat: [ { get_input: location_prefix }, 'cdap03.', { get_input: location_domain } ] } + openstack: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + ip_addresses: + - { get_attribute: [ floatingip_cdap03, floating_ip_address ] } + relationships: + - type: cloudify.relationships.depends_on + target: floatingip_cdap03 + host_cdap03: + type: cloudify.openstack.nodes.Server + properties: + install_agent: false + image: { get_input: ubuntu1604image_id } + flavor: { get_input: flavor_id } + management_network_name: { get_input: private_net } + openstack_config: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + name: { concat: [ { get_input: location_prefix }, 'cdap03' ] } + userdata: + concat: + - |- + #!/bin/sh + mkdir /root/.sshkey + echo ' + - { get_attribute: [ sharedsshkey_cdap, public ] } + - |- + ' >/root/.sshkey/id_rsa.pub + echo ' + - { get_attribute: [ sharedsshkey_cdap, base64private ] } + - |- + ' | base64 -d >/root/.sshkey/id_rsa + chmod 700 /root/.sshkey + chmod 600 /root/.sshkey/* + set -x + CLUSTER_INDEX=03 + CLUSTER_SIZE=7 + CLUSTER_FQDNS= + - { get_property: [ dns_cdap00, fqdn ] } + - ',' + - { get_property: [ dns_cdap01, fqdn ] } + - ',' + - { get_property: [ dns_cdap02, fqdn ] } + - ',' + - { get_property: [ dns_cdap03, fqdn ] } + - ',' + - { get_property: [ dns_cdap04, fqdn ] } + - ',' + - { get_property: [ dns_cdap05, fqdn ] } + - ',' + - { get_property: [ dns_cdap06, fqdn ] } + - "\nCLUSTER_FLOATING_IPS=" + - { get_attribute: [ floatingip_cdap00, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap01, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap02, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap03, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap04, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap05, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap06, floating_ip_address ] } + - "\nCLUSTER_LOCAL_IPS=" + - { get_attribute: [ fixedip_cdap00, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap01, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap02, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap03, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap04, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap05, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap06, fixed_ip_address ] } + - "\nCODE_SOURCE=" + - { get_input: codesource_url } + - "\nCODE_VERSION=" + - { get_input: codesource_version } + - "\n" + - "DATACENTER=" + - { get_input: location_id } + - "\n" + - { get_input: vm_init_cdap } + relationships: + - type: cloudify.openstack.server_connected_to_port + target: fixedip_cdap03 + - type: cloudify.openstack.server_connected_to_security_group + target: security_group + - type: cloudify.openstack.server_connected_to_floating_ip + target: floatingip_cdap03 + - type: cloudify.openstack.server_connected_to_keypair + target: key_pair + - type: cloudify.relationships.depends_on + target: hostdeps_cdap + - type: cloudify.relationships.depends_on + target: sharedsshkey_cdap + fixedip_cdap04: + type: cloudify.openstack.nodes.Port + properties: + port: + extra_dhcp_opts: + - opt_name: 'domain-name' + opt_value: { get_input: location_domain } + openstack_config: *open_conf + relationships: + - type: cloudify.relationships.contained_in + target: private_net + floatingip_cdap04: + type: cloudify.openstack.nodes.FloatingIP + properties: + openstack_config: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + floating_network_name: { get_input: public_net } + dns_cdap04: + type: ccsdk.nodes.dns.arecord + properties: + fqdn: { concat: [ { get_input: location_prefix }, 'cdap04.', { get_input: location_domain } ] } + openstack: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + ip_addresses: + - { get_attribute: [ floatingip_cdap04, floating_ip_address ] } + relationships: + - type: cloudify.relationships.depends_on + target: floatingip_cdap04 + host_cdap04: + type: cloudify.openstack.nodes.Server + properties: + install_agent: false + image: { get_input: ubuntu1604image_id } + flavor: { get_input: flavor_id } + management_network_name: { get_input: private_net } + openstack_config: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + name: { concat: [ { get_input: location_prefix }, 'cdap04' ] } + userdata: + concat: + - |- + #!/bin/sh + mkdir /root/.sshkey + echo ' + - { get_attribute: [ sharedsshkey_cdap, public ] } + - |- + ' >/root/.sshkey/id_rsa.pub + echo ' + - { get_attribute: [ sharedsshkey_cdap, base64private ] } + - |- + ' | base64 -d >/root/.sshkey/id_rsa + chmod 700 /root/.sshkey + chmod 600 /root/.sshkey/* + set -x + CLUSTER_INDEX=04 + CLUSTER_SIZE=7 + CLUSTER_FQDNS= + - { get_property: [ dns_cdap00, fqdn ] } + - ',' + - { get_property: [ dns_cdap01, fqdn ] } + - ',' + - { get_property: [ dns_cdap02, fqdn ] } + - ',' + - { get_property: [ dns_cdap03, fqdn ] } + - ',' + - { get_property: [ dns_cdap04, fqdn ] } + - ',' + - { get_property: [ dns_cdap05, fqdn ] } + - ',' + - { get_property: [ dns_cdap06, fqdn ] } + - "\nCLUSTER_FLOATING_IPS=" + - { get_attribute: [ floatingip_cdap00, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap01, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap02, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap03, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap04, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap05, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap06, floating_ip_address ] } + - "\nCLUSTER_LOCAL_IPS=" + - { get_attribute: [ fixedip_cdap00, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap01, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap02, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap03, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap04, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap05, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap06, fixed_ip_address ] } + - "\nCODE_SOURCE=" + - { get_input: codesource_url } + - "\nCODE_VERSION=" + - { get_input: codesource_version } + - "\n" + - "DATACENTER=" + - { get_input: location_id } + - "\n" + - { get_input: vm_init_cdap } + relationships: + - type: cloudify.openstack.server_connected_to_port + target: fixedip_cdap04 + - type: cloudify.openstack.server_connected_to_security_group + target: security_group + - type: cloudify.openstack.server_connected_to_floating_ip + target: floatingip_cdap04 + - type: cloudify.openstack.server_connected_to_keypair + target: key_pair + - type: cloudify.relationships.depends_on + target: hostdeps_cdap + - type: cloudify.relationships.depends_on + target: sharedsshkey_cdap + fixedip_cdap05: + type: cloudify.openstack.nodes.Port + properties: + port: + extra_dhcp_opts: + - opt_name: 'domain-name' + opt_value: { get_input: location_domain } + openstack_config: *open_conf + relationships: + - type: cloudify.relationships.contained_in + target: private_net + floatingip_cdap05: + type: cloudify.openstack.nodes.FloatingIP + properties: + openstack_config: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + floating_network_name: { get_input: public_net } + dns_cdap05: + type: ccsdk.nodes.dns.arecord + properties: + fqdn: { concat: [ { get_input: location_prefix }, 'cdap05.', { get_input: location_domain } ] } + openstack: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + ip_addresses: + - { get_attribute: [ floatingip_cdap05, floating_ip_address ] } + relationships: + - type: cloudify.relationships.depends_on + target: floatingip_cdap05 + host_cdap05: + type: cloudify.openstack.nodes.Server + properties: + install_agent: false + image: { get_input: ubuntu1604image_id } + flavor: { get_input: flavor_id } + management_network_name: { get_input: private_net } + openstack_config: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + name: { concat: [ { get_input: location_prefix }, 'cdap05' ] } + userdata: + concat: + - |- + #!/bin/sh + mkdir /root/.sshkey + echo ' + - { get_attribute: [ sharedsshkey_cdap, public ] } + - |- + ' >/root/.sshkey/id_rsa.pub + echo ' + - { get_attribute: [ sharedsshkey_cdap, base64private ] } + - |- + ' | base64 -d >/root/.sshkey/id_rsa + chmod 700 /root/.sshkey + chmod 600 /root/.sshkey/* + set -x + CLUSTER_INDEX=05 + CLUSTER_SIZE=7 + CLUSTER_FQDNS= + - { get_property: [ dns_cdap00, fqdn ] } + - ',' + - { get_property: [ dns_cdap01, fqdn ] } + - ',' + - { get_property: [ dns_cdap02, fqdn ] } + - ',' + - { get_property: [ dns_cdap03, fqdn ] } + - ',' + - { get_property: [ dns_cdap04, fqdn ] } + - ',' + - { get_property: [ dns_cdap05, fqdn ] } + - ',' + - { get_property: [ dns_cdap06, fqdn ] } + - "\nCLUSTER_FLOATING_IPS=" + - { get_attribute: [ floatingip_cdap00, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap01, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap02, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap03, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap04, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap05, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap06, floating_ip_address ] } + - "\nCLUSTER_LOCAL_IPS=" + - { get_attribute: [ fixedip_cdap00, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap01, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap02, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap03, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap04, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap05, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap06, fixed_ip_address ] } + - "\nCODE_SOURCE=" + - { get_input: codesource_url } + - "\nCODE_VERSION=" + - { get_input: codesource_version } + - "\n" + - "DATACENTER=" + - { get_input: location_id } + - "\n" + - { get_input: vm_init_cdap } + relationships: + - type: cloudify.openstack.server_connected_to_port + target: fixedip_cdap05 + - type: cloudify.openstack.server_connected_to_security_group + target: security_group + - type: cloudify.openstack.server_connected_to_floating_ip + target: floatingip_cdap05 + - type: cloudify.openstack.server_connected_to_keypair + target: key_pair + - type: cloudify.relationships.depends_on + target: hostdeps_cdap + - type: cloudify.relationships.depends_on + target: sharedsshkey_cdap + fixedip_cdap06: + type: cloudify.openstack.nodes.Port + properties: + port: + extra_dhcp_opts: + - opt_name: 'domain-name' + opt_value: { get_input: location_domain } + openstack_config: *open_conf + relationships: + - type: cloudify.relationships.contained_in + target: private_net + floatingip_cdap06: + type: cloudify.openstack.nodes.FloatingIP + properties: + openstack_config: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + floating_network_name: { get_input: public_net } + dns_cdap06: + type: ccsdk.nodes.dns.arecord + properties: + fqdn: { concat: [ { get_input: location_prefix }, 'cdap06.', { get_input: location_domain } ] } + openstack: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + ip_addresses: + - { get_attribute: [ floatingip_cdap06, floating_ip_address ] } + relationships: + - type: cloudify.relationships.depends_on + target: floatingip_cdap06 + host_cdap06: + type: cloudify.openstack.nodes.Server + properties: + install_agent: false + image: { get_input: ubuntu1604image_id } + flavor: { get_input: flavor_id } + management_network_name: { get_input: private_net } + openstack_config: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + name: { concat: [ { get_input: location_prefix }, 'cdap06' ] } + userdata: + concat: + - |- + #!/bin/sh + mkdir /root/.sshkey + echo ' + - { get_attribute: [ sharedsshkey_cdap, public ] } + - |- + ' >/root/.sshkey/id_rsa.pub + echo ' + - { get_attribute: [ sharedsshkey_cdap, base64private ] } + - |- + ' | base64 -d >/root/.sshkey/id_rsa + chmod 700 /root/.sshkey + chmod 600 /root/.sshkey/* + set -x + CLUSTER_INDEX=06 + CLUSTER_SIZE=7 + CLUSTER_FQDNS= + - { get_property: [ dns_cdap00, fqdn ] } + - ',' + - { get_property: [ dns_cdap01, fqdn ] } + - ',' + - { get_property: [ dns_cdap02, fqdn ] } + - ',' + - { get_property: [ dns_cdap03, fqdn ] } + - ',' + - { get_property: [ dns_cdap04, fqdn ] } + - ',' + - { get_property: [ dns_cdap05, fqdn ] } + - ',' + - { get_property: [ dns_cdap06, fqdn ] } + - "\nCLUSTER_FLOATING_IPS=" + - { get_attribute: [ floatingip_cdap00, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap01, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap02, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap03, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap04, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap05, floating_ip_address ] } + - ',' + - { get_attribute: [ floatingip_cdap06, floating_ip_address ] } + - "\nCLUSTER_LOCAL_IPS=" + - { get_attribute: [ fixedip_cdap00, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap01, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap02, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap03, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap04, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap05, fixed_ip_address ] } + - ',' + - { get_attribute: [ fixedip_cdap06, fixed_ip_address ] } + - "\nCODE_SOURCE=" + - { get_input: codesource_url } + - "\nCODE_VERSION=" + - { get_input: codesource_version } + - "\n" + - "DATACENTER=" + - { get_input: location_id } + - "\n" + - { get_input: vm_init_cdap } + relationships: + - type: cloudify.openstack.server_connected_to_port + target: fixedip_cdap06 + - type: cloudify.openstack.server_connected_to_security_group + target: security_group + - type: cloudify.openstack.server_connected_to_floating_ip + target: floatingip_cdap06 + - type: cloudify.openstack.server_connected_to_keypair + target: key_pair + - type: cloudify.relationships.depends_on + target: hostdeps_cdap + - type: cloudify.relationships.depends_on + target: sharedsshkey_cdap diff --git a/reference_templates/centos_vm.yaml-template b/reference_templates/centos_vm.yaml-template new file mode 100644 index 0000000..aa3bdb4 --- /dev/null +++ b/reference_templates/centos_vm.yaml-template @@ -0,0 +1,243 @@ +# -*- indent-tabs-mode: nil -*- # vi: set expandtab: +# +# ============LICENSE_START========================================== +# org.onap.dcae +# =================================================================== +# Copyright © 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============================================ +# +# ECOMP and OpenECOMP are trademarks +# and service marks of AT&T Intellectual Property. +# + +tosca_definitions_version: cloudify_dsl_1_3 + +imports: + - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml + - http://www.getcloudify.org/spec/openstack-plugin/1.4/plugin.yaml + - http://www.getcloudify.org/spec/fabric-plugin/1.4.1/plugin.yaml + - types/dns_types.yaml + - types/sshkey_types.yaml + +inputs: + centos7image_id: + type: string + ubuntu1604image_id: + type: string + flavor_id: + type: string + security_group: + type: string + public_net: + type: string + private_net: + type: string + openstack: {} + keypair: + type: string + location_prefix: + type: string + location_domain: + type: string + key_filename: + type: string + codesource_url: + type: string + codesource_version: + type: string + cname: + type: string + default: dcae-orcl + datacenter: + type: string + vm_init_clmg_00: + type: string + default: |- + #!/bin/sh + set -x + DATACENTER= + vm_init_clmg_01: + type: string + default: | + CONSULVER=0.8.3 + CONSULNAME=consul_${CONSULVER}_linux_amd64 + MYIP=`curl -Ss http://169.254.169.254/2009-04-04/meta-data/local-ipv4` + MYNAME=`hostname` + if [ ! -z "$(echo $MYNAME |grep '.')" ]; then MYNAME="$(echo $MYNAME | cut -f1 -d '.')"; fi + echo >>/etc/hosts + echo $MYIP $MYNAME >>/etc/hosts + mkdir -p /opt/consul/config /opt/consul/data /opt/consul/bin + yum install -y unzip + # Download Consul + curl -Ss https://releases.hashicorp.com/consul/${CONSULVER}/${CONSULNAME}.zip > ${CONSULNAME}.zip + unzip -d /opt/consul/bin ${CONSULNAME}.zip + rm ${CONSULNAME}.zip + chmod +x /opt/consul/bin/consul + cat < /opt/consul/config/consul.json + { + "bind_addr" : "0.0.0.0", + "client_addr" : "0.0.0.0", + "data_dir" : "/opt/consul/data", + "datacenter": "$DATACENTER", + "rejoin_after_leave": true, + "http_api_response_headers": { + "Access-Control-Allow-Origin" : "*" + }, + "server": false, + "ui": false, + "enable_syslog": true, + "log_level": "info" + } + EOF + cat < /lib/systemd/system/consul.service + [Unit] + Description=Consul + Requires=network-online.target + After=network.target + [Service] + Type=simple + ExecStart=/opt/consul/bin/consul agent -config-dir=/opt/consul/config + ExecReload=/bin/kill -HUP \$MAINPID + [Install] + WantedBy=multi-user.target + EOF + systemctl enable consul + systemctl start consul + yum install -y python-psycopg2 + +node_templates: + key_pair: + type: cloudify.openstack.nodes.KeyPair + properties: + private_key_path: { get_input: key_filename } + use_external_resource: True + resource_id: { get_input: keypair } + openstack_config: &open_conf + get_input: openstack + private_net: + type: cloudify.openstack.nodes.Network + properties: + use_external_resource: True + resource_id: { get_input: private_net } + openstack_config: *open_conf + security_group: + type: cloudify.openstack.nodes.SecurityGroup + properties: + use_external_resource: True + resource_id: { get_input: security_group } + openstack_config: *open_conf + fixedip_vm00: + type: cloudify.openstack.nodes.Port + properties: + port: + extra_dhcp_opts: + - opt_name: 'domain-name' + opt_value: { get_input: location_domain } + openstack_config: *open_conf + relationships: + - type: cloudify.relationships.contained_in + target: private_net + floatingip_vm00: + type: cloudify.openstack.nodes.FloatingIP + properties: + openstack_config: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + floating_network_name: { get_input: public_net } + dns_vm00: + type: ccsdk.nodes.dns.arecord + properties: + fqdn: { concat: [ { get_input: location_prefix }, 'orcl00.', { get_input: location_domain } ] } + openstack: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + ip_addresses: + - { get_attribute: [ floatingip_vm00, floating_ip_address ] } + relationships: + - type: cloudify.relationships.depends_on + target: floatingip_vm00 + dns_cm: + type: ccsdk.nodes.dns.arecord + properties: + fqdn: { concat: [ 'cloudify-manager-', { get_input: datacenter}, '.', { get_input: location_domain } ] } + openstack: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + ip_addresses: + - { get_attribute: [ floatingip_vm00, floating_ip_address ] } + relationships: + - type: cloudify.relationships.depends_on + target: floatingip_vm00 + dns_cname: + type: ccsdk.nodes.dns.cnamerecord + properties: + fqdn: { concat: [ { get_input: cname }, '.', { get_input: location_domain } ] } + openstack: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + cname: { get_property: [ dns_vm00, fqdn ] } + relationships: + - type: cloudify.relationships.depends_on + target: dns_vm00 + host_vm00: + type: cloudify.openstack.nodes.Server + properties: + install_agent: false + image: { get_input: centos7image_id } + flavor: { get_input: flavor_id } + management_network_name: { get_input: private_net } + openstack_config: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + name: { concat: [ { get_input: location_prefix }, 'orcl00' ] } + userdata: + concat: + - { get_input: vm_init_clmg_00 } + - { get_input: datacenter } + - |+ + + - { get_input: vm_init_clmg_01 } + relationships: + - type: cloudify.openstack.server_connected_to_port + target: fixedip_vm00 + - type: cloudify.openstack.server_connected_to_security_group + target: security_group + - type: cloudify.openstack.server_connected_to_floating_ip + target: floatingip_vm00 + - type: cloudify.openstack.server_connected_to_keypair + target: key_pair + - type: cloudify.relationships.depends_on + target: dns_vm00 + - type: cloudify.relationships.depends_on + target: dns_cm + +outputs: + public_ip: + value: { get_attribute: [floatingip_vm00, floating_ip_address] } diff --git a/reference_templates/config_binding_service.yaml-template b/reference_templates/config_binding_service.yaml-template new file mode 100644 index 0000000..28dfb43 --- /dev/null +++ b/reference_templates/config_binding_service.yaml-template @@ -0,0 +1,62 @@ +# -*- indent-tabs-mode: nil -*- # vi: set expandtab: +# +# ============LICENSE_START==================================================== +# ============================================================================= +# 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 + +description: > + This blueprint installs the config binding service + +imports: + - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dockerplugin/2/dockerplugin_types.yaml + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml +inputs: + location_id: + type: string + default: "" + + docker_host_override: + description: Target docker host to deploy applications to + default: 'platform_dockerhost' + +node_templates: + # Config binding service + service-config-binding: + type: dcae.nodes.DockerContainerForPlatforms + properties: + name: 'config_binding_service' + host_port: 10000 + container_port: 10000 + image: "{{ ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_releases }}/onap/org.onap.dcaegen2.platform.configbinding:2.1.5" + docker_config: + healthcheck: + type: "http" + endpoint: "/healthcheck" + + relationships: + - type: dcae.relationships.component_contained_in + target: docker_host + + docker_host: + type: dcae.nodes.SelectedDockerHost + properties: + location_id: + { get_input: location_id } + docker_host_override: + { get_input: docker_host_override } diff --git a/reference_templates/consul_cluster.yaml-template b/reference_templates/consul_cluster.yaml-template new file mode 100644 index 0000000..a4ae89e --- /dev/null +++ b/reference_templates/consul_cluster.yaml-template @@ -0,0 +1,384 @@ +# -*- indent-tabs-mode: nil -*- # vi: set expandtab: +# +# ============LICENSE_START========================================== +# org.onap.dcae +# =================================================================== +# Copyright © 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============================================ +# +# ECOMP and OpenECOMP are trademarks +# and service marks of AT&T Intellectual Property. +# + +tosca_definitions_version: cloudify_dsl_1_3 + +imports: + - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml + - http://www.getcloudify.org/spec/openstack-plugin/1.4/plugin.yaml + - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/dnsdesig/dns_types.yaml" + - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/sshkeyshare/sshkey_types.yaml" + +inputs: + centos7image_id: + type: string + ubuntu1604image_id: + type: string + flavor_id: + type: string + security_group: + type: string + public_net: + type: string + private_net: + type: string + openstack: {} + keypair: + type: string + location_prefix: + type: string + location_domain: + type: string + key_filename: + type: string + codesource_url: + type: string + codesource_version: + type: string + datacenter: + type: string + vm_init_cnsl_00: + type: string + default: |- + #!/bin/sh + set -x + DATACENTER= + vm_init_cnsl_01: + type: string + default: | + CONSULVER=0.8.3 + CONSULNAME=consul_${CONSULVER}_linux_amd64 + MYIP=`wget -qO- http://169.254.169.254/2009-04-04/meta-data/local-ipv4` + MYNAME=`hostname` + echo >>/etc/hosts + echo $MYIP $MYNAME >>/etc/hosts + mkdir -p /opt/consul/config /opt/consul/data /opt/consul/bin + + # Download Consul + apt-get update + apt-get install unzip + wget https://releases.hashicorp.com/consul/${CONSULVER}/${CONSULNAME}.zip + unzip -d /opt/consul/bin ${CONSULNAME}.zip + rm ${CONSULNAME}.zip + chmod +x /opt/consul/bin/consul + + # NOTE: Not using port 80 for http to avoid port collision of user facing services + # particularly for more large scale deployments of Consul. + cat < /opt/consul/config/consul.json + { + "bind_addr" : "$MYIP", + "client_addr" : "0.0.0.0", + "bootstrap_expect" : 3, + "data_dir" : "/opt/consul/data", + "datacenter": "$DATACENTER", + "http_api_response_headers": { + "Access-Control-Allow-Origin" : "*" + }, + "server": true, + "ui": true, + "enable_syslog": true, + "log_level": "info", + "ports": { + "dns": 53 + } + } + EOF + cat < /lib/systemd/system/consul.service + [Unit] + Description=Consul + Requires=network-online.target + After=network.target + [Service] + Type=simple + ExecStart=/opt/consul/bin/consul agent -config-dir=/opt/consul/config + ExecReload=/bin/kill -HUP \$MAINPID + [Install] + WantedBy=multi-user.target + EOF + systemctl enable consul + systemctl start consul +node_templates: + key_pair: + type: cloudify.openstack.nodes.KeyPair + properties: + private_key_path: { get_input: key_filename } + use_external_resource: True + resource_id: { get_input: keypair } + openstack_config: &open_conf + get_input: openstack + private_net: + type: cloudify.openstack.nodes.Network + properties: + use_external_resource: True + resource_id: { get_input: private_net } + openstack_config: *open_conf + security_group: + type: cloudify.openstack.nodes.SecurityGroup + properties: + use_external_resource: True + resource_id: { get_input: security_group } + openstack_config: *open_conf + fixedip_cnsl00: + type: cloudify.openstack.nodes.Port + properties: + port: + extra_dhcp_opts: + - opt_name: 'domain-name' + opt_value: { get_input: location_domain } + openstack_config: *open_conf + relationships: + - type: cloudify.relationships.contained_in + target: private_net + floatingip_cnsl00: + type: cloudify.openstack.nodes.FloatingIP + properties: + openstack_config: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + floating_network_name: { get_input: public_net } + dns_cnsl00: + type: ccsdk.nodes.dns.arecord + properties: + fqdn: { concat: [ { get_input: location_prefix }, 'cnsl00.', { get_input: location_domain } ] } + openstack: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + ip_addresses: + - { get_attribute: [ floatingip_cnsl00, floating_ip_address ] } + relationships: + - type: cloudify.relationships.depends_on + target: floatingip_cnsl00 + host_cnsl00: + type: cloudify.openstack.nodes.Server + properties: + install_agent: false + image: { get_input: ubuntu1604image_id } + flavor: { get_input: flavor_id } + management_network_name: { get_input: private_net } + openstack_config: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + name: { concat: [ { get_input: location_prefix }, 'cnsl00' ] } + userdata: + concat: + - { get_input: vm_init_cnsl_00 } + - { get_input: datacenter } + - |+ + + - { get_input: vm_init_cnsl_01 } + - concat: + - 'until /opt/consul/bin/consul join ' + - { get_attribute: [host_cnsl01, ip] } + - '; do sleep 5; done; ' + - concat: + - 'until /opt/consul/bin/consul join ' + - { get_attribute: [host_cnsl02, ip]} + - '; do sleep 5; done' + + relationships: + - type: cloudify.openstack.server_connected_to_port + target: fixedip_cnsl00 + - type: cloudify.openstack.server_connected_to_security_group + target: security_group + - type: cloudify.openstack.server_connected_to_floating_ip + target: floatingip_cnsl00 + - type: cloudify.openstack.server_connected_to_keypair + target: key_pair + - type: cloudify.relationships.depends_on + target: dns_cnsl00 + - type: cloudify.relationships.depends_on + target: host_cnsl01 + - type: cloudify.relationships.depends_on + target: host_cnsl02 + fixedip_cnsl01: + type: cloudify.openstack.nodes.Port + properties: + port: + extra_dhcp_opts: + - opt_name: 'domain-name' + opt_value: { get_input: location_domain } + openstack_config: *open_conf + relationships: + - type: cloudify.relationships.contained_in + target: private_net + floatingip_cnsl01: + type: cloudify.openstack.nodes.FloatingIP + properties: + openstack_config: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + floating_network_name: { get_input: public_net } + dns_cnsl01: + type: ccsdk.nodes.dns.arecord + properties: + fqdn: { concat: [ { get_input: location_prefix }, 'cnsl01.', { get_input: location_domain } ] } + openstack: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + ip_addresses: + - { get_attribute: [ floatingip_cnsl01, floating_ip_address ] } + relationships: + - type: cloudify.relationships.depends_on + target: floatingip_cnsl01 + host_cnsl01: + type: cloudify.openstack.nodes.Server + properties: + install_agent: false + image: { get_input: ubuntu1604image_id } + flavor: { get_input: flavor_id } + management_network_name: { get_input: private_net } + openstack_config: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + name: { concat: [ { get_input: location_prefix }, 'cnsl01' ] } + userdata: + concat: + - { get_input: vm_init_cnsl_00 } + - { get_input: datacenter } + - |+ + + - { get_input: vm_init_cnsl_01 } + relationships: + - type: cloudify.openstack.server_connected_to_port + target: fixedip_cnsl01 + - type: cloudify.openstack.server_connected_to_security_group + target: security_group + - type: cloudify.openstack.server_connected_to_floating_ip + target: floatingip_cnsl01 + - type: cloudify.openstack.server_connected_to_keypair + target: key_pair + - type: cloudify.relationships.depends_on + target: dns_cnsl01 + fixedip_cnsl02: + type: cloudify.openstack.nodes.Port + properties: + port: + extra_dhcp_opts: + - opt_name: 'domain-name' + opt_value: { get_input: location_domain } + openstack_config: *open_conf + relationships: + - type: cloudify.relationships.contained_in + target: private_net + floatingip_cnsl02: + type: cloudify.openstack.nodes.FloatingIP + properties: + openstack_config: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + floating_network_name: { get_input: public_net } + dns_cnsl02: + type: ccsdk.nodes.dns.arecord + properties: + fqdn: { concat: [ { get_input: location_prefix }, 'cnsl02.', { get_input: location_domain } ] } + openstack: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + ip_addresses: + - { get_attribute: [ floatingip_cnsl02, floating_ip_address ] } + relationships: + - type: cloudify.relationships.depends_on + target: floatingip_cnsl02 + dns_cluster: + type: ccsdk.nodes.dns.arecord + properties: + fqdn: { concat: [ 'dcae-cnsl.', { get_input: location_domain } ] } + openstack: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + ip_addresses: + - { get_attribute: [ floatingip_cnsl00, floating_ip_address ] } + - { get_attribute: [ floatingip_cnsl01, floating_ip_address ] } + - { get_attribute: [ floatingip_cnsl02, floating_ip_address ] } + + relationships: + - type: cloudify.relationships.depends_on + target: floatingip_cnsl00 + - type: cloudify.relationships.depends_on + target: floatingip_cnsl01 + - type: cloudify.relationships.depends_on + target: floatingip_cnsl02 + host_cnsl02: + type: cloudify.openstack.nodes.Server + properties: + install_agent: false + image: { get_input: ubuntu1604image_id } + flavor: { get_input: flavor_id } + management_network_name: { get_input: private_net } + openstack_config: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + name: { concat: [ { get_input: location_prefix }, 'cnsl02' ] } + userdata: + concat: + - { get_input: vm_init_cnsl_00 } + - { get_input: datacenter } + - |+ + + - { get_input: vm_init_cnsl_01 } + relationships: + - type: cloudify.openstack.server_connected_to_port + target: fixedip_cnsl02 + - type: cloudify.openstack.server_connected_to_security_group + target: security_group + - type: cloudify.openstack.server_connected_to_floating_ip + target: floatingip_cnsl02 + - type: cloudify.openstack.server_connected_to_keypair + target: key_pair + - type: cloudify.relationships.depends_on + target: dns_cnsl02 + +outputs: + public_ip: + value: { get_attribute: [floatingip_cnsl00, floating_ip_address] } diff --git a/reference_templates/heartbeat-service.yaml-template b/reference_templates/heartbeat-service.yaml-template new file mode 100644 index 0000000..2654c71 --- /dev/null +++ b/reference_templates/heartbeat-service.yaml-template @@ -0,0 +1,61 @@ +tosca_definitions_version: cloudify_dsl_1_3 +imports: +- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dockerplugin/2/dockerplugin_types.yaml" +- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml" +inputs: + dcae_CL_publish_url: + type: string + default: "http://10.0.11.1:3904/events/unauthenticated.DCAE_CL_OUTPUT" + ves_heartbeat_url: + type: string + default: "http://10.0.11.1:3904/events/unauthenticated.SEC_HEARTBEAT_OUTPUT" + docker_host_override: + type: string + default: "component_dockerhost" + dh_location_id: + type: string + default: "zone1" + tag_version: + type: string + default: "nexus3.onap.org:10001/onap/org.onap.dcaegen2.platform.heartbeat:2.0" + +node_templates: + docker_service_host: + type: dcae.nodes.SelectedDockerHost + properties: + docker_host_override: + get_input: docker_host_override + location_id: + get_input: dh_location_id + heartbeatService: + type: dcae.nodes.DockerContainerForComponentsUsingDmaap + properties: + application_config: + heartbeat_config: '{"vnfs":[{"heartbeatcountmissed":3, "heartbeatinterval": 60, "closedLoopControlName":"ControlLoopEvent1"},{"heartbeatcountmissed":3, "heartbeatinterval": 60, "closedLoopControlName":"ControlLoopEvent1"},{"heartbeatcountmissed":3, "heartbeatinterval": 60, "closedLoopControlName":"ControlLoopEvent1"}]}' + streams_publishes: + dcae_cl_out: + dmaap_info: + topic_url: + get_input: dcae_CL_publish_url + type: message_router + streams_subscribes: + heartbeat_input: + dmaap_info: + topic_url: + get_input: ves_heartbeat_url + type: message_router + docker_config: + healthcheck: + script: /app/bin/check_health.py + interval: 18s + timeout: 30s + type: docker + image: + get_input: tag_version + location_id: + get_input: dh_location_id + service_component_type: dcaegen2-services-heartbeat + relationships: + - target: docker_service_host + type: dcae.relationships.component_contained_in + diff --git a/reference_templates/holmes-engine.yaml-template b/reference_templates/holmes-engine.yaml-template new file mode 100644 index 0000000..4661299 --- /dev/null +++ b/reference_templates/holmes-engine.yaml-template @@ -0,0 +1,98 @@ +tosca_definitions_version: cloudify_dsl_1_3 +imports: +- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dockerplugin/2/dockerplugin_types.yaml" +- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dcaepolicyplugin/1/dcaepolicyplugin_types.yaml" +- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml" +- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/pgaas/1.1.0/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" + docker_host_override: + type: string + default: "component_dockerhost" + dh_location_id: + type: string + default: "zone1" + msb_hostname: + type: string + default: "" + location_domain: + type: string + location_prefix: + type: string + pgaas_cluster_name: + type: string + # use the single-VM PG instance + default: pgvm + database_name: + type: string + default: holmes +node_templates: + pgaasvm: + type: dcae.nodes.pgaas.database + properties: + writerfqdn: { concat: [ { get_input: location_prefix }, '-', { get_input: pgaas_cluster_name }, '-write.', { get_input: location_domain } ] } + name: { get_input: database_name } + use_existing: true + docker_holmes_host: + type: dcae.nodes.SelectedDockerHost + properties: + docker_host_override: + get_input: docker_host_override + location_id: + get_input: dh_location_id + holmesengine: + type: dcae.nodes.DockerContainerForComponentsUsingDmaap + 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:9102 + image: "{{ ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_releases }}/onap/holmes/engine-management:v1.0.0" + location_id: + get_input: dh_location_id + service_component_type: dcae-analytics-holmes-engine-management + relationships: + - type: cloudify.relationships.depends_on + target: pgaasvm + - target: docker_holmes_host + type: dcae.relationships.component_contained_in + diff --git a/reference_templates/holmes-rules.yaml-template b/reference_templates/holmes-rules.yaml-template new file mode 100644 index 0000000..dc0ab7d --- /dev/null +++ b/reference_templates/holmes-rules.yaml-template @@ -0,0 +1,81 @@ +tosca_definitions_version: cloudify_dsl_1_3 +imports: +- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dockerplugin/2/dockerplugin_types.yaml" +- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dcaepolicyplugin/1/dcaepolicyplugin_types.yaml" +- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml" +- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/pgaas/1.1.0/pgaas_types.yaml" +inputs: + docker_host_override: + type: string + default: "component_dockerhost" + dh_location_id: + type: string + default: "zone1" + msb_hostname: + type: string + default: "" + location_domain: + type: string + location_prefix: + type: string + pgaas_cluster_name: + type: string + # use the single-VM PG instance + default: pgvm + database_name: + type: string + default: holmes +node_templates: + pgaasvm: + type: dcae.nodes.pgaas.database + properties: + writerfqdn: { concat: [ { get_input: location_prefix }, '-', { get_input: pgaas_cluster_name }, '-write.', { get_input: location_domain } ] } + name: { get_input: database_name } + docker_holmes_host: + type: dcae.nodes.SelectedDockerHost + properties: + docker_host_override: + get_input: docker_host_override + location_id: + get_input: dh_location_id + holmesrules: + type: dcae.nodes.DockerContainerForComponentsUsingDmaap + 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:9101 + image: "{{ ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_releases }}/onap/holmes/rule-management:v1.0.0" + location_id: + get_input: dh_location_id + service_component_type: dcae-analytics-holmes-rule-management + relationships: + - type: cloudify.relationships.depends_on + target: pgaasvm + - target: docker_holmes_host + type: dcae.relationships.component_contained_in diff --git a/reference_templates/inventory.yaml-template b/reference_templates/inventory.yaml-template new file mode 100644 index 0000000..c427f8c --- /dev/null +++ b/reference_templates/inventory.yaml-template @@ -0,0 +1,196 @@ +# -*- 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 + +description: > + This blueprint is used to install and to uninstall DCAE inventory and DCAE service change + handler which are platform services. These applications are Docker containers. This blueprint + depends upon the deployment of a Docker host and the deployment of a central postgres that is + registered with Consul. + +imports: + - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dockerplugin/2/dockerplugin_types.yaml + +inputs: + + location_id: + description: Location of where to deploy to + + docker_host_override: + description: Target docker host to deploy applications to + sdc_address: + description: SDC host + sdc_uri: + description: SDC url + sdc_msg_bus_address: + description: Message router hostname that SDC will send distribution events through + sdc_user: + description: SDC username + sdc_password: + description: SDC password + sdc_environment_name: + description: SDC environment name + sdc_use_secure_https: + description: Boolean to toggle whether to do certificate validation for https calls to SDC API + type: boolean + default: false + sdc_use_https_dmaap: + description: Boolean to toggle whether to use https for calls to message router API + type: boolean + default: false + + postgres_user_inventory: + description: Postgres user for inventory + postgres_password_inventory: + description: Postgres password for inventory + + service_change_handler_image: + description: Full uri to service change handler Docker image + inventory_image: + description: Full uri to inventory Docker image + +node_templates: + + service-change-handler: + type: dcae.nodes.DockerContainerForPlatforms + properties: + name: + "service-change-handler" + application_config: + asdcDistributionClient: + asdcAddress: { get_input: sdc_address } + asdcUri: { get_input: sdc_uri } + msgBusAddress: { get_input: sdc_msg_bus_address } + user: { get_input: sdc_user } + password: { get_input: sdc_password } + pollingInterval: 20 + pollingTimeout: 20 + consumerGroup: dcae + consumerId: dcae-sch + environmentName: { get_input: sdc_environment_name } + keyStorePath: + keyStorePassword: + activateServerTLSAuth: { get_input: sdc_use_secure_https } + useHttpsWithDmaap: { get_input: sdc_use_https_dmaap } + isFilterInEmptyResources: false + dcaeInventoryClient: + uri: http://inventory:8080 + docker_config: + healthcheck: + type: "docker" + interval: "30s" + timeout: "3s" + script: "/opt/health.sh" + image: + { get_input: service_change_handler_image } + relationships: + - type: cloudify.relationships.depends_on + target: inventory + - type: dcae.relationships.component_contained_in + target: docker_host + + inventory: + type: dcae.nodes.DockerContainerForPlatforms + properties: + name: + "inventory" + application_config: + database: + driverClass: org.postgresql.Driver + user: { get_input: postgres_user_inventory } + password: { get_input: postgres_password_inventory } + # NOTE: The database name here has been changed to the default "postgres" database + # to use the private postgres instance and not the central postgres database. + url: jdbc:postgresql://pstg-write:5432/postgres + properties: + charSet: UTF-8 + maxWaitForConnection: 1s + validationQuery: "/* MyService Health Check */ SELECT 1" + minSize: 2 + maxSize: 8 + initialSize: 2 + checkConnectionWhileIdle: false + evictionInterval: 10s + minIdleTime: 1 minute + databusControllerConnection: + host: databus-controller-hostname + port: 8443 + mechId: + password: + required: false + httpClient: + minThreads: 1 + maxThreads: 128 + gzipEnabled: false + gzipEnabledForRequests: false + timeout: 5000milliseconds + connectionTimeout: 5000milliseconds + docker_config: + healthcheck: + type: "http" + interval: "30s" + timeout: "3s" + endpoint: "/dcae-service-types" + image: + { get_input: inventory_image } + host_port: + 8080 + container_port: + 8080 + relationships: + - type: dcae.relationships.component_contained_in + target: docker_host + - type: cloudify.relationships.depends_on + target: postgres + + postgres: + type: dcae.nodes.DockerContainer + properties: + name: + "pstg-write" + image: + "postgres:9.5.2" + relationships: + - type: dcae.relationships.component_contained_in + target: docker_host + interfaces: + cloudify.interfaces.lifecycle: + start: + inputs: + envs: + PGDATA: + "/var/lib/postgresql/data/pgdata" + POSTGRES_PASSWORD: + { get_input: postgres_password_inventory } + SERVICE_NAME: + "pstg-write" + ports: + - "5432:5432" + + docker_host: + type: dcae.nodes.SelectedDockerHost + properties: + location_id: + { get_input: location_id } + docker_host_override: + { get_input: docker_host_override } diff --git a/reference_templates/k8s-dashboard.yaml-template b/reference_templates/k8s-dashboard.yaml-template new file mode 100644 index 0000000..1d0fa10 --- /dev/null +++ b/reference_templates/k8s-dashboard.yaml-template @@ -0,0 +1,119 @@ +# ============LICENSE_START==================================================== +# org.onap.dcae +# ============================================================================= +# Copyright (c) 2019 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.4.13/k8splugin_types.yaml" +- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/pgaas/1.1.0/pgaas_types.yaml" + +inputs: + database_cluster_name: + type: string + default: 'dcae-pg-primary.onap' + database_cluster_fqdn: + type: string + default: 'dcae-pg-primary.onap.svc.cluster.local' + database_name: + type: string + default: 'dashboard_pg' + postgres_port: + description: 'Postgres port for dashboard' + default: '5432' + dashboard_docker_image: + description: 'Docker image for dashboard' + default: 'nexus3.onap.org:10001/onap/org.onap.ccsdk.dashboard.ccsdk-app-os:1.1.0-SNAPSHOT-latest' + cloudify_ip: + type: string + default: 'dcae-cloudify-manager' + cloudify_user: + type: string + default: 'admin' + cloudify_password: + type: string + default: 'admin' + consul_url: + type: string + default: 'consul-server-ui' + external_port: + type: string + description: Kubernetes node port for standard http + default: "30418" + external_tls_port: + type: string + description: Kubernetes node port for standard https + default: "30419" + replicas: + type: integer + description: number of instances + default: 1 +node_templates: + pgaasdb: + type: dcae.nodes.pgaas.database + properties: + writerfqdn: { get_input: database_cluster_name } + name: { get_input: database_name } + dashboard_deployment: + type: dcae.nodes.ContainerizedPlatformComponent + interfaces: + cloudify.interfaces.lifecycle: + start: + inputs: + envs: + postgres_ip: + { get_input: database_cluster_fqdn } + postgres_db_name: + { get_input: database_name } + postgres_password_dashboard: + { get_attribute: [ pgaasdb, admin, password ] } + postgres_user_dashboard: + { get_attribute: [ pgaasdb, admin, user ] } + postgres_port: { get_input: postgres_port } + cloudify_user: { get_input: cloudify_user } + cloudify_password: { get_input: cloudify_password } + #consul_url: http://consul-server.onap.svc.cluster.local + consul_url: + concat: ["http://", { get_input: consul_url },":8500"] + #cfy_url: http://dcae-cloudify-manager:8080 + cfy_url: + concat: ["http://", { get_input: cloudify_ip },"/api/v3.1"] + inventory_url: http://inventory:8080 + dhandler_url: https://deployment-handler:8443 + ports: + - concat: ["8080:", { get_input: external_port }] + - concat: ["8443:", { get_input: external_tls_port }] + properties: + name: + "dcae-dashboard" + image: + { get_input: dashboard_docker_image } + replicas: {get_input: replicas} + dns_name: 'dcae-dashboard' + tls_info: + cert_directory: '/usr/local/share/ca-certificates/' + use_tls: true + docker_config: + healthcheck: + endpoint: /ccsdk-app/health + interval: 15s + timeout: 1s + type: http + relationships: + - type: cloudify.relationships.depends_on + target: pgaasdb + diff --git a/reference_templates/k8s-datafile-collector.yaml-template b/reference_templates/k8s-datafile-collector.yaml-template new file mode 100644 index 0000000..2de0a24 --- /dev/null +++ b/reference_templates/k8s-datafile-collector.yaml-template @@ -0,0 +1,124 @@ +# -*- indent-tabs-mode: nil -*- # vi: set expandtab: +# +# ============LICENSE_START==================================================== +# ============================================================================= +# Copyright (c) 2018-2019 AT&T Intellectual Property, 2019 Nordix Foundation. 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" + - "https://nexus.onap.org/service/local/repositories/raw/content/org.onap.dcaegen2.platform.plugins/R4/k8splugin/1.4.13/k8splugin_types.yaml" + - "https://nexus.onap.org/service/local/repositories/raw/content/org.onap.ccsdk.platform.plugins/type_files/dmaap/dmaap.yaml" + +inputs: + dmaap_mr_host: + type: string + description: dmaap messagerouter host + default: message-router.onap.svc.cluster.local + dmaap_mr_port: + type: integer + description: dmaap messagerouter port + default: 3904 + dmaap_mr_protocol: + type: string + description: dmaap messagerouter protocol + default: "http" + tag_version: + type: string + description: DFC image tag/version + default: "nexus3.onap.org:10001/onap/org.onap.dcaegen2.collectors.datafile.datafile-app-server:1.2.0" + replicas: + type: integer + description: number of instances + default: 1 + secureEnableCert: + type: boolean + description: enable certificate base connection with PNF and DMaap + default: false + feedName: + type: string + description: feed name for dmaap producerconfiguration + default: "bulk_pm_feed" + feedDescription: + type: string + default: "Feed for Bulk PM files" + +node_templates: + bulk_pm_feed: + type: ccsdk.nodes.Feed + properties: + feed_name: { get_input: feedName } + feed_description: { get_input: feedDescription } + + datafile-collector: + type: dcae.nodes.ContainerizedServiceComponentUsingDmaap + + relationships: + - type: ccsdk.relationships.publish_files + target: bulk_pm_feed + + interfaces: + cloudify.interfaces.lifecycle: + start: + inputs: + ports: + - concat: ["8100:0"] + - concat: ["8433:0"] + + properties: + service_component_type: 'dcae-datafile' + application_config: + dmaap.ftpesConfig.keyCert: "/opt/app/datafile/config/dfc.jks" + dmaap.ftpesConfig.keyPassword: "secret" + dmaap.ftpesConfig.trustedCa: "/opt/app/datafile/config/ftp.jks" + dmaap.ftpesConfig.trustedCaPassword: "secret" + dmaap.security.trustStorePath: "/opt/app/datafile/etc/cert/trust.jks" + dmaap.security.trustStorePasswordPath: "/opt/app/datafile/etc/cert/trust.pass" + dmaap.security.keyStorePath: "/opt/app/datafile/etc/cert/key.p12" + dmaap.security.keyStorePasswordPath: "/opt/app/datafile/etc/cert/key.pass" + dmaap.security.enableDmaapCertAuth: { get_input: secureEnableCert } + streams_publishes: + PM_MEAS_FILES: + dmaap_info: <> + type: data_router + streams_subscribes: + dmaap_subscriber: + type: + "message_router" + dmaap_info: + topic_url: + { concat: [{ get_input: dmaap_mr_protocol },"://",{ get_input: dmaap_mr_host }, + ":",{ get_input: dmaap_mr_port },"/events/unauthenticated.VES_NOTIFICATION_OUTPUT/OpenDcae-c12/C12"]} + streams_publishes: + - name: bulk_pm_feed + type: data_router + location: "loc00" + docker_config: + healthcheck: + endpoint: /heartbeat + interval: 15s + timeout: 1s + type: http + image: + get_input: tag_version + replicas: {get_input: replicas} + log_info: + log_directory: "/var/log/ONAP" + tls_info: + cert_directory: '/opt/app/datafile/etc/cert/' + use_tls: true + diff --git a/reference_templates/k8s-pgaas-database.yaml-template b/reference_templates/k8s-pgaas-database.yaml-template new file mode 100644 index 0000000..309c962 --- /dev/null +++ b/reference_templates/k8s-pgaas-database.yaml-template @@ -0,0 +1,57 @@ +# -*- 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 + +description: |- + This blueprint is used to install and to uninstall a persistent database into the central postgres as a platform service. + This blueprint depends upon the deployment of the pgaas_plugin and the PGaaS service. + This blueprint is part of a suite of three blueprints: + k8s-pgaas-initdb takes control of the postgres server instance. + k8s-pgaas-database creates a database, roles and credentials associated with the database. + k8s-pgaas-getdbinfo shows how an application can access a database (including its roles and credentials) that was already created with k8s-pgaas-database. + +imports: + - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml + - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/pgaas/1.1.0/pgaas_types.yaml" + +inputs: + blueprint_version: + type: string + default: '2018-03-29T14:28:59+0000' + + # pgaas-specific info + k8s_pgaas_instance_fqdn: + type: string + + database_description: + type: string + default: 'This is a sample database' + + database_name: + type: string + default: sample + +node_templates: + pgaasdbtest: + type: dcae.nodes.pgaas.database + properties: + writerfqdn: { get_input: k8s_pgaas_instance_fqdn } + name: { get_input: database_name } diff --git a/reference_templates/k8s-pgaas-getdbinfo.yaml-template b/reference_templates/k8s-pgaas-getdbinfo.yaml-template new file mode 100644 index 0000000..6869f2c --- /dev/null +++ b/reference_templates/k8s-pgaas-getdbinfo.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 + +description: |- + This blueprint is an example of how an application can access the needed information about + a persistent database created as part of a PGaaS cluster. + + For a given database "dbname" on a given PGaaS cluster "PGCLUSTERNAME", + there are three roles created: + admin role: has complete administrative control over that database + user role: has complete read and write access on that database + viewer role: only has read access on that database + The various attributes will return the appropriate information + that can be used with that role: host fqdn, role name and password. + + This blueprint is part of a suite of three blueprints: + k8s-pgaas-initdb takes control of the postgres server instance. + k8s-pgaas-database creates a database, roles and credentials associated with the database. + k8s-pgaas-getdbinfo shows how an application can access a database (including its roles and credentials) that was already created with k8s-pgaas-database. + +imports: + - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml + - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/pgaas/1.1.0/pgaas_types.yaml" + +inputs: + k8s_pgaas_instance_fqdn: + type: string + database_name: + type: string + +node_templates: + pgclustername_dbname: + type: dcae.nodes.pgaas.database + properties: + writerfqdn: { get_input: k8s_pgaas_instance_fqdn } + name: { get_input: database_name } + use_existing: true + +outputs: + # admin role has control over table/index/view creation/dropping + pgclustername_dbname_admin_host: + description: Hostname for PGCLUSTERNAME dbname database + value: { get_attribute: [ pgclustername_dbname, admin, host ] } + pgclustername_dbname_admin_port: + description: Portname for PGCLUSTERNAME dbname database + value: { get_attribute: [ pgclustername_dbname, admin, port ] } + pgclustername_dbname_admin_user: + description: Admin Username for PGCLUSTERNAME dbname database + value: { get_attribute: [ pgclustername_dbname, admin, user ] } + pgclustername_dbname_admin_password: + description: Admin Password for PGCLUSTERNAME dbname database + value: { get_attribute: [ pgclustername_dbname, admin, password ] } + + # user role can read and write the tables + pgclustername_dbname_user_host: + description: Hostname for PGCLUSTERNAME dbname database + value: { get_attribute: [ pgclustername_dbname, user, host ] } + pgclustername_dbname_user_port: + description: Portname for PGCLUSTERNAME dbname database + value: { get_attribute: [ pgclustername_dbname, user, port ] } + pgclustername_dbname_user_user: + description: User Username for PGCLUSTERNAME dbname database + value: { get_attribute: [ pgclustername_dbname, user, user ] } + pgclustername_dbname_user_password: + description: User Password for PGCLUSTERNAME dbname database + value: { get_attribute: [ pgclustername_dbname, user, password ] } + + # viewer role can only read from the tables + pgclustername_dbname_viewer_host: + description: Hostname for PGCLUSTERNAME dbname database + value: { get_attribute: [ pgclustername_dbname, viewer, host ] } + pgclustername_dbname_viewer_port: + description: Portname for PGCLUSTERNAME dbname database + value: { get_attribute: [ pgclustername_dbname, viewer, port ] } + pgclustername_dbname_viewer_user: + description: Viewer Username for PGCLUSTERNAME dbname database + value: { get_attribute: [ pgclustername_dbname, viewer, user ] } + pgclustername_dbname_viewer_password: + description: Viewer Password for PGCLUSTERNAME dbname database + value: { get_attribute: [ pgclustername_dbname, viewer, password ] } diff --git a/reference_templates/pgaas-cluster.yaml-template b/reference_templates/pgaas-cluster.yaml-template new file mode 100644 index 0000000..d7b0cd0 --- /dev/null +++ b/reference_templates/pgaas-cluster.yaml-template @@ -0,0 +1,435 @@ +# -*- 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 + +description: |- + This blueprint is used to install and to uninstall a central postgres as a platform service. + This blueprint depends upon the deployment of the pgaas_plugin, the PGaaS Cinder volume, and Consul. + This blueprint is part of a suite of three blueprints that allow a PGaaS + cluster to be created that has persistent databases stored in Cinder. + pgaas-disk allocates the cinder volumes. It must be run first. + pgaas-cluster creates the PG service and attaches the cinder volumes. It must be run second. + pgaas-database creates a database. It must be run third, for each persistent database. + If the cluster is uninstalled, the persistent databases are unaffected. + If a database blueprint is uninstalled, the persistent database goes away. + If the disk blueprint is uninstalled, all persistent databases go away, along with the server instance. + +imports: + - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml + - http://www.getcloudify.org/spec/openstack-plugin/1.4/plugin.yaml + - http://www.getcloudify.org/spec/fabric-plugin/1.4.1/plugin.yaml + + - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/dnsdesig/dns_types.yaml" + - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml" + - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/pgaas/1.1.0/pgaas_types.yaml" + +inputs: + blueprint_version: + type: string + default: '2018-04-27T00:31:38+0000' + + # pgaas-specific info + pgaas_cluster_name: + type: string + default: pgcl + +{{ ONAPTEMPLATE_STANDARD_INPUTS_TYPES }} + + vm_init_pgrs: + type: string + default: | + #!/bin/sh + echo All output will be found in /tmp/ins.out and /tmp/ins.err + exec > /tmp/ins.out 2> /tmp/ins.err + set -x + if [ "$(dnsdomainname 2>/dev/null)" = "" ] + then + echo WARNING WARNING WARNING + echo The DNS DHCP settings did not work properly. + for i in $(seq 20) + do + echo Sleeping... + sleep 10 + if [ "$(dnsdomainname 2>/dev/null)" != "" ] + then break + fi + echo The DNS DHCP settings still did not work properly. + done + if [ "$(dnsdomainname 2>/dev/null)" = "" ] + then + echo Exiting + exit 1 + fi + fi + + CONFDIR=/var/config/DCAE/chef/ + mkdir -p $CONFDIR + + CONF=$CONFDIR/pgaas-postgres.conf + cat < $CONF + master: ${MASTER%%.*} + secondmaster: notused + DRTR_NODE_KSTOREFILE: /opt/app/dcae-certificate/keystore.jks + DRTR_NODE_KSTOREPASS: "No Certificate" + DRTR_NODE_PVTKEYPASS: "No Certificate" + PG_NODES: $PG_NODES + PG_JAVA_HOME : /opt/app/java/jdk/jdk170 + PG_CLUSTER: central + EOF + + apt-get update + + # invoking apt-get separately allows a failure to be ignored + for i in openjdk-7-jdk openjdk-8-jdk python-pip python3-pip curl gawk; do apt-get install -y $i;done + pip install pyyaml + + # prevent servers from starting + echo "exit 101" > /usr/sbin/policy-rc.d; chmod a+x /usr/sbin/policy-rc.d + + # invoking apt-get separately allows a failure to be ignored + for i in postgresql libpq5 repmgr python-psycopg2 python3-psycopg2 libgetopt-java; do apt-get install -y $i; done + + # allow servers to autostart again + rm -f /usr/sbin/policy-rc.d + + ( umask 077; sed 's/^/*:*:*:postgres:/' < /root/.pgrspw > ~postgres/.pgpass; chown postgres:postgres ~postgres/.pgpass ) + + if [ ! -f $CONF ] + then echo "$CONF does not exist" 1>&2; exit 1 + fi + + echo Look in /tmp/pgaas.out for output from installing PGaaS + NEXUS={{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_storage_pgaas_debs_releases }}/debs + for pkg in cdf.deb-1.0.0 pgaas.deb-1.0.0 + do + OUT=/tmp/$pkg + curl -s -k -f -o $OUT $NEXUS/$pkg + dpkg --install $OUT + done + + case $(hostname) in + *00 ) WRITE=-write ;; + *01 ) WRITE= ;; + esac + curl -v -X PUT -H "Content-Type: application/json" "http://${LOCATION_PREFIX}cnsl00.${LOCATION_DOMAIN}:8500/v1/agent/service/register" -d "{\"name\" : \"${CLUSTER_NAME}${WRITE}\", \"Address\" : \"${LOCAL_IP}\", \"Port\" : 5432}" + + echo ALL DONE + +node_templates: + key_pair: + type: cloudify.openstack.nodes.KeyPair + properties: + private_key_path: { get_input: key_filename } + use_external_resource: True + resource_id: { get_input: keypair } + openstack_config: &open_conf + get_input: openstack + private_net: + type: cloudify.openstack.nodes.Network + properties: + use_external_resource: True + resource_id: { get_input: private_net } + openstack_config: *open_conf + security_group: + type: cloudify.openstack.nodes.SecurityGroup + properties: + use_external_resource: True + resource_id: { get_input: security_group } + openstack_config: *open_conf + + fixedip_pgrs00: + type: cloudify.openstack.nodes.Port + properties: + port: + extra_dhcp_opts: + - opt_name: 'domain-name' + opt_value: { get_input: location_domain } + openstack_config: *open_conf + relationships: + - type: cloudify.relationships.contained_in + target: private_net + floatingip_pgrs00: + type: cloudify.openstack.nodes.FloatingIP + properties: + openstack_config: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + floating_network_name: { get_input: public_net } + dns_pgrs00: + type: ccsdk.nodes.dns.arecord + properties: + fqdn: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '00.', { get_input: location_domain } ] } + openstack: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + ip_addresses: + - { get_attribute: [ floatingip_pgrs00, floating_ip_address ] } + relationships: + - type: cloudify.relationships.depends_on + target: floatingip_pgrs00 + host_pgrs00: + type: cloudify.openstack.nodes.Server + properties: + install_agent: false + image: { get_input: ubuntu1604image_id } + flavor: { get_input: flavor_id } + management_network_name: { get_input: private_net } + openstack_config: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + name: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '00' ] } + userdata: + concat: + - |- + #!/bin/sh + mkdir /root/.sshkey + echo ' + - { get_attribute: [ pgaas_cluster, public ] } + - |- + ' >/root/.sshkey/id_rsa.pub + echo ' + - { get_attribute: [ pgaas_cluster, base64private ] } + - |- + ' | base64 -d >/root/.sshkey/id_rsa + chmod 700 /root/.sshkey + chmod 600 /root/.sshkey/* + ( umask 077; echo -n postgres | cat - /root/.sshkey/id_rsa | md5sum | awk '{ print $1 }' > /root/.pgrspw ) + set -x + - "\n" + - "CLUSTER_NAME='" + - { get_input: pgaas_cluster_name } + - "'\n" + - "LOCATION_PREFIX='" + - { get_input: location_prefix } + - "'\n" + - "LOCATION_DOMAIN='" + - { get_input: location_domain } + - "'\n" + - "MASTER='" + - { get_property: [ dns_pgrs00, fqdn ] } + - "'\n" + - "LOCAL_IP='" + - { get_attribute: [ floatingip_pgrs00, floating_ip_address ] } + - "'\n" + - "PG_NODES='" + - { get_property: [ dns_pgrs00, fqdn ] } + - '|' + - { get_property: [ dns_pgrs01, fqdn ] } + - "'\n" + - { get_input: vm_init_pgrs } + relationships: + - type: cloudify.openstack.server_connected_to_port + target: fixedip_pgrs00 + - type: cloudify.openstack.server_connected_to_security_group + target: security_group + - type: cloudify.openstack.server_connected_to_floating_ip + target: floatingip_pgrs00 + - type: cloudify.openstack.server_connected_to_keypair + target: key_pair + - type: cloudify.relationships.depends_on + target: dns_pgrs00 + - type: cloudify.relationships.depends_on + target: pgaas_cluster + fixedip_pgrs01: + type: cloudify.openstack.nodes.Port + properties: + port: + extra_dhcp_opts: + - opt_name: 'domain-name' + opt_value: { get_input: location_domain } + openstack_config: *open_conf + relationships: + - type: cloudify.relationships.contained_in + target: private_net + floatingip_pgrs01: + type: cloudify.openstack.nodes.FloatingIP + properties: + openstack_config: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + floating_network_name: { get_input: public_net } + dns_pgrs01: + type: ccsdk.nodes.dns.arecord + properties: + fqdn: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '01.', { get_input: location_domain } ] } + openstack: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + ip_addresses: + - { get_attribute: [ floatingip_pgrs01, floating_ip_address ] } + relationships: + - type: cloudify.relationships.depends_on + target: floatingip_pgrs01 + host_pgrs01: + type: cloudify.openstack.nodes.Server + properties: + install_agent: false + image: { get_input: ubuntu1604image_id } + flavor: { get_input: flavor_id } + management_network_name: { get_input: private_net } + openstack_config: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + name: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '01' ] } + userdata: + concat: + - |- + #!/bin/sh + mkdir /root/.sshkey + echo ' + - { get_attribute: [ pgaas_cluster, public ] } + - |- + ' >/root/.sshkey/id_rsa.pub + echo ' + - { get_attribute: [ pgaas_cluster, base64private ] } + - |- + ' | base64 -d >/root/.sshkey/id_rsa + chmod 700 /root/.sshkey + chmod 600 /root/.sshkey/* + ( umask 077; echo -n postgres | cat - /root/.sshkey/id_rsa | md5sum | awk '{ print $1 }' > /root/.pgrspw ) + set -x + - "\n" + - "CLUSTER_NAME='" + - { get_input: pgaas_cluster_name } + - "'\n" + - "LOCATION_PREFIX='" + - { get_input: location_prefix } + - "'\n" + - "LOCATION_DOMAIN='" + - { get_input: location_domain } + - "'\n" + - "MASTER='" + - { get_property: [ dns_pgrs00, fqdn ] } + - "'\n" + - "LOCAL_IP='" + - { get_attribute: [ floatingip_pgrs01, floating_ip_address ] } + - "'\n" + - "PG_NODES='" + - { get_property: [ dns_pgrs00, fqdn ] } + - '|' + - { get_property: [ dns_pgrs01, fqdn ] } + - "'\n" + - { get_input: vm_init_pgrs } + relationships: + - type: cloudify.openstack.server_connected_to_port + target: fixedip_pgrs01 + - type: cloudify.openstack.server_connected_to_security_group + target: security_group + - type: cloudify.openstack.server_connected_to_floating_ip + target: floatingip_pgrs01 + - type: cloudify.openstack.server_connected_to_keypair + target: key_pair + - type: cloudify.relationships.depends_on + target: dns_pgrs01 + - type: cloudify.relationships.depends_on + target: pgaas_cluster + + # cinder connections + volume_pgrs00: + type: cloudify.openstack.nodes.Volume + properties: + resource_id: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '00' ] } + openstack_config: *open_conf + use_external_resource: True + relationships: + - type: cloudify.openstack.volume_attached_to_server + target: host_pgrs00 + + volume_pgrs01: + type: cloudify.openstack.nodes.Volume + properties: + resource_id: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '01' ] } + openstack_config: *open_conf + use_external_resource: True + relationships: + - type: cloudify.openstack.volume_attached_to_server + target: host_pgrs01 + + # CNAME records + dns_pgrs_rw: + type: ccsdk.nodes.dns.cnamerecord + properties: + fqdn: { concat: [ { get_input: location_prefix }, '-', { get_input: pgaas_cluster_name }, '-write.', { get_input: location_domain } ] } + openstack: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + cname: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '00.', { get_input: location_domain } ] } + + dns_pgrs_ro: + type: ccsdk.nodes.dns.cnamerecord + properties: + fqdn: { concat: [ { get_input: location_prefix }, '-', { get_input: pgaas_cluster_name }, '.', { get_input: location_domain } ] } + openstack: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + cname: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '00.', { get_input: location_domain } ] } + + # tie to pgaas_plugin database + pgaas_cluster: + type: dcae.nodes.pgaas.cluster + properties: + writerfqdn: { get_property: [ dns_pgrs_rw, fqdn ] } + use_existing: true + relationships: + - type: cloudify.relationships.depends_on + target: dns_pgrs_rw + - type: cloudify.relationships.depends_on + target: dns_pgrs_ro + +outputs: + public_ip00: + value: { get_attribute: [host_pgrs00, ip] } + public_ip01: + value: { get_attribute: [host_pgrs01, ip] } + writerfqdn: + value: { get_property: [ dns_pgrs_rw, fqdn ] } + readerfqdn: + value: { get_property: [ dns_pgrs_ro, fqdn ] } + dns_pgrs00: + value: { get_property: [ dns_pgrs00, fqdn ] } + dns_pgrs01: + value: { get_property: [ dns_pgrs01, fqdn ] } + blueprint_version: + value: { get_input: blueprint_version } diff --git a/reference_templates/pgaas-database.yaml-template b/reference_templates/pgaas-database.yaml-template new file mode 100644 index 0000000..a89d638 --- /dev/null +++ b/reference_templates/pgaas-database.yaml-template @@ -0,0 +1,63 @@ +# -*- 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 + +description: |- + This blueprint is used to install and to uninstall a persistent database into the central postgres as a platform service. + This blueprint depends upon the deployment of the pgaas_plugin, the PGaaS Cinder volume, the PGaaS service, and Consul. + This blueprint is part of a suite of three blueprints that allow a PGaaS + cluster to be created that has persistent databases stored in Cinder. + pgaas-disk allocates the cinder volumes. It must be run first. + pgaas-cluster creates the PG service and attaches the cinder volumes. It must be run second. + pgaas-database creates a database. It must be run third, for each persistent database. + If the cluster is uninstalled, the persistent databases are unaffected. + If a database blueprint is uninstalled, the persistent database goes away. + If the disk blueprint is uninstalled, all persistent databases go away, along with the server instance. + +imports: + - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml + + - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/pgaas/1.1.0/pgaas_types.yaml" + +inputs: + blueprint_version: + type: string + default: '2018-03-29T14:28:59+0000' + + # pgaas-specific info + pgaas_cluster_name: + type: string + default: pgcl + database_description: + type: string + default: 'This is a sample database' + database_name: + type: string + default: sample + +{{ ONAPTEMPLATE_STANDARD_INPUTS_TYPES }} + +node_templates: + pgaasdbtest: + type: dcae.nodes.pgaas.database + properties: + writerfqdn: { concat: [ { get_input: location_prefix }, '-', { get_input: pgaas_cluster_name }, '-write.', { get_input: location_domain } ] } + name: { get_input: database_name } diff --git a/reference_templates/pgaas-disk.yaml-template b/reference_templates/pgaas-disk.yaml-template new file mode 100644 index 0000000..3f96bae --- /dev/null +++ b/reference_templates/pgaas-disk.yaml-template @@ -0,0 +1,123 @@ +# -*- 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 + +description: |- + This blueprint is used to install and to uninstall the cinder volumes for + a central postgres as a platform service. + This blueprint depends upon the deployment of Consul and the pgaas_plugin. + This blueprint is part of a suite of three blueprints that allow a PGaaS + cluster to be created that has persistent databases stored in Cinder. + pgaas-disk allocates the cinder volumes. It must be run first. + pgaas-cluster creates the PG service and attaches the cinder volumes. It must be run second. + pgaas-database creates a database. It must be run third, for each persistent database. + If the cluster is uninstalled, the persistent databases are unaffected. + If a database blueprint is uninstalled, the persistent database goes away. + If the disk blueprint is uninstalled, all persistent databases go away, along with the server instance. + +imports: + - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml + - http://www.getcloudify.org/spec/openstack-plugin/1.4/plugin.yaml + - http://www.getcloudify.org/spec/fabric-plugin/1.4.1/plugin.yaml + + - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/dnsdesig/dns_types.yaml" + - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/sshkeyshare/sshkey_types.yaml" + - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml" + - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/pgaas/1.1.0/pgaas_types.yaml" + +inputs: + blueprint_version: + type: string + default: '2018-04-27T00:31:38+0000' + + # pgaas-specific info + pgaas_cluster_name: + type: string + default: pgcl + cinder_volume_size: + type: string + default: 300 + +{{ ONAPTEMPLATE_STANDARD_INPUTS_TYPES }} + +node_templates: + key_pair: + type: cloudify.openstack.nodes.KeyPair + properties: + private_key_path: { get_input: key_filename } + use_external_resource: True + resource_id: { get_input: keypair } + openstack_config: &open_conf + get_input: openstack + + sharedsshkey_pgrs: + type: ccsdk.nodes.ssh.keypair + + private_net: + type: cloudify.openstack.nodes.Network + properties: + use_external_resource: True + resource_id: { get_input: private_net } + openstack_config: *open_conf + + security_group: + type: cloudify.openstack.nodes.SecurityGroup + properties: + use_external_resource: True + resource_id: { get_input: security_group } + openstack_config: *open_conf + + volume_pgrs00: + type: cloudify.openstack.nodes.Volume + properties: + resource_id: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '00' ] } + openstack_config: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + size: { get_input: cinder_volume_size } + + volume_pgrs01: + type: cloudify.openstack.nodes.Volume + properties: + resource_id: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '01' ] } + openstack_config: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + size: { get_input: cinder_volume_size } + + pgaas_cluster: + type: dcae.nodes.pgaas.cluster + properties: + writerfqdn: { concat: [ { get_input: location_prefix }, '-', { get_input: pgaas_cluster_name }, '-write.', { get_input: location_domain } ] } + readerfqdn: { concat: [ { get_input: location_prefix }, '-', { get_input: pgaas_cluster_name }, '.', { get_input: location_domain } ] } + relationships: + - type: dcae.relationships.pgaas_cluster_uses_sshkeypair + target: sharedsshkey_pgrs + +outputs: + blueprint_version: + value: { get_input: blueprint_version } diff --git a/reference_templates/pgaas-getdbinfo.yaml-template b/reference_templates/pgaas-getdbinfo.yaml-template new file mode 100644 index 0000000..8672f04 --- /dev/null +++ b/reference_templates/pgaas-getdbinfo.yaml-template @@ -0,0 +1,92 @@ +# -*- 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 + +description: |- + This blueprint is an example of how an application can access the needed information about + a persistent database created as part of a PGaaS cluster. + + For a given database "dbname" on a given PGaaS cluster "PGCLUSTERNAME", + there are three roles created: + admin role: has complete administrative control over that database + user role: has complete read and write access on that database + viewer role: only has read access on that database + The various attributes will return the appropriate information + that can be used with that role: host fqdn, role name and password. + +imports: + - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml + + - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/pgaas/1.1.0/pgaas_types.yaml" + +inputs: + location_domain: + type: string + location_prefix: + type: string + pgaas_cluster_name: + type: string + default: pgcl + database_name: + type: string + default: sample + +node_templates: + pgclustername_dbname: + type: dcae.nodes.pgaas.database + properties: + writerfqdn: { concat: [ { get_input: location_prefix }, '-', { get_input: pgaas_cluster_name }, '-write.', { get_input: location_domain } ] } + name: { get_input: database_name } + use_existing: true + +outputs: + # admin role has control over table/index/view creation/dropping + pgclustername_dbname_admin_host: + description: Hostname for PGCLUSTERNAME dbname database + value: { get_attribute: [ pgclustername_dbname, admin, host ] } + pgclustername_dbname_admin_user: + description: Admin Username for PGCLUSTERNAME dbname database + value: { get_attribute: [ pgclustername_dbname, admin, user ] } + pgclustername_dbname_admin_password: + description: Admin Password for PGCLUSTERNAME dbname database + value: { get_attribute: [ pgclustername_dbname, admin, password ] } + + # user role can read and write the tables + pgclustername_dbname_user_host: + description: Hostname for PGCLUSTERNAME dbname database + value: { get_attribute: [ pgclustername_dbname, user, host ] } + pgclustername_dbname_user_user: + description: User Username for PGCLUSTERNAME dbname database + value: { get_attribute: [ pgclustername_dbname, user, user ] } + pgclustername_dbname_user_password: + description: User Password for PGCLUSTERNAME dbname database + value: { get_attribute: [ pgclustername_dbname, user, password ] } + + # viewer role can only read from the tables + pgclustername_dbname_viewer_host: + description: Hostname for PGCLUSTERNAME dbname database + value: { get_attribute: [ pgclustername_dbname, viewer, host ] } + pgclustername_dbname_viewer_user: + description: Viewer Username for PGCLUSTERNAME dbname database + value: { get_attribute: [ pgclustername_dbname, viewer, user ] } + pgclustername_dbname_viewer_password: + description: Viewer Password for PGCLUSTERNAME dbname database + value: { get_attribute: [ pgclustername_dbname, viewer, password ] } diff --git a/reference_templates/pgaas-onevm.yaml-template b/reference_templates/pgaas-onevm.yaml-template new file mode 100644 index 0000000..be2d044 --- /dev/null +++ b/reference_templates/pgaas-onevm.yaml-template @@ -0,0 +1,300 @@ +# -*- 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 + +description: |- + This blueprint is used to install and to uninstall a single-VM central postgres as a platform service. + This blueprint depends upon the deployment of the pgaas_plugin and Consul. + +imports: + - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml + - http://www.getcloudify.org/spec/openstack-plugin/1.4/plugin.yaml + - http://www.getcloudify.org/spec/fabric-plugin/1.4.1/plugin.yaml + + - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/dnsdesig/dns_types.yaml" + - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/sshkeyshare/sshkey_types.yaml" + - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml" + - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/pgaas/1.1.0/pgaas_types.yaml" + +inputs: + blueprint_version: + type: string + default: '2018-04-27T00:31:38+0000' + + # pgaas-specific info + pgaas_cluster_name: + type: string + default: pgvm + +{{ ONAPTEMPLATE_STANDARD_INPUTS_TYPES }} + + vm_init_pgrs: + type: string + default: | + #!/bin/sh + echo All output will be found in /tmp/ins.out and /tmp/ins.err + exec > /tmp/ins.out 2> /tmp/ins.err + set -x + if [ "$(dnsdomainname 2>/dev/null)" = "" ] + then + echo WARNING WARNING WARNING + echo The DNS DHCP settings did not work properly. + for i in $(seq 20) + do + echo Sleeping... + sleep 10 + if [ "$(dnsdomainname 2>/dev/null)" != "" ] + then break + fi + echo The DNS DHCP settings still did not work properly. + done + if [ "$(dnsdomainname 2>/dev/null)" = "" ] + then + echo Exiting + exit 1 + fi + fi + + CONFDIR=/var/config/DCAE/chef/ + mkdir -p $CONFDIR + + CONF=$CONFDIR/pgaas-postgres.conf + cat < $CONF + master: ${MASTER%%.*} + secondmaster: notused + DRTR_NODE_KSTOREFILE: /opt/app/dcae-certificate/keystore.jks + DRTR_NODE_KSTOREPASS: "No Certificate" + DRTR_NODE_PVTKEYPASS: "No Certificate" + PG_NODES: $PG_NODES + PG_JAVA_HOME : /opt/app/java/jdk/jdk170 + PG_CLUSTER: central + EOF + + apt-get update + + # invoking apt-get separately allows a failure to be ignored + for i in openjdk-7-jdk openjdk-8-jdk python-pip python3-pip curl gawk; do apt-get install -y $i;done + pip install pyyaml + + # prevent servers from starting + echo "exit 101" > /usr/sbin/policy-rc.d; chmod a+x /usr/sbin/policy-rc.d + + # invoking apt-get separately allows a failure to be ignored + for i in postgresql libpq5 repmgr python-psycopg2 python3-psycopg2 libgetopt-java; do apt-get install -y $i; done + + # allow servers to autostart again + rm -f /usr/sbin/policy-rc.d + + ( umask 077; sed 's/^/*:*:*:postgres:/' < /root/.pgrspw > ~postgres/.pgpass; chown postgres:postgres ~postgres/.pgpass ) + + if [ ! -f $CONF ] + then echo "$CONF does not exist" 1>&2; exit 1 + fi + + echo Look in /tmp/pgaas.out for output from installing PGaaS + NEXUS={{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_storage_pgaas_debs_releases }}/debs + for pkg in cdf.deb-1.0.0 pgaas.deb-1.0.0 + do + OUT=/tmp/$pkg + curl -s -k -f -o $OUT $NEXUS/$pkg + dpkg --install $OUT + done + + curl -v -X PUT -H "Content-Type: application/json" "http://${LOCATION_PREFIX}cnsl00.${LOCATION_DOMAIN}:8500/v1/agent/service/register" -d "{\"name\" : \"${CLUSTER_NAME}-write\", \"Address\" : \"${LOCAL_IP}\", \"Port\" : 5432}\"" + curl -v -X PUT -H "Content-Type: application/json" "http://${LOCATION_PREFIX}cnsl00.${LOCATION_DOMAIN}:8500/v1/agent/service/register" -d "{\"name\" : \"${CLUSTER_NAME}\", \"Address\" : \"${LOCAL_IP}\", \"Port\" : 5432}" + + echo ALL DONE + +node_templates: + key_pair: + type: cloudify.openstack.nodes.KeyPair + properties: + private_key_path: { get_input: key_filename } + use_external_resource: True + resource_id: { get_input: keypair } + openstack_config: &open_conf + get_input: openstack + private_net: + type: cloudify.openstack.nodes.Network + properties: + use_external_resource: True + resource_id: { get_input: private_net } + openstack_config: *open_conf + security_group: + type: cloudify.openstack.nodes.SecurityGroup + properties: + use_external_resource: True + resource_id: { get_input: security_group } + openstack_config: *open_conf + + sharedsshkey_pgrs: + type: ccsdk.nodes.ssh.keypair + + fixedip_pgrs00: + type: cloudify.openstack.nodes.Port + properties: + port: + extra_dhcp_opts: + - opt_name: 'domain-name' + opt_value: { get_input: location_domain } + openstack_config: *open_conf + relationships: + - type: cloudify.relationships.contained_in + target: private_net + floatingip_pgrs00: + type: cloudify.openstack.nodes.FloatingIP + properties: + openstack_config: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + floating_network_name: { get_input: public_net } + dns_pgrs00: + type: ccsdk.nodes.dns.arecord + properties: + fqdn: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '00.', { get_input: location_domain } ] } + openstack: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + ip_addresses: + - { get_attribute: [ floatingip_pgrs00, floating_ip_address ] } + relationships: + - type: cloudify.relationships.depends_on + target: floatingip_pgrs00 + host_pgrs00: + type: cloudify.openstack.nodes.Server + properties: + install_agent: false + image: { get_input: ubuntu1604image_id } + flavor: { get_input: flavor_id } + management_network_name: { get_input: private_net } + openstack_config: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + name: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '00' ] } + userdata: + concat: + - |- + #!/bin/sh + mkdir /root/.sshkey + echo ' + - { get_attribute: [ sharedsshkey_pgrs, public ] } + - |- + ' >/root/.sshkey/id_rsa.pub + echo ' + - { get_attribute: [ sharedsshkey_pgrs, base64private ] } + - |- + ' | base64 -d >/root/.sshkey/id_rsa + chmod 700 /root/.sshkey + chmod 600 /root/.sshkey/* + ( umask 077; echo -n postgres | cat - /root/.sshkey/id_rsa | md5sum | awk '{ print $1 }' > /root/.pgrspw ) + set -x + - "\n" + - "CLUSTER_NAME='" + - { get_input: pgaas_cluster_name } + - "'\n" + - "LOCATION_PREFIX='" + - { get_input: location_prefix } + - "'\n" + - "LOCATION_DOMAIN='" + - { get_input: location_domain } + - "'\n" + - "MASTER='" + - { get_property: [ dns_pgrs00, fqdn ] } + - "'\n" + - "LOCAL_IP='" + - { get_attribute: [ floatingip_pgrs00, floating_ip_address ] } + - "'\n" + - "PG_NODES='" + - { get_property: [ dns_pgrs00, fqdn ] } + - "'\n" + - { get_input: vm_init_pgrs } + relationships: + - type: cloudify.openstack.server_connected_to_port + target: fixedip_pgrs00 + - type: cloudify.openstack.server_connected_to_security_group + target: security_group + - type: cloudify.openstack.server_connected_to_floating_ip + target: floatingip_pgrs00 + - type: cloudify.openstack.server_connected_to_keypair + target: key_pair + - type: cloudify.relationships.depends_on + target: dns_pgrs00 + - type: cloudify.relationships.depends_on + target: sharedsshkey_pgrs + # CNAME records + dns_pgrs_rw: + type: ccsdk.nodes.dns.cnamerecord + properties: + fqdn: { concat: [ { get_input: location_prefix }, '-', { get_input: pgaas_cluster_name }, '-write.', { get_input: location_domain } ] } + openstack: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + cname: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '00.', { get_input: location_domain } ] } + + dns_pgrs_ro: + type: ccsdk.nodes.dns.cnamerecord + properties: + fqdn: { concat: [ { get_input: location_prefix }, '-', { get_input: pgaas_cluster_name }, '.', { get_input: location_domain } ] } + openstack: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + cname: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '00.', { get_input: location_domain } ] } + + # tie to pgaas_plugin database + pgaas_cluster: + type: dcae.nodes.pgaas.cluster + properties: + writerfqdn: { get_property: [ dns_pgrs_rw, fqdn ] } + readerfqdn: { get_property: [ dns_pgrs_ro, fqdn ] } + relationships: + - type: dcae.relationships.pgaas_cluster_uses_sshkeypair + target: sharedsshkey_pgrs + - type: cloudify.relationships.depends_on + target: dns_pgrs_rw + - type: cloudify.relationships.depends_on + target: dns_pgrs_ro + +outputs: + public_ip00: + value: { get_attribute: [host_pgrs00, ip] } + writerfqdn: + value: { get_property: [ dns_pgrs_rw, fqdn ] } + readerfqdn: + value: { get_property: [ dns_pgrs_ro, fqdn ] } + dns_pgrs00: + value: { get_property: [ dns_pgrs00, fqdn ] } + blueprint_version: + value: { get_input: blueprint_version } diff --git a/reference_templates/pgaas.yaml-template b/reference_templates/pgaas.yaml-template new file mode 100644 index 0000000..4a7e16a --- /dev/null +++ b/reference_templates/pgaas.yaml-template @@ -0,0 +1,412 @@ +# -*- 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 + +description: |- + This blueprint is used to install and to uninstall a two-VM central postgres as a platform service. + This blueprint depends upon the deployment of the pgaas_plugin and Consul. + +imports: + - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml + - http://www.getcloudify.org/spec/openstack-plugin/1.4/plugin.yaml + - http://www.getcloudify.org/spec/fabric-plugin/1.4.1/plugin.yaml + + - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/dnsdesig/dns_types.yaml" + - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/sshkeyshare/sshkey_types.yaml" + - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml" + - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/pgaas/1.1.0/pgaas_types.yaml" + +inputs: + blueprint_version: + type: string + default: '2018-04-27T00:31:38+0000' + + # pgaas-specific info + pgaas_cluster_name: + type: string + default: pstg + +{{ ONAPTEMPLATE_STANDARD_INPUTS_TYPES }} + + vm_init_pgrs: + type: string + default: | + #!/bin/sh + echo All output will be found in /tmp/ins.out and /tmp/ins.err + exec > /tmp/ins.out 2> /tmp/ins.err + set -x + if [ "$(dnsdomainname 2>/dev/null)" = "" ] + then + echo WARNING WARNING WARNING + echo The DNS DHCP settings did not work properly. + for i in $(seq 20) + do + echo Sleeping... + sleep 10 + if [ "$(dnsdomainname 2>/dev/null)" != "" ] + then break + fi + echo The DNS DHCP settings still did not work properly. + done + if [ "$(dnsdomainname 2>/dev/null)" = "" ] + then + echo Exiting + exit 1 + fi + fi + + CONFDIR=/var/config/DCAE/chef/ + mkdir -p $CONFDIR + + CONF=$CONFDIR/pgaas-postgres.conf + cat < $CONF + master: ${MASTER%%.*} + secondmaster: notused + DRTR_NODE_KSTOREFILE: /opt/app/dcae-certificate/keystore.jks + DRTR_NODE_KSTOREPASS: "No Certificate" + DRTR_NODE_PVTKEYPASS: "No Certificate" + PG_NODES: $PG_NODES + PG_JAVA_HOME : /opt/app/java/jdk/jdk170 + PG_CLUSTER: central + EOF + + apt-get update + + # invoking apt-get separately allows a failure to be ignored + for i in openjdk-7-jdk openjdk-8-jdk python-pip python3-pip curl gawk; do apt-get install -y $i;done + pip install pyyaml + + # prevent servers from starting + echo "exit 101" > /usr/sbin/policy-rc.d; chmod a+x /usr/sbin/policy-rc.d + + # invoking apt-get separately allows a failure to be ignored + for i in postgresql libpq5 repmgr python-psycopg2 python3-psycopg2 libgetopt-java; do apt-get install -y $i; done + + # allow servers to autostart again + rm -f /usr/sbin/policy-rc.d + + ( umask 077; sed 's/^/*:*:*:postgres:/' < /root/.pgrspw > ~postgres/.pgpass; chown postgres:postgres ~postgres/.pgpass ) + + if [ ! -f $CONF ] + then echo "$CONF does not exist" 1>&2; exit 1 + fi + + echo Look in /tmp/pgaas.out for output from installing PGaaS + NEXUS={{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_storage_pgaas_debs_releases }}/debs + for pkg in cdf.deb-1.0.0 pgaas.deb-1.0.0 + do + OUT=/tmp/$pkg + curl -s -k -f -o $OUT $NEXUS/$pkg + dpkg --install $OUT + done + + case $(hostname) in + *00 ) WRITE=-write ;; + *01 ) WRITE= ;; + esac + curl -v -X PUT -H "Content-Type: application/json" "http://${LOCATION_PREFIX}cnsl00.${LOCATION_DOMAIN}:8500/v1/agent/service/register" -d "{\"name\" : \"${CLUSTER_NAME}${WRITE}\", \"Address\" : \"${LOCAL_IP}\", \"Port\" : 5432}" + + echo ALL DONE + +node_templates: + key_pair: + type: cloudify.openstack.nodes.KeyPair + properties: + private_key_path: { get_input: key_filename } + use_external_resource: True + resource_id: { get_input: keypair } + openstack_config: &open_conf + get_input: openstack + private_net: + type: cloudify.openstack.nodes.Network + properties: + use_external_resource: True + resource_id: { get_input: private_net } + openstack_config: *open_conf + security_group: + type: cloudify.openstack.nodes.SecurityGroup + properties: + use_external_resource: True + resource_id: { get_input: security_group } + openstack_config: *open_conf + + sharedsshkey_pgrs: + type: ccsdk.nodes.ssh.keypair + + fixedip_pgrs00: + type: cloudify.openstack.nodes.Port + properties: + port: + extra_dhcp_opts: + - opt_name: 'domain-name' + opt_value: { get_input: location_domain } + openstack_config: *open_conf + relationships: + - type: cloudify.relationships.contained_in + target: private_net + floatingip_pgrs00: + type: cloudify.openstack.nodes.FloatingIP + properties: + openstack_config: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + floating_network_name: { get_input: public_net } + dns_pgrs00: + type: ccsdk.nodes.dns.arecord + properties: + fqdn: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '00.', { get_input: location_domain } ] } + openstack: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + ip_addresses: + - { get_attribute: [ floatingip_pgrs00, floating_ip_address ] } + relationships: + - type: cloudify.relationships.depends_on + target: floatingip_pgrs00 + host_pgrs00: + type: cloudify.openstack.nodes.Server + properties: + install_agent: false + image: { get_input: ubuntu1604image_id } + flavor: { get_input: flavor_id } + management_network_name: { get_input: private_net } + openstack_config: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + name: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '00' ] } + userdata: + concat: + - |- + #!/bin/sh + mkdir /root/.sshkey + echo ' + - { get_attribute: [ sharedsshkey_pgrs, public ] } + - |- + ' >/root/.sshkey/id_rsa.pub + echo ' + - { get_attribute: [ sharedsshkey_pgrs, base64private ] } + - |- + ' | base64 -d >/root/.sshkey/id_rsa + chmod 700 /root/.sshkey + chmod 600 /root/.sshkey/* + ( umask 077; echo -n postgres | cat - /root/.sshkey/id_rsa | md5sum | awk '{ print $1 }' > /root/.pgrspw ) + set -x + - "\n" + - "CLUSTER_NAME='" + - { get_input: pgaas_cluster_name } + - "'\n" + - "LOCATION_PREFIX='" + - { get_input: location_prefix } + - "'\n" + - "LOCATION_DOMAIN='" + - { get_input: location_domain } + - "'\n" + - "MASTER='" + - { get_property: [ dns_pgrs00, fqdn ] } + - "'\n" + - "LOCAL_IP='" + - { get_attribute: [ floatingip_pgrs00, floating_ip_address ] } + - "'\n" + - "PG_NODES='" + - { get_property: [ dns_pgrs00, fqdn ] } + - '|' + - { get_property: [ dns_pgrs01, fqdn ] } + - "'\n" + - { get_input: vm_init_pgrs } + relationships: + - type: cloudify.openstack.server_connected_to_port + target: fixedip_pgrs00 + - type: cloudify.openstack.server_connected_to_security_group + target: security_group + - type: cloudify.openstack.server_connected_to_floating_ip + target: floatingip_pgrs00 + - type: cloudify.openstack.server_connected_to_keypair + target: key_pair + - type: cloudify.relationships.depends_on + target: dns_pgrs00 + - type: cloudify.relationships.depends_on + target: sharedsshkey_pgrs + fixedip_pgrs01: + type: cloudify.openstack.nodes.Port + properties: + port: + extra_dhcp_opts: + - opt_name: 'domain-name' + opt_value: { get_input: location_domain } + openstack_config: *open_conf + relationships: + - type: cloudify.relationships.contained_in + target: private_net + floatingip_pgrs01: + type: cloudify.openstack.nodes.FloatingIP + properties: + openstack_config: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + floating_network_name: { get_input: public_net } + dns_pgrs01: + type: ccsdk.nodes.dns.arecord + properties: + fqdn: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '01.', { get_input: location_domain } ] } + openstack: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + ip_addresses: + - { get_attribute: [ floatingip_pgrs01, floating_ip_address ] } + relationships: + - type: cloudify.relationships.depends_on + target: floatingip_pgrs01 + host_pgrs01: + type: cloudify.openstack.nodes.Server + properties: + install_agent: false + image: { get_input: ubuntu1604image_id } + flavor: { get_input: flavor_id } + management_network_name: { get_input: private_net } + openstack_config: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + name: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '01' ] } + userdata: + concat: + - |- + #!/bin/sh + mkdir /root/.sshkey + echo ' + - { get_attribute: [ sharedsshkey_pgrs, public ] } + - |- + ' >/root/.sshkey/id_rsa.pub + echo ' + - { get_attribute: [ sharedsshkey_pgrs, base64private ] } + - |- + ' | base64 -d >/root/.sshkey/id_rsa + chmod 700 /root/.sshkey + chmod 600 /root/.sshkey/* + ( umask 077; echo -n postgres | cat - /root/.sshkey/id_rsa | md5sum | awk '{ print $1 }' > /root/.pgrspw ) + set -x + - "\n" + - "CLUSTER_NAME='" + - { get_input: pgaas_cluster_name } + - "'\n" + - "LOCATION_PREFIX='" + - { get_input: location_prefix } + - "'\n" + - "LOCATION_DOMAIN='" + - { get_input: location_domain } + - "'\n" + - "MASTER='" + - { get_property: [ dns_pgrs00, fqdn ] } + - "'\n" + - "LOCAL_IP='" + - { get_attribute: [ floatingip_pgrs01, floating_ip_address ] } + - "'\n" + - "PG_NODES='" + - { get_property: [ dns_pgrs00, fqdn ] } + - '|' + - { get_property: [ dns_pgrs01, fqdn ] } + - "'\n" + - { get_input: vm_init_pgrs } + relationships: + - type: cloudify.openstack.server_connected_to_port + target: fixedip_pgrs01 + - type: cloudify.openstack.server_connected_to_security_group + target: security_group + - type: cloudify.openstack.server_connected_to_floating_ip + target: floatingip_pgrs01 + - type: cloudify.openstack.server_connected_to_keypair + target: key_pair + - type: cloudify.relationships.depends_on + target: dns_pgrs01 + - type: cloudify.relationships.depends_on + target: sharedsshkey_pgrs + + # CNAME records + dns_pgrs_rw: + type: ccsdk.nodes.dns.cnamerecord + properties: + fqdn: { concat: [ { get_input: location_prefix }, '-', { get_input: pgaas_cluster_name }, '-write.', { get_input: location_domain } ] } + openstack: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + cname: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '00.', { get_input: location_domain } ] } + + dns_pgrs_ro: + type: ccsdk.nodes.dns.cnamerecord + properties: + fqdn: { concat: [ { get_input: location_prefix }, '-', { get_input: pgaas_cluster_name }, '.', { get_input: location_domain } ] } + openstack: *open_conf + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + args: + cname: { concat: [ { get_input: location_prefix }, { get_input: pgaas_cluster_name }, '00.', { get_input: location_domain } ] } + + # tie to pgaas_plugin database + pgaas_cluster: + type: dcae.nodes.pgaas.cluster + properties: + writerfqdn: { get_property: [ dns_pgrs_rw, fqdn ] } + readerfqdn: { get_property: [ dns_pgrs_ro, fqdn ] } + relationships: + - type: dcae.relationships.pgaas_cluster_uses_sshkeypair + target: sharedsshkey_pgrs + - type: cloudify.relationships.depends_on + target: dns_pgrs_rw + - type: cloudify.relationships.depends_on + target: dns_pgrs_ro + +outputs: + public_ip00: + value: { get_attribute: [host_pgrs00, ip] } + public_ip01: + value: { get_attribute: [host_pgrs01, ip] } + writerfqdn: + value: { get_property: [ dns_pgrs_rw, fqdn ] } + readerfqdn: + value: { get_property: [ dns_pgrs_ro, fqdn ] } + dns_pgrs00: + value: { get_property: [ dns_pgrs00, fqdn ] } + dns_pgrs01: + value: { get_property: [ dns_pgrs01, fqdn ] } + blueprint_version: + value: { get_input: blueprint_version } diff --git a/reference_templates/policy_handler.yaml-template b/reference_templates/policy_handler.yaml-template new file mode 100644 index 0000000..29e66e6 --- /dev/null +++ b/reference_templates/policy_handler.yaml-template @@ -0,0 +1,70 @@ +# -*- indent-tabs-mode: nil -*- # vi: set expandtab: +# +# ============LICENSE_START======================================================= +# 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========================================================= +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. + +tosca_definitions_version: cloudify_dsl_1_3 + +description: > + This blueprint deploys/manages the DCAE policy-handler as a Docker container + +imports: + - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dockerplugin/3/dockerplugin_types.yaml + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml + +inputs: + + location_id: + description: Deployment location + + docker_host_override: + description: Target docker host + default: 'platform_dockerhost' + + policy_handler_image: + description: Docker image for policy_handler + default: '{{ ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_releases }}/onap/org.onap.dcaegen2.platform.policy-handler:5.0.0' + + application_config: + description: policy handler application configuration - requires info on policy-engine + default: {} + +node_templates: + policy_handler: + type: dcae.nodes.DockerContainerForPlatforms + properties: + name: 'policy_handler' + image: { get_input: policy_handler_image } + application_config: { get_input: application_config } + docker_config: + healthcheck: + type: 'http' + interval: '300s' + timeout: '25s' + endpoint: '/healthcheck' + relationships: + - type: dcae.relationships.component_contained_in + target: docker_host + + # Docker host + docker_host: + type: dcae.nodes.SelectedDockerHost + properties: + location_id: { get_input: location_id } + docker_host_override: { get_input: docker_host_override } diff --git a/reference_templates/prh-service.yaml-template b/reference_templates/prh-service.yaml-template new file mode 100644 index 0000000..77d681b --- /dev/null +++ b/reference_templates/prh-service.yaml-template @@ -0,0 +1,61 @@ +tosca_definitions_version: cloudify_dsl_1_3 +imports: +- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dockerplugin/2/dockerplugin_types.yaml" +- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml" +inputs: + prh_publish_url: + type: string + default: "http://10.0.11.1:3904/events/unauthenticated.SO_OUTPUT" + prh_subscribe_url: + type: string + default: "http://10.0.11.1:3904/events/unauthenticated.SEC_OTHER_OUTPUT" + docker_host_override: + type: string + default: "component_dockerhost" + dh_location_id: + type: string + default: "zone1" + tag_version: + type: string + default: "nexus3.onap.org:10001/onap/org.onap.dcaegen2.services.prh:1.2.2" + + +node_templates: + docker_service_host: + type: dcae.nodes.SelectedDockerHost + properties: + docker_host_override: + get_input: docker_host_override + location_id: + get_input: dh_location_id + heartbeatService: + type: dcae.nodes.DockerContainerForComponentsUsingDmaap + properties: + application_config: + streams_publishes: + dcae_cl_out: + dmaap_info: + topic_url: + get_input: prh_publish_url + type: message_router + streams_subscribes: + heartbeat_fault: + dmaap_info: + topic_url: + get_input: prh_subcribe_url + type: message_router + docker_config: + healthcheck: + script: /app/bin/check_health.py + interval: 18s + timeout: 30s + type: docker + image: + get_input: tag_version + location_id: + get_input: dh_location_id + service_component_type: dcaegen2-services-prh + relationships: + - target: docker_service_host + type: dcae.relationships.component_contained_in + diff --git a/reference_templates/snmptrap-collector.yaml-template b/reference_templates/snmptrap-collector.yaml-template new file mode 100644 index 0000000..694fde5 --- /dev/null +++ b/reference_templates/snmptrap-collector.yaml-template @@ -0,0 +1,95 @@ +tosca_definitions_version: cloudify_dsl_1_3 +imports: +- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dockerplugin/2/dockerplugin_types.yaml" +- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml" +inputs: + snmp_publish_url: + type: string + default: "http://10.0.11.1:3904/events/unauthenticated.ONAP-COLLECTOR-SNMPTRAP" + docker_host_override: + type: string + default: "component_dockerhost" + dh_location_id: + type: string + default: "zone1" + tag_version: + type: string + default: "nexus3.onap.org:10001/onap/org.onap.dcaegen2.collectors.snmptrap:1.3" + +node_templates: + docker_service_host: + type: dcae.nodes.SelectedDockerHost + properties: + docker_host_override: + get_input: docker_host_override + location_id: + get_input: dh_location_id + heartbeatService: + type: dcae.nodes.DockerContainerForComponentsUsingDmaap + properties: + application_config: + streams_publishes: + dcae_cl_out: + dmaap_info: + topic_url: + get_input: snmp_publish_url + type: message_router + snmptrap.version: "1.3.0" + snmptrap.title: "ONAP SNMP Trap Receiver" + protocols.transport: "udp" + protocols.ipv4_interface: "0.0.0.0" + protocols.ipv4_port: 162 + protocols.ipv6_interface: "::1" + protocols.ipv6_port: 162 + cache.dns_cache_ttl_seconds: 60 + publisher.http_timeout_milliseconds: 1500 + publisher.http_retries: 3 + publisher.http_milliseconds_between_retries: 750 + publisher.http_primary_publisher: "true" + publisher.http_peer_publisher: "unavailable" + publisher.max_traps_between_publishes: 10 + publisher.max_milliseconds_between_publishes: 10000 + files.runtime_base_dir: "/opt/app/snmptrap" + files.log_dir: "logs" + files.data_dir: "data" + files.pid_dir: "tmp" + files.arriving_traps_log: "snmptrapd_arriving_traps.log" + files.snmptrapd_diag: "snmptrapd_prog_diag.log" + files.traps_stats_log: "snmptrapd_stats.csv" + files.perm_status_file: "snmptrapd_status.log" + files.eelf_base_dir: "/opt/app/snmptrap/logs" + files.eelf_error: "error.log" + files.eelf_debug: "debug.log" + files.eelf_audit: "audit.log" + files.eelf_metrics: "metrics.log" + files.roll_frequency: "hour" + files.minimum_severity_to_log: 2 + trap_def.1.trap_oid" : ".1.3.6.1.4.1.74.2.46.12.1.1" + trap_def.1.trap_category: "DCAE-SNMP-TRAPS" + trap_def.2.trap_oid" : "*" + trap_def.2.trap_category: "DCAE-SNMP-TRAPS" + stormwatch.1.stormwatch_oid" : ".1.3.6.1.4.1.74.2.46.12.1.1" + stormwatch.1.low_water_rearm_per_minute" : "5" + stormwatch.1.high_water_arm_per_minute" : "100" + stormwatch.2.stormwatch_oid" : ".1.3.6.1.4.1.74.2.46.12.1.2" + stormwatch.2.low_water_rearm_per_minute" : "2" + stormwatch.2.high_water_arm_per_minute" : "200" + stormwatch.3.stormwatch_oid" : ".1.3.6.1.4.1.74.2.46.12.1.2" + stormwatch.3.low_water_rearm_per_minute" : "2" + stormwatch.3.high_water_arm_per_minute" : "200" + docker_config: + healthcheck: + script: /app/bin/check_health.py + interval: 18s + timeout: 30s + type: docker + image: + get_input: tag_version + + location_id: + get_input: dh_location_id + service_component_type: dcaegen2-collectors-snmptrap + relationships: + - target: docker_service_host + type: dcae.relationships.component_contained_in + diff --git a/reference_templates/tca.yaml-template b/reference_templates/tca.yaml-template new file mode 100644 index 0000000..9699456 --- /dev/null +++ b/reference_templates/tca.yaml-template @@ -0,0 +1,92 @@ +tosca_definitions_version: cloudify_dsl_1_3 +imports: + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dockerplugin/2/dockerplugin_types.yaml + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/cdapcloudify/14/cdapcloudify_types.yaml + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dcaepolicyplugin/1/dcaepolicyplugin_types.yaml + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml + +inputs: + connected_broker_dns_name: + type: string + default: cdap_broker + aaiEnrichmentHost: + type: string + enableAAIEnrichment: + type: string + default: false + subscriberHostName: + type: string + publisherHostName: + type: string +node_templates: + tca_tca: + type: dcae.nodes.MicroService.cdap + properties: + app_config: + appDescription: DCAE Analytics Threshold Crossing Alert Application + appName: dcae-tca + tcaAlertsAbatementTableName: TCAAlertsAbatementTable + tcaAlertsAbatementTableTTLSeconds: '1728000' + tcaSubscriberOutputStreamName: TCASubscriberOutputStream + tcaVESAlertsTableName: TCAVESAlertsTable + tcaVESAlertsTableTTLSeconds: '1728000' + tcaVESMessageStatusTableName: TCAVESMessageStatusTable + tcaVESMessageStatusTableTTLSeconds: '86400' + thresholdCalculatorFlowletInstances: '2' + app_preferences: + aaiEnrichmentHost: + get_input: aaiEnrichmentHost + aaiEnrichmentIgnoreSSLCertificateErrors: 'true' + aaiEnrichmentPortNumber: '8443' + aaiEnrichmentProtocol: https + aaiEnrichmentUserName: DCAE + aaiEnrichmentUserPassword: DCAE + aaiVMEnrichmentAPIPath: /aai/v11/search/nodes-query + aaiVNFEnrichmentAPIPath: /aai/v11/network/generic-vnfs/generic-vnf + enableAAIEnrichment: + get_input: enableAAIEnrichment + enableAlertCEFFormat: 'false' + publisherContentType: application/json + publisherHostName: + get_input: publisherHostName + publisherHostPort: '3904' + publisherMaxBatchSize: '1' + publisherMaxRecoveryQueueSize: '100000' + publisherPollingInterval: '20000' + publisherProtocol: http + publisherTopicName: unauthenticated.DCAE_CL_OUTPUT + subscriberConsumerGroup: OpenDCAE-c12 + subscriberConsumerId: c12 + subscriberContentType: application/json + subscriberHostName: + get_input: subscriberHostName + subscriberHostPort: '3904' + subscriberMessageLimit: '-1' + subscriberPollingInterval: '30000' + subscriberProtocol: http + subscriberTimeoutMS: '-1' + subscriberTopicName: unauthenticated.VES_MEASUREMENT_OUTPUT + 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.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"}]}]}' + artifact_name: dcae-analytics-cdap-tca + artifact_version: 2.0.0 + connections: + streams_publishes: [] + streams_subscribes: [] + jar_url: https://nexus.onap.org/service/local/repositories/releases/content/org/onap/dcaegen2/analytics/tca/dcae-analytics-cdap-tca/2.0.0/dcae-analytics-cdap-tca-2.0.0.jar + namespace: cdap_tca_hi_lo + programs: + - program_id: TCAVESCollectorFlow + program_type: flows + - program_id: TCADMaaPMRSubscriberWorker + program_type: workers + - program_id: TCADMaaPMRPublisherWorker + program_type: workers + service_component_type: cdap_app_tca + streamname: TCASubscriberOutputStream + interfaces: + cloudify.interfaces.lifecycle: + create: + inputs: + connected_broker_dns_name: + get_input: connected_broker_dns_name + diff --git a/reference_templates/tcadocker-service.yaml-template b/reference_templates/tcadocker-service.yaml-template new file mode 100644 index 0000000..92deaa4 --- /dev/null +++ b/reference_templates/tcadocker-service.yaml-template @@ -0,0 +1,192 @@ +# +# ============LICENSE_START==================================================== +# org.onap.dcae +# ============================================================================= +# Copyright (c) 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: + - "http://www.getcloudify.org/spec/cloudify/3.4/types.yaml" + - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/dockerplugin/3.2.1/dockerplugin_types.yaml" + - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_types.yaml" + - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/dcaepolicyplugin/2.3.0/dcaepolicyplugin_types.yaml" +inputs: + aaiEnrichmentHost: + default: none + type: string + aaiEnrichmentPort: + default: 8443 + type: string + cbs_host: + default: config-binding-service.dcae + type: string + cbs_port: + default: "10000" + type: string + consul_host: + default: consul-server.onap-consul + type: string + consul_port: + default: "8500" + type: string + dh_location_id: + default: zone1 + type: string + dh_override: + default: component_dockerhost + type: string + dmaap_host: + default: dmaap.onap-message-router + type: string + dmaap_port: + default: 3904 + type: string + enableAAIEnrichment: + default: false + type: string + enableRedisCaching: + default: false + type: string + external_port: + default: "32016" + description: "Port for CDAPgui to be exposed" + type: string + policy_id: + default: none + type: string + redisHosts: + type: string + tag_version: + default: "{{ ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_releases }}/onap/org.onap.dcaegen2.deployments.tca-cdap-container:1.0.0" + type: string +node_templates: + docker_service_host: + properties: + docker_host_override: + get_input: dh_override + location_id: + get_input: dh_location_id + type: dcae.nodes.SelectedDockerHost + tca_docker: + interfaces: + cloudify.interfaces.lifecycle: + start: + inputs: + envs: + AAIHOST: + get_input: aaiEnrichmentHost + AAIPORT: + get_input: aaiEnrichmentPort + CBS_HOST: + get_input: cbs_host + CBS_PORT: + get_input: cbs_port + CONFIG_BINDING_SERVICE: config_binding_service + CONSUL_HOST: + get_input: consul_host + CONSUL_PORT: + get_input: consul_port + DMAAPHOST: + get_input: dmaap_host + DMAAPPORT: + get_input: dmaap_port + DMAAPPUBTOPIC: unauthenticated.DCAE_CL_OUTPUT + DMAAPSUBTOPIC: unauthenticated.VES_MEASUREMENT_OUTPUT +# SERVICE_11011_IGNORE: "true" + SERVICE_11015_IGNORE: "true" + ports: + - concat: ["11011:", { get_input: external_port }] + stop: + inputs: + cleanup_image: true + properties: + application_config: + app_config: + appDescription: "DCAE Analytics Threshold Crossing Alert Application" + appName: dcae-tca + tcaAlertsAbatementTableName: TCAAlertsAbatementTable + tcaAlertsAbatementTableTTLSeconds: "1728000" + tcaSubscriberOutputStreamName: TCASubscriberOutputStream + tcaVESAlertsTableName: TCAVESAlertsTable + tcaVESAlertsTableTTLSeconds: "1728000" + tcaVESMessageStatusTableName: TCAVESMessageStatusTable + tcaVESMessageStatusTableTTLSeconds: "86400" + thresholdCalculatorFlowletInstances: "2" + app_preferences: + aaiEnrichmentHost: + get_input: aaiEnrichmentHost + aaiEnrichmentIgnoreSSLCertificateErrors: "true" + aaiEnrichmentPortNumber: "8443" + aaiEnrichmentProtocol: https + aaiEnrichmentUserName: DCAE + aaiEnrichmentUserPassword: DCAE + aaiVMEnrichmentAPIPath: /aai/v11/search/nodes-query + aaiVNFEnrichmentAPIPath: /aai/v11/network/generic-vnfs/generic-vnf + enableAAIEnrichment: + get_input: enableAAIEnrichment + enableAlertCEFFormat: "false" + enableRedisCaching: + get_input: enableRedisCaching + publisherContentType: application/json + publisherHostName: + get_input: dmaap_host + publisherHostPort: + get_input: dmaap_port + publisherMaxBatchSize: "1" + publisherMaxRecoveryQueueSize: "100000" + publisherPollingInterval: "20000" + publisherProtocol: http + publisherTopicName: unauthenticated.DCAE_CL_OUTPUT + redisHosts: + get_input: redisHosts + subscriberConsumerGroup: OpenDCAE-c12 + subscriberConsumerId: c12 + subscriberContentType: application/json + subscriberHostName: + get_input: dmaap_host + subscriberHostPort: + get_input: dmaap_port + subscriberMessageLimit: "-1" + subscriberPollingInterval: "30000" + subscriberProtocol: http + subscriberTimeoutMS: "-1" + subscriberTopicName: unauthenticated.VES_MEASUREMENT_OUTPUT + 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.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\"}]}]}" + docker_config: + healthcheck: + endpoint: / + interval: 15s + timeout: 1s + type: http + image: + get_input: tag_version + service_component_type: dcaegen2-analytics_tca + relationships: + - + target: docker_service_host + type: dcae.relationships.component_contained_in + - + target: tca_policy + type: cloudify.relationships.depends_on + type: dcae.nodes.DockerContainerForComponentsUsingDmaap + tca_policy: + properties: + policy_id: + get_input: policy_id + type: dcae.nodes.policy + diff --git a/reference_templates/test_dr_mr.yaml-template b/reference_templates/test_dr_mr.yaml-template new file mode 100644 index 0000000..4667186 --- /dev/null +++ b/reference_templates/test_dr_mr.yaml-template @@ -0,0 +1,121 @@ +# ================================================================================ +# Copyright (c) 2019 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.4.13/k8splugin_types.yaml + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/dmaap/dmaap.yaml + +inputs: + topic00_name: + type: string + default: "topic00" + feed00_name: + type: string + default: "feed00" + feed00_desc: + type: string + default: "Test feed from orchestrator" + location: + type: string + default: "san-francisco" + username: + type: string + default: "drdeliver" + password: + type: string + default: "1loveDataR0uter" + delivery_url: + type: string + default: "https://example.com/whatever" + +node_templates: + + feed00: + type: ccsdk.nodes.Feed + properties: + feed_name: { get_input: feed00_name } + feed_description: { get_input: feed00_desc } + feed_version: 7.0.19 + aspr_classification: "unclassified" + + topic00: + type: ccsdk.nodes.Topic + properties: + topic_name: { get_input: topic00_name } + + + client00: + type: dcae.nodes.ContainerizedServiceComponentUsingDmaap + + properties: + service_component_type: 'nginx-web' + image: nginx + docker_config: + healthcheck: + type: "http" + endpoint: "/" + streams_publishes: + - name: feed00 + location: { get_input: location } + client_role: org.onap.dcae.pnfPublisher + type: data_router + username: { get_input: username } + password: { get_input: password } + delivery_url: { get_input: delivery_url } + streams_subscribes: + - name: topic00 + location: { get_input: location } + client_role: org.onap.dcae.pnfSubscriber + type: message_router + + relationships: + - type: ccsdk.relationships.publish_files + target: feed00 + - type: ccsdk.relationships.subscribe_to_events + target: topic00 + + interfaces: + cloudify.interfaces.lifecycle: + start: + inputs: + ports: + - '80:0' + +outputs: + + feed00_publish_url: + description: "Feed 00 publish URL" + value: { get_attribute: [feed00, publish_url]} + + feed00_logurl: + description: "Feed 00 logging URL" + value: { get_attribute: [feed00, log_url]} + + feed00_feed_id: + description: "Feed 00 feed id" + value: { get_attribute: [feed00, feed_id]} + + client00_feed00: + description: "Feed 00 data on client00" + value: { get_attribute: [client00, feed00]} + + client00_topic00: + description: "Topic 00 data on client00" + value: { get_attribute: [client00, topic00]} + diff --git a/reference_templates/test_dr_pubsub.yaml-template b/reference_templates/test_dr_pubsub.yaml-template new file mode 100644 index 0000000..dfde13a --- /dev/null +++ b/reference_templates/test_dr_pubsub.yaml-template @@ -0,0 +1,145 @@ +# ================================================================================ +# Copyright (c) 2019 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.4.13/k8splugin_types.yaml + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/dmaap/dmaap.yaml + +inputs: + feed00_name: + type: string + default: "feed00" + feed00_desc: + type: string + default: "Test feed from orchestrator" + location: + type: string + default: "san-francisco" + username: + type: string + default: "drdeliver" + password: + type: string + default: "1loveDataR0uter" + delivery_url: + type: string + default: "https://example.com/whatever" + +node_templates: + + feed00: + type: ccsdk.nodes.Feed + properties: + feed_name: { get_input: feed00_name } + feed_description: { get_input: feed00_desc } + feed_version: 1.0.9 + aspr_classification: "unclassified" + + client00: + type: dcae.nodes.ContainerizedServiceComponentUsingDmaap + + properties: + service_component_type: 'nginx-web' + image: nginx + docker_config: + healthcheck: + type: "http" + endpoint: "/" + streams_publishes: + - name: feed00 + location: { get_input: location } + client_role: org.onap.dcae.pnfPublisher + type: data_router + username: { get_input: username } + password: { get_input: password } + delivery_url: { get_input: delivery_url } + + relationships: + - type: ccsdk.relationships.publish_files + target: feed00 + + interfaces: + cloudify.interfaces.lifecycle: + start: + inputs: + ports: + - '80:0' + + client01: + type: dcae.nodes.ContainerizedServiceComponentUsingDmaap + + properties: + service_component_type: 'nginx-web' + image: nginx + docker_config: + healthcheck: + type: "http" + endpoint: "/" + application_config: + isSelfServeComponent: false + services_calls: {} + streams_subscribes: + ONAP-TEST-SUB-DR: + dmaap_info: <> + type: data_router + streams_subscribes: + - name: feed00 + location: { get_input: location } + client_role: org.onap.dcae.pnfSubscriber + type: data_router + route: ONAP-TEST-SUB-DR + username: { get_input: username } + password: { get_input: password } + delivery_url: { get_input: delivery_url } + + relationships: + - type: ccsdk.relationships.subscribe_to_files + target: feed00 + + interfaces: + cloudify.interfaces.lifecycle: + start: + inputs: + ports: + - '80:0' + + +outputs: + + feed00_publish_url: + description: "Feed 00 publish URL" + value: { get_attribute: [feed00, publish_url]} + + feed00_logurl: + description: "Feed 00 logging URL" + value: { get_attribute: [feed00, log_url]} + + feed00_feed_id: + description: "Feed 00 feed id" + value: { get_attribute: [feed00, feed_id]} + + client00_feed00: + description: "Feed 00 data on client00" + value: { get_attribute: [client00, feed00]} + + client01_feed00: + description: "Feed 00 data on client01" + value: { get_attribute: [client01, feed00]} + + diff --git a/reference_templates/test_mr_multipub.yaml-template b/reference_templates/test_mr_multipub.yaml-template new file mode 100644 index 0000000..84ae247 --- /dev/null +++ b/reference_templates/test_mr_multipub.yaml-template @@ -0,0 +1,178 @@ +# ================================================================================ +# Copyright (c) 2019 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.4.13/k8splugin_types.yaml + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/dmaap/dmaap.yaml + +inputs: + topic00_name: + type: string + default: "topic00" + topic01_name: + type: string + default: "topic01" + topic02_name: + type: string + default: "topic02" + topic03_name: + type: string + default: "topic03" + topic04_name: + type: string + default: "topic04" + topic05_name: + type: string + default: "topic05" + topic06_name: + type: string + default: "topic06" + location: + type: string + default: "san-francisco" + +node_templates: + + topic00: + type: ccsdk.nodes.Topic + properties: + topic_name: { get_input: topic00_name } + + topic01: + type: ccsdk.nodes.Topic + properties: + topic_name: { get_input: topic01_name } + + topic02: + type: ccsdk.nodes.Topic + properties: + topic_name: { get_input: topic02_name } + + topic03: + type: ccsdk.nodes.Topic + properties: + topic_name: { get_input: topic03_name } + + topic04: + type: ccsdk.nodes.Topic + properties: + topic_name: { get_input: topic04_name } + + topic05: + type: ccsdk.nodes.Topic + properties: + topic_name: { get_input: topic05_name } + + topic06: + type: ccsdk.nodes.Topic + properties: + topic_name: { get_input: topic06_name } + + client00: + type: dcae.nodes.ContainerizedServiceComponentUsingDmaap + + properties: + service_component_type: 'nginx-web' + image: nginx + docker_config: + healthcheck: + type: "http" + endpoint: "/" + streams_publishes: + - name: topic00 + location: { get_input: location } + client_role: org.onap.dcae.pnfPublisher + type: message_router + - name: topic01 + location: { get_input: location } + client_role: org.onap.dcae.pnfPublisher + type: message_router + - name: topic02 + location: { get_input: location } + client_role: org.onap.dcae.pnfPublisher + type: message_router + - name: topic03 + location: { get_input: location } + client_role: org.onap.dcae.pnfPublisher + type: message_router + - name: topic04 + location: { get_input: location } + client_role: org.onap.dcae.pnfPublisher + type: message_router + - name: topic05 + location: { get_input: location } + client_role: org.onap.dcae.pnfPublisher + type: message_router + - name: topic06 + location: { get_input: location } + client_role: org.onap.dcae.pnfPublisher + type: message_router + + relationships: + - type: ccsdk.relationships.publish_events + target: topic00 + - type: ccsdk.relationships.publish_events + target: topic01 + - type: ccsdk.relationships.publish_events + target: topic02 + - type: ccsdk.relationships.publish_events + target: topic03 + - type: ccsdk.relationships.publish_events + target: topic04 + - type: ccsdk.relationships.publish_events + target: topic05 + - type: ccsdk.relationships.publish_events + target: topic06 + + interfaces: + cloudify.interfaces.lifecycle: + start: + inputs: + ports: + - '80:0' + +outputs: + topic00_data: + description: "Topic 00 data on client00" + value: { get_attribute: [client00, topic00]} + + topic01_data: + description: "Topic 01 data on client00" + value: { get_attribute: [client00, topic01]} + + topic02_data: + description: "Topic 02 data on client00" + value: { get_attribute: [client00, topic02]} + + topic03_data: + description: "Topic 03 data on client00" + value: { get_attribute: [client00, topic03]} + + topic04_data: + description: "Topic 04 data on client00" + value: { get_attribute: [client00, topic04]} + + topic05_data: + description: "Topic 05 data on client00" + value: { get_attribute: [client00, topic05]} + + topic06_data: + description: "Topic 06 data on client00" + value: { get_attribute: [client00, topic06]} + diff --git a/reference_templates/test_mr_multisub.yaml-template b/reference_templates/test_mr_multisub.yaml-template new file mode 100644 index 0000000..ad84a9c --- /dev/null +++ b/reference_templates/test_mr_multisub.yaml-template @@ -0,0 +1,186 @@ +# ================================================================================ +# Copyright (c) 2019 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.4.13/k8splugin_types.yaml + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/dmaap/dmaap.yaml + +inputs: + topic00_name: + type: string + default: "topic00" + topic01_name: + type: string + default: "topic01" + topic02_name: +inputs: + topic00_name: + type: string + default: "topic00" + topic01_name: + type: string + default: "topic01" + topic02_name: + type: string + default: "topic02" + topic03_name: + type: string + default: "topic03" + topic04_name: + type: string + default: "topic04" + topic05_name: + type: string + default: "topic05" + topic06_name: + type: string + default: "topic06" + location: + type: string + default: "san-francisco" + +node_templates: + + topic00: + type: ccsdk.nodes.Topic + properties: + topic_name: { get_input: topic00_name } + + topic01: + type: ccsdk.nodes.Topic + properties: + topic_name: { get_input: topic01_name } + + topic02: + type: ccsdk.nodes.Topic + properties: + topic_name: { get_input: topic02_name } + + topic03: + type: ccsdk.nodes.Topic + properties: + topic_name: { get_input: topic03_name } + + topic04: + type: ccsdk.nodes.Topic + properties: + topic_name: { get_input: topic04_name } + + topic05: + type: ccsdk.nodes.Topic + properties: + topic_name: { get_input: topic05_name } + + topic06: + type: ccsdk.nodes.Topic + properties: + topic_name: { get_input: topic06_name } + + client00: + type: dcae.nodes.ContainerizedServiceComponentUsingDmaap + + properties: + service_component_type: 'nginx-web' + image: nginx + docker_config: + healthcheck: + type: "http" + endpoint: "/" + streams_subscribes: + - name: topic00 + location: { get_input: location } + client_role: org.onap.dcae.pnfPublisher + type: message_router + - name: topic01 + location: { get_input: location } + client_role: org.onap.dcae.pnfPublisher + type: message_router + - name: topic02 + location: { get_input: location } + client_role: org.onap.dcae.pnfPublisher + type: message_router + - name: topic03 + location: { get_input: location } + client_role: org.onap.dcae.pnfPublisher + type: message_router + - name: topic04 + location: { get_input: location } + client_role: org.onap.dcae.pnfPublisher + type: message_router + - name: topic05 + location: { get_input: location } + client_role: org.onap.dcae.pnfPublisher + type: message_router + - name: topic06 + location: { get_input: location } + client_role: org.onap.dcae.pnfPublisher + type: message_router + + relationships: + - type: ccsdk.relationships.subscribe_to_events + target: topic00 + - type: ccsdk.relationships.subscribe_to_events + target: topic01 + - type: ccsdk.relationships.subscribe_to_events + target: topic02 + - type: ccsdk.relationships.subscribe_to_events + target: topic03 + - type: ccsdk.relationships.subscribe_to_events + target: topic04 + - type: ccsdk.relationships.subscribe_to_events + target: topic05 + - type: ccsdk.relationships.subscribe_to_events + target: topic06 + + interfaces: + cloudify.interfaces.lifecycle: + start: + inputs: + ports: + - '80:0' + +outputs: + topic00_data: + description: "Topic 00 data on client00" + value: { get_attribute: [client00, topic00]} + + topic01_data: + description: "Topic 01 data on client00" + value: { get_attribute: [client00, topic01]} + + topic02_data: + description: "Topic 02 data on client00" + value: { get_attribute: [client00, topic02]} + + topic03_data: + description: "Topic 03 data on client00" + value: { get_attribute: [client00, topic03]} + + topic04_data: + description: "Topic 04 data on client00" + value: { get_attribute: [client00, topic04]} + + topic05_data: + description: "Topic 05 data on client00" + value: { get_attribute: [client00, topic05]} + + topic06_data: + description: "Topic 06 data on client00" + value: { get_attribute: [client00, topic06]} + diff --git a/reference_templates/test_mr_pubsub.yaml-template b/reference_templates/test_mr_pubsub.yaml-template new file mode 100644 index 0000000..0d09216 --- /dev/null +++ b/reference_templates/test_mr_pubsub.yaml-template @@ -0,0 +1,89 @@ +# ================================================================================ +# Copyright (c) 2019 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.4.13/k8splugin_types.yaml + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/dmaap/dmaap.yaml + +inputs: + topic00_name: + type: string + default: "topic00" + topic01_name: + type: string + default: "topic01" + location: + type: string + default: "san-francisco" + +node_templates: + + topic00: + type: ccsdk.nodes.Topic + properties: + topic_name: { get_input: topic00_name } + + topic01: + type: ccsdk.nodes.Topic + properties: + topic_name: { get_input: topic01_name } + + web_server: + type: dcae.nodes.ContainerizedServiceComponentUsingDmaap + + properties: + service_component_type: 'nginx-web' + image: nginx + docker_config: + healthcheck: + type: "http" + endpoint: "/" + streams_publishes: + - name: topic00 + location: { get_input: location } + client_role: org.onap.dcae.pnfPublisher + type: message_router + streams_subscribes: + - name: topic01 + location: { get_input: location } + client_role: org.onap.dcae.pnfSubscriber + type: message_router + + relationships: + - type: ccsdk.relationships.publish_events + target: topic00 + - type: ccsdk.relationships.subscribe_to_events + target: topic01 + + interfaces: + cloudify.interfaces.lifecycle: + start: + inputs: + ports: + - '80:0' +outputs: + + topic00_data: + description: "Topic 00 data on client00" + value: { get_attribute: [web_server, topic00]} + + topic01_data: + description: "Topic 01 data on client00" + value: { get_attribute: [web_server, topic01]} + diff --git a/reference_templates/test_mr_pubsub_extra.yaml-template b/reference_templates/test_mr_pubsub_extra.yaml-template new file mode 100644 index 0000000..f034e6c --- /dev/null +++ b/reference_templates/test_mr_pubsub_extra.yaml-template @@ -0,0 +1,93 @@ +# ================================================================================ +# Copyright (c) 2019 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.4.13/k8splugin_types.yaml + - {{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/dmaap/dmaap.yaml + +inputs: + topic00_name: + type: string + default: "topic00" + topic01_name: + type: string + default: "topic01" + location: + type: string + default: "san-francisco" + +node_templates: + + topic00: + type: ccsdk.nodes.Topic + properties: + topic_name: { get_input: topic00_name } + replication_case: REPLICATION_EDGE_TO_CENTRAL_TO_GLOBAL + global_mr_url: message-router + + topic01: + type: ccsdk.nodes.Topic + properties: + topic_name: { get_input: topic01_name } + replication_case: REPLICATION_EDGE_TO_CENTRAL + + client00: + type: dcae.nodes.ContainerizedServiceComponentUsingDmaap + + properties: + service_component_type: 'nginx-web' + image: nginx + docker_config: + healthcheck: + type: "http" + endpoint: "/" + streams_publishes: + - name: topic00 + location: { get_input: location } + client_role: org.onap.dcae.pnfPublisher + type: message_router + streams_subscribes: + - name: topic01 + location: { get_input: location } + client_role: org.onap.dcae.pnfSubscriber + type: message_router + + relationships: + - type: ccsdk.relationships.publish_events + target: topic00 + - type: ccsdk.relationships.subscribe_to_events + target: topic01 + + interfaces: + cloudify.interfaces.lifecycle: + start: + inputs: + ports: + - '80:0' + +outputs: + + topic00_data: + description: "Topic 00 data on client00" + value: { get_attribute: [client00, topic00]} + + topic01_data: + description: "Topic 01 data on client00" + value: { get_attribute: [client00, topic01]} + diff --git a/reference_templates/ves.yaml-template b/reference_templates/ves.yaml-template new file mode 100644 index 0000000..0653e3d --- /dev/null +++ b/reference_templates/ves.yaml-template @@ -0,0 +1,135 @@ +# -*- 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 }}/type_files/dockerplugin/2/dockerplugin_types.yaml" + - "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/relationshipplugin/1.0.0/relationshipplugin_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.VES_MEASUREMENT_OUTPUT" + ves_notification_publish_url: + type: string + default: "http://10.0.11.1:3904/events/unauthenticated.VES_NOTIFICATION_OUTPUT" + ves_pnfRegistration_publish_url: + type: string + default: "http://10.0.11.1:3904/events/unauthenticated.VES_PNFREG_OUTPUT" + dh_override: + type: string + default: "component_dockerhost" + dh_location_id: + type: string + default: "zone1" + tag_version: + type: string + default: "nexus3.onap.org:10001/onap/org.onap.dcaegen2.collectors.ves.vescollector:1.3.1" + +node_templates: + docker_collector_host: + properties: + docker_host_override: + get_input: dh_override + location_id: + get_input: dh_location_id + type: dcae.nodes.SelectedDockerHost + ves: + interfaces: + cloudify.interfaces.lifecycle: + stop: + inputs: + cleanup_image: true + start: + inputs: + ports: + - '8080:8080' + properties: + 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|notification=ves-notification|pnfRegistration=ves-pnfRegistration + 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\",\"v7\":\"./etc/CommonEventFormat_30.0.1.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 + ves-notification: + dmaap_info: + topic_url: + get_input: ves_notification_publish_url + type: message_router + ves-pnfRegistration: + dmaap_info: + topic_url: + get_input: ves_pnfRegistration_publish_url + type: message_router + ves-heartbeat: + dmaap_info: + topic_url: + get_input: ves_heartbeat_publish_url + type: message_router + ves-other: + dmaap_info: + topic_url: + get_input: ves_other_publish_url + type: message_router + collector.dynamic.config.update.frequency: "5" + docker_config: + healthcheck: + endpoint: /healthcheck + interval: 15s + timeout: 1s + type: http + image: + get_input: tag_version + service_component_type: dcaegen2-collectors-ves + relationships: + - type: dcae.relationships.component_contained_in + target: docker_collector_host + type: dcae.nodes.DockerContainerForComponentsUsingDmaap diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh new file mode 100755 index 0000000..e47ccd6 --- /dev/null +++ b/scripts/bootstrap.sh @@ -0,0 +1,233 @@ +#!/bin/bash +# ================================================================================ +# Copyright (c) 2018-2020 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========================================================= + +# Install DCAE via Cloudify Manager +# Expects: +# CM address (IP or DNS) in CMADDR environment variable +# CM password in CMPASS environment variable (assumes user is "admin") +# ONAP common Kubernetes namespace in ONAP_NAMESPACE environment variable +# If DCAE components are deployed in a separate Kubernetes namespace, that namespace in DCAE_NAMESPACE variable. +# Consul address with port in CONSUL variable +# Plugin wagon files in /wagons +# Blueprints for components to be installed in /blueprints +# Input files for components to be installed in /inputs +# Configuration JSON files that need to be loaded into Consul in /dcae-configs +# Consul is installed in /opt/consul/bin/consul, with base config in /opt/consul/config/00consul.json +# Optionally, allows: +# CM protocol in CMPROTO environment variable (defaults to HTTP) +# CM port in CMPORT environment variable (defaults to 80) +# If CMPROTO is set to "https", bootstrap will use HTTPS to communicate with CM. Otherwise, +# it will use HTTP. +# If CMPROTO is set to "https", the script assumes the CA cert needed to verify the cert +# presented by CM is mounted at /certs/cacert.pem. + +# Set defaults for CM protocol and port +CMPROTO=${CMPROTO:-http} +CMPORT=${CMPORT:-80} + +# Set up additional parameters for using HTTPS +CFYTLS="" +CURLTLS="" +if [ $CMPROTO = "https" ] +then + CFYTLS="--rest-certificate /certs/cacert.pem --ssl" + CURLTLS="--cacert /certs/cacert.pem" +fi + +### FUNCTION DEFINITIONS ### + +# keep_running: Keep running after bootstrap finishes or after error +keep_running() { + echo $1 + sleep infinity & + wait +} + +# cm_hasany: Query Cloudify Manager and return 0 (true) if there are any entities matching the query +# Used to see if something is already present on CM +# $1 -- query fragment, for instance "plugins?archive_name=xyz.wgn" to get +# the number of plugins that came from the archive file "xyz.wgn" +function cm_hasany { + # We use _include=id to limit the amount of data the CM sends back + # We rely on the "metadata.pagination.total" field in the response + # for the total number of matching entities + COUNT=$(curl -Ss -H "Tenant: default_tenant" --user admin:${CMPASS} ${CURLTLS} "${CMPROTO}://${CMADDR}:${CMPORT}/api/v3.1/$1&_include=id" \ + | /bin/jq .metadata.pagination.total) + if (( $COUNT > 0 )) + then + return 0 + else + return 1 + fi +} + +# deploy: Deploy components if they're not already deployed +# $1 -- name (for bp and deployment) +# $2 -- blueprint file name +# $3 -- inputs file name (optional) +function deploy { + # Don't crash the script on error + set +e + + # Upload blueprint if it's not already there + if cm_hasany "blueprints?id=$1" + then + echo blueprint $1 is already installed on ${CMADDR} + else + cfy blueprints upload -b $1 /blueprints/$2 + fi + + # Create deployment if it doesn't already exist + if cm_hasany "deployments?id=$1" + then + echo deployment $1 has already been created on ${CMADDR} + else + INPUTS= + if [ -n "$3" ] + then + INPUTS="-i/inputs/$3" + fi + cfy deployments create -b $1 ${INPUTS} $1 + fi + + # Run the install workflow if it hasn't been run already + # We don't have a completely certain way of determining this. + # We check to see if the deployment has any node instances + # that are in the 'uninitialized' or 'deleted' states. (Note that + # the & in the query acts as a logical OR for the multiple state values.) + # We'll try to install when a deployment has node instances in those states + if cm_hasany "node-instances?deployment_id=$1&state=uninitialized&state=deleted" + then + cfy executions start -d $1 install + else + echo deployment $1 appears to have had an install workflow executed already or is not ready for an install + fi +} + +# Install plugin if it's not already installed +# $1 -- path to wagon file for plugin +function install_plugin { + ARCHIVE=$(basename $1) + # See if it's already installed + if cm_hasany "plugins?archive_name=$ARCHIVE" + then + echo plugin $1 already installed on ${CMADDR} + else + cfy plugin upload $1 + fi +} + +### END FUNCTION DEFINTIONS ### + +set -x + +# Make sure we keep the container alive after an error +trap keep_running ERR + +set -e + +# Consul service registration data +CBS_REG='{"ID": "dcae-cbs0", "Name": "config_binding_service", "Address": "config-binding-service", "Port": 10000}' +CBS_REG1='{"ID": "dcae-cbs1", "Name": "config-binding-service", "Address": "config-binding-service", "Port": 10000}' + +# Set up profile to access Cloudify Manager +cfy profiles use -u admin -t default_tenant -p "${CMPASS}" ${CFYTLS} "${CMADDR}" + +# Output status, for debugging purposes +cfy status + +# Check Consul readiness +# The readiness container waits for a "consul-server" container to be ready, +# but this isn't always enough. We need the Consul API to be up and for +# the cluster to be formed, otherwise our Consul accesses might fail. +# (Note in ONAP R2, we never saw a problem, but occasionally in R3 we +# have seen Consul not be fully ready, so we add these checks, originally +# used in the R1 HEAT-based deployment.) +# Wait for Consul API to come up +until curl http://${CONSUL}/v1/agent/services +do + echo Waiting for Consul API + sleep 60 +done +# Wait for a leader to be elected +until [[ "$(curl -Ss http://{$CONSUL}/v1/status/leader)" != '""' ]] +do + echo Waiting for leader + sleep 30 +done + +# Load configurations into Consul KV store +for config in /dcae-configs/*.json +do + # The basename of the file is the Consul key + key=$(basename ${config} .json) + # Strip out comments, empty lines + egrep -v "^#|^$" ${config} > /tmp/dcae-upload + curl -v -X PUT -H "Content-Type: application/json" --data-binary @/tmp/dcae-upload ${CONSUL}/v1/kv/${key} +done + +# Put service registrations into the local Consul configuration directory +for sr in CBS_REG CBS_REG1 +do + echo '{"service" : ' ${!sr} ' }'> /opt/consul/config/${sr}.json +done + +# Start the local consul agent instance +/opt/consul/bin/consul agent --config-dir /opt/consul/config 2>&1 | tee /opt/consul/consul.log & + +# Store the CM password into a Cloudify secret +cfy secret create -s ${CMPASS} cmpass + +# Load plugins onto CM +for wagon in /wagons/*.wgn +do + install_plugin ${wagon} +done + +# In some oversubscribed cloud environments, we have +# observed that even though the plugin installations appear +# to have completed, there are background installation tasks +# that might still be running. So we check for running system workflows +while cm_hasany "executions?is_system_workflow=true&status=pending&status=started&status=queued&status=scheduled" +do + echo "Waiting for running system workflows to complete" + sleep 15 +done + +# After this point, failures should not stop the script or block later commands +trap - ERR +set +e + +# Initialize the DCAE postgres instance +deploy pgaas_initdb k8s-pgaas-initdb.yaml k8s-pgaas-initdb-inputs.yaml + +# Deploy service components +# tca, ves, prh, hv-ves, datafile-collector can be deployed simultaneously +deploy tca k8s-tca.yaml k8s-tca-inputs.yaml & +deploy ves k8s-ves.yaml k8s-ves-inputs.yaml & +deploy prh k8s-prh.yaml k8s-prh-inputs.yaml & +deploy hv-ves k8s-hv-ves.yaml k8s-hv_ves-inputs.yaml & +# holmes_rules must be deployed before holmes_engine, but holmes_rules can go in parallel with other service components +deploy holmes_rules k8s-holmes-rules.yaml k8s-holmes_rules-inputs.yaml +deploy holmes_engine k8s-holmes-engine.yaml k8s-holmes_engine-inputs.yaml + +# Display deployments, for debugging purposes +cfy deployments list + +# Continue running +keep_running "Finished bootstrap steps." +echo "Exiting!" diff --git a/scripts/load-plugins.sh b/scripts/load-plugins.sh new file mode 100755 index 0000000..c67258e --- /dev/null +++ b/scripts/load-plugins.sh @@ -0,0 +1,62 @@ +#!/bin/bash +# ============LICENSE_START======================================================= +# org.onap.dcae +# ================================================================================ +# Copyright (c) 2018-2020 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 is a trademark and service mark of AT&T Intellectual Property. + +# Pull plugin archives from repos +# $1 is the DCAE repo URL +# $2 is the CCSDK repo URL +# (This script runs at Docker image build time) +# +set -x +set -e +DEST=wagons + +# For DCAE, starting in R5, we pull down wagons directly +DCAEPLUGINFILES=\ +"\ +k8splugin/1.7.2/k8splugin-1.7.2-py27-none-linux_x86_64.wgn +relationshipplugin/1.1.0/relationshipplugin-1.1.0-py27-none-linux_x86_64.wgn +clamppolicyplugin/1.1.0/clamppolicyplugin-1.1.0-py27-none-linux_x86_64.wgn +dcaepolicyplugin/2.4.0/dcaepolicyplugin-2.4.0-py27-none-linux_x86_64.wgn \ +" + +# For CCSDK, we pull down the wagon files directly +CCSDKPLUGINFILES=\ +"\ +plugins/pgaas-1.1.0-py27-none-any.wgn +plugins/dmaap-1.3.5-py27-none-any.wgn +plugins/sshkeyshare-1.0.0-py27-none-any.wgn +plugins/helm-4.0.0-py27-none-linux_x86_64.wgn +" + +# Copy a set of wagons from a repo +# $1 -- repo baseURL +# $2 -- list of paths to wagons in the repo +function get_wagons { + for wagon in $2 + do + target=$(basename ${wagon}) + curl -Ssf $1/${wagon} > ${DEST}/${target} + done +} + +mkdir ${DEST} +get_wagons $1 "${DCAEPLUGINFILES}" +get_wagons $2 "${CCSDKPLUGINFILES}" diff --git a/scripts/uninstall.sh b/scripts/uninstall.sh new file mode 100755 index 0000000..71f8161 --- /dev/null +++ b/scripts/uninstall.sh @@ -0,0 +1,36 @@ +#!/bin/bash +# ================================================================================ +# Copyright (c) 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========================================================= + +# Clean up DCAE during ONAP uninstall + +set -x +set +e + +# Leave the Consul cluster +/opt/consul/bin/consul leave + +# Uninstall components managed by Cloudify +# Get the list of deployment ids known to Cloudify via curl to Cloudify API. +# The output of the curl is JSON that looks like {"items" :[{"id": "config_binding_service"}, ...], "metadata" :{...}} +# +# jq gives us the just the deployment ids (e.g., "config_binding_service"), one per line +# +# xargs -I lets us run the cfy uninstall command once for each deployment id extracted by jq + +curl -Ss --user admin:$CMPASS -H "Tenant: default_tenant" "$CMADDR/api/v3.1/deployments?_include=id" \ +| /bin/jq .items[].id \ +| xargs -I % sh -c 'cfy uninstall %' -- cgit 1.2.3-korg