From 4503020a74255a4509acbcc0156201232e187a5d Mon Sep 17 00:00:00 2001 From: Jack Lucas Date: Sun, 25 Mar 2018 22:05:05 -0400 Subject: Add platform component blueprints Change-Id: I6224d9aa5809f373b74079d17b9bc865dd5923bf Issue-ID: DCAEGEN2-411 Signed-off-by: Jack Lucas --- .../k8s-config_binding_service.yaml-template | 54 +++++++ blueprints/k8s-deployment_handler.yaml-template | 72 +++++++++ blueprints/k8s-inventory.yaml-template | 177 +++++++++++++++++++++ blueprints/k8s-policy_handler.yaml-template | 57 +++++++ 4 files changed, 360 insertions(+) create mode 100644 blueprints/k8s-config_binding_service.yaml-template create mode 100644 blueprints/k8s-deployment_handler.yaml-template create mode 100644 blueprints/k8s-inventory.yaml-template create mode 100644 blueprints/k8s-policy_handler.yaml-template diff --git a/blueprints/k8s-config_binding_service.yaml-template b/blueprints/k8s-config_binding_service.yaml-template new file mode 100644 index 0000000..db0bc17 --- /dev/null +++ b/blueprints/k8s-config_binding_service.yaml-template @@ -0,0 +1,54 @@ +# -*- indent-tabs-mode: nil -*- # vi: set expandtab: +# +# ============LICENSE_START==================================================== +# org.onap.dcae +# ============================================================================= +# Copyright (c) 2017-2018 AT&T Intellectual Property. All rights reserved. +# ============================================================================= +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END====================================================== + +tosca_definitions_version: cloudify_dsl_1_3 + +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 }}/k8splugin/1.0.0/k8splugin_types.yaml + +inputs: + + cbs_image: + description: Docker image for config binding service + default: {{ ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_releases }}/onap/org.onap.dcaegen2.platform.configbinding:2.1 + replicas: + description: Number of instances to launch + type: integer + default: 1 + +node_templates: + # Config binding service + service-config-binding: + type: dcae.nodes.ContainerizedPlatformComponent + properties: + name: 'config-binding-service' + container_port: 10000 + image: { get_input: cbs_image } + docker_config: + healthcheck: + type: "http" + endpoint: "/healthcheck" + replicas: {get_input: replicas} + log_info: + log_directory: "/opt/logs" diff --git a/blueprints/k8s-deployment_handler.yaml-template b/blueprints/k8s-deployment_handler.yaml-template new file mode 100644 index 0000000..e2d0231 --- /dev/null +++ b/blueprints/k8s-deployment_handler.yaml-template @@ -0,0 +1,72 @@ +# -*- indent-tabs-mode: nil -*- # vi: set expandtab: +# +# ============LICENSE_START========================================== +# org.onap.dcae +# =================================================================== +# Copyright © 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 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 }}/k8splugin/1.0.0/k8splugin_types.yaml + +inputs: + + deployment_handler_image: + description: Docker image for deployment handler + default: {{ ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_releases }}/onap/org.onap.dcaegen2.platform.deployment-handler:2.0 + application_config: + description: deployment handler application configuration (to override defaults) + default: {} + host_port: + description: port on Kubernetes host where DH API will be exposed + default: 0 + 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.ContainerizedPlatformComponent + properties: + name: + 'deployment-handler' + image: + { get_input: deployment_handler_image } + application_config: + { get_input: application_config } + host_port: + { get_input: host_port } + container_port: + 8443 + docker_config: + healthcheck: + type: 'http' + interval: '300s' + timeout: '5s' + endpoint: '/' + msb_registration: + port: '8443' + url_path: '/' + version: 'v4' + log_info: + log_directory: '/opt/app/dh/log' diff --git a/blueprints/k8s-inventory.yaml-template b/blueprints/k8s-inventory.yaml-template new file mode 100644 index 0000000..663e7df --- /dev/null +++ b/blueprints/k8s-inventory.yaml-template @@ -0,0 +1,177 @@ +# -*- indent-tabs-mode: nil -*- # vi: set expandtab: +# +# ============LICENSE_START==================================================== +# org.onap.dcae +# ============================================================================= +# Copyright (c) 2017-2018 AT&T Intellectual Property. All rights reserved. +# ============================================================================= +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END====================================================== + +tosca_definitions_version: cloudify_dsl_1_3 + +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 }}/k8splugin/1.0.0/k8splugin_types.yaml + +inputs: + + asdc_address: + description: SDC host + asdc_uri: + description: SDC url + asdc_user: + description: SDC username + asdc_password: + description: SDC password + asdc_environment_name: + description: SDC environment name + asdc_use_secure_https: + description: Boolean to toggle whether to do certificate validation for https calls to SDC API + type: boolean + default: false + asdc_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.ContainerizedPlatformComponent + properties: + name: + "service-change-handler" + application_config: + asdcDistributionClient: + asdcAddress: { get_input: asdc_address } + asdcUri: { get_input: asdc_uri } + user: { get_input: asdc_user } + password: { get_input: asdc_password } + pollingInterval: 20 + pollingTimeout: 20 + consumerGroup: dcae + consumerId: dcae-sch + environmentName: { get_input: asdc_environment_name } + keyStorePath: + keyStorePassword: + activateServerTLSAuth: { get_input: asdc_use_secure_https } + useHttpsWithDmaap: { get_input: asdc_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 + + inventory: + type: dcae.nodes.ContainerizedPlatformComponent + 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 + dcaeControllerConnection: + host: dcae-controller-hostname + port: 9998 + basePath: resources + user: + password: + required: false + 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 } + container_port: + 8080 + relationships: + - type: cloudify.relationships.depends_on + target: postgres + + postgres: + type: dcae.nodes.ContainerizedApplication + properties: + name: + "pstg-write" + image: + "postgres:9.5.2" + 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:0" diff --git a/blueprints/k8s-policy_handler.yaml-template b/blueprints/k8s-policy_handler.yaml-template new file mode 100644 index 0000000..30deb6e --- /dev/null +++ b/blueprints/k8s-policy_handler.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 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 }}/k8splugin/1.0.0/k8splugin_types.yaml + + +inputs: + + policy_handler_image: + description: Docker image for policy_handler + default: '{{ ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_releases }}/onap/org.onap.dcaegen2.platform.policy-handler:v2.4.1' + + application_config: + description: policy handler application configuration - requires info on policy-engine + default: {} + +node_templates: + policy_handler: + type: dcae.nodes.ContainerizedPlatformComponent + properties: + name: 'policy_handler' + dns_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' + log_info: + log_directory: '/opt/app/policy_handler/logs' + container_port: 25577 -- cgit 1.2.3-korg