diff options
28 files changed, 2 insertions, 3010 deletions
diff --git a/TOSCA/VM/MessageRouter/MessageRouter.yaml b/TOSCA/VM/MessageRouter/MessageRouter.yaml deleted file mode 100644 index 4ae5b52167..0000000000 --- a/TOSCA/VM/MessageRouter/MessageRouter.yaml +++ /dev/null @@ -1,259 +0,0 @@ -# ============LICENSE_START========================================== -# =================================================================== -# Copyright (c) 2017 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============================================ - -########################################################### -# This Blueprint installs ONAP Message Router on Openstack -########################################################### - -tosca_definitions_version: cloudify_dsl_1_3 - -description: > - This blueprint creates a ONAP Message Router - -imports: - - http://www.getcloudify.org/spec/cloudify/4.1/types.yaml - - http://cloudify.co/spec/openstack-plugin/2.2.0/plugin.yaml - - http://cloudify.co/spec/fabric-plugin/1.5/plugin.yaml - - http://www.getcloudify.org/spec/diamond-plugin/1.3.3/plugin.yaml - -inputs: - nexus_repo: - type: string - default: https://nexus.onap.org/content/sites/raw - - docker_repo: - type: string - default: nexus3.onap.org:10001 - - nexus_username: - type: string - default: docker - - nexus_password: - type: string - default: docker - - artifacts_version: - type: string - default: 1.1.0-SNAPSHOT - - dns_ip: - type: string - - cloud_env: - type: string - default: openstack - - gerrit_branch: - type: string - default: master - - external_dns: - type: string - - mr_repo: - type: string - default: http://gerrit.onap.org/r/dcae/demo/startup/message-router.git - - vm_instancename: - type: string - - image: - description: | - A Ubuntu 14.04 image, along with the usual - type: string - default: Ubuntu 14.04 LTS Generic - - flavor: - description: > - A machine type with more than 2 CPUs, 4096 GB RAM, and 8 GB of disk space. - You might want to use 4 CPUs, 8192 MB RAM for the master. - type: string - default: m1.xlarge - - ssh_user: - description: | - User for connecting to agent VM - type: string - default: ubuntu - - security_group: - description: | - default - type: string - default: open - - keypair_name: - description: | - OpenStack keypair name - type: string - - key_filename: - type: string - - external_network: - type: string - - app_subnet: - type: string - - openstack_username: - type: string - description: username to authenticate to OpenStack - - openstack_password: - type: string - description: OpenStack tenant password for openstack_username user - - openstack_tenant_name: - type: string - description: OpenStack tenant for VM deploy - - openstack_auth_url: - type: string - description: Authentication URL for OpenStack - - openstack_region: - type: string - description: OpenStack region - -dsl_definitions: - openstack_credentials: &openstack_credentials - username: { get_input: openstack_username } - password: { get_input: openstack_password } - tenant_name: { get_input: openstack_tenant_name } - auth_url: { get_input: openstack_auth_url } - region: { get_input: openstack_region } - -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_name } - openstack_config: *openstack_credentials - - private_net: - type: cloudify.openstack.nodes.Network - properties: - use_external_resource: true - resource_id: { get_input: app_subnet } - openstack_config: *openstack_credentials - - external_network: - type: cloudify.openstack.nodes.Network - properties: - openstack_config: *openstack_credentials - use_external_resource: true - resource_id: { get_input: external_network} - - app_security_group: - type: cloudify.openstack.nodes.SecurityGroup - properties: - openstack_config: *openstack_credentials - use_external_resource: true - resource_id: { get_input: security_group } - - VM_001_fixed_ip: - type: cloudify.openstack.nodes.Port - properties: - openstack_config: *openstack_credentials - relationships: - - type: cloudify.relationships.contained_in - target: private_net - - type: cloudify.openstack.port_connected_to_security_group - target: app_security_group - - VM_001_floating_ip: - type: cloudify.openstack.nodes.FloatingIP - properties: - openstack_config: *openstack_credentials - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - floating_network_name: { get_input: external_network } - - VM_001: - type: cloudify.openstack.nodes.Server - properties: - openstack_config: *openstack_credentials - install_agent: false - image: { get_input: image } - flavor: { get_input: flavor } - resource_id: { get_input: vm_instancename } - management_network_name: { get_input: app_subnet } - ip: { get_attribute: [VM_001_floating_ip, floating_ip_address] } - relationships: - - type: cloudify.openstack.server_connected_to_floating_ip - target: VM_001_floating_ip - - type: cloudify.openstack.server_connected_to_keypair - target: key_pair - - type: cloudify.openstack.server_connected_to_port - target: VM_001_fixed_ip - - - app_001: - type: cloudify.nodes.SoftwareComponent - properties: - interfaces: - cloudify.interfaces.lifecycle: - start: - implementation: fabric.fabric_plugin.tasks.run_script - inputs: - script_path: scripts/messagerouter.sh - use_sudo: true - process: - args: - [{ get_attribute: [VM_001_floating_ip, floating_ip_address]}, - { get_attribute: [VM_001_fixed_ip, fixed_ip_address]}, - { get_input: nexus_repo }, - { get_input: docker_repo}, - { get_input: nexus_username }, - { get_input: nexus_password }, - { get_input: artifacts_version }, - { get_input: dns_ip}, - { get_input: gerrit_branch }, - openstack, - { get_input: external_dns}, - { get_input: mr_repo}] - fabric_env: - host_string: { get_attribute: [VM_001_floating_ip, floating_ip_address]} - user: { get_input: ssh_user } - key_filename: { get_input: key_filename } - relationships: - - type: cloudify.relationships.contained_in - target: VM_001 - - type: cloudify.relationships.depends_on - target: VM_001_floating_ip - -outputs: - ONAP_Message_Router: - description: informations about Messgae Router - value: - ip: { get_attribute: [VM_001_floating_ip, floating_ip_address] } - - - - - - - - diff --git a/TOSCA/VM/MessageRouter/scripts/messagerouter.sh b/TOSCA/VM/MessageRouter/scripts/messagerouter.sh deleted file mode 100644 index 081cb0bebd..0000000000 --- a/TOSCA/VM/MessageRouter/scripts/messagerouter.sh +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/sh - -# ============LICENSE_START========================================== -# =================================================================== -# Copyright (c) 2017 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============================================ - -# -PUBIP="$1" -PVTIP="$2" -NEXUS_REPO="$3" -DOCKER_REPO="$4" -NEXUS_USERNAME="$5" -NEXUS_PASSWORD="$6" -ARTIFACTS_VERSION="$7" -DNS_IP="$8" -GERRIT_BRANCH="$9" -CLOUD_ENV="$10" -EXETERNAL_DNS="$11" -MR_REPO="$12" - -export HOSTNAME=`hostname` -echo 127.0.1.1 $HOSTNAME >>/etc/hosts -echo $PVTIP $HOSTNAME >>/etc/hosts -echo $PUBIP $HOSTNAME >>/etc/hosts - - -mkdir /opt/config -chmod 777 /opt/config -echo $PUBIP > /opt/config/public_ip.txt -echo $NEXUS_REPO > /opt/config/nexus_repo.txt -echo $DOCKER_REPO > /opt/config/nexus_docker_repo.txt -echo $NEXUS_USERNAME > /opt/config/nexus_username.txt -echo $NEXUS_PASSWORD > /opt/config/nexus_password.txt -echo $ARTIFACTS_VERSION > /opt/config/artifacts_version.txt -echo $DNS_IP > /opt/config/dns_ip_addr.txt -echo $GERRIT_BRANCH > /opt/config/gerrit_branch.txt -echo $CLOUD_ENV > /opt/config/cloud_env.txt -echo $EXETERNAL_DNS > /opt/config/external_dns.txt -echo $MR_REPO > /opt/config/remote_repo.txt - -touch /opt/mr_install.sh -chmod 777 /opt/mr_install.sh -curl -k $NEXUS_REPO/org.onap.demo/boot/$ARTIFACTS_VERSION/mr_install.sh -o /opt/mr_install.sh; -cd /opt -chmod +x mr_install.sh -/opt/mr_install.sh > mr_install.log 2>&1
\ No newline at end of file diff --git a/TOSCA/VM/appc/appc.yaml b/TOSCA/VM/appc/appc.yaml deleted file mode 100644 index 5a4cff7f30..0000000000 --- a/TOSCA/VM/appc/appc.yaml +++ /dev/null @@ -1,278 +0,0 @@ -# ============LICENSE_START========================================== -# =================================================================== -# Copyright (c) 2017 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============================================ - -########################################################### -# This Blueprint installs ONAP appc on Openstack -########################################################### - -tosca_definitions_version: cloudify_dsl_1_3 - -description: > - This blueprint creates a ONAP APP-C - -imports: - - http://www.getcloudify.org/spec/cloudify/4.1/types.yaml - - http://cloudify.co/spec/openstack-plugin/2.2.0/plugin.yaml - - http://cloudify.co/spec/fabric-plugin/1.5/plugin.yaml - - http://www.getcloudify.org/spec/diamond-plugin/1.3.3/plugin.yaml - -inputs: - nexus_repo: - type: string - default: https://nexus.onap.org/content/sites/raw - - docker_repo: - type: string - default: nexus3.onap.org:10001 - - nexus_username: - type: string - default: docker - - nexus_password: - type: string - default: docker - - artifacts_version: - type: string - default: 1.1.0-SNAPSHOT - - dns_ip: - type: string - - cloud_env: - type: string - default: openstack - - docker_version: - type: string - default: v1.2.0 - - gerrit_branch: - type: string - default: master - - external_dns: - type: string - - dmaap_topic: - type: string - default: AUTO - - appc_repo: - type: string - default: http://gerrit.onap.org/r/appc/deployment.git - - vm_instancename: - type: string - - image: - description: | - A Ubuntu 14.04 image, along with the usual - type: string - default: Ubuntu 14.04 LTS Generic - - flavor: - description: > - A machine type with more than 2 CPUs, 4096 GB RAM, and 8 GB of disk space. - You might want to use 4 CPUs, 8192 MB RAM for the master. - type: string - default: m1.xlarge - - ssh_user: - description: | - User for connecting to agent VM - type: string - default: ubuntu - - security_group: - description: openstack security_group - type: string - - keypair_name: - description: | - OpenStack keypair name - type: string - - key_filename: - type: string - - external_network: - type: string - - app_subnet: - type: string - - - openstack_username: - type: string - description: username to authenticate to OpenStack - - openstack_password: - type: string - description: OpenStack tenant password for openstack_username user - - openstack_tenant_name: - type: string - description: OpenStack tenant for VM deploy - - openstack_auth_url: - type: string - description: Authentication URL for OpenStack - - openstack_region: - type: string - description: OpenStack region - - dgbuilder_docker: - type: string - default: v0.1.0 - -dsl_definitions: - openstack_credentials: &openstack_credentials - username: { get_input: openstack_username } - password: { get_input: openstack_password } - tenant_name: { get_input: openstack_tenant_name } - auth_url: { get_input: openstack_auth_url } - region: { get_input: openstack_region } - -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_name } - openstack_config: *openstack_credentials - - private_net: - type: cloudify.openstack.nodes.Network - properties: - use_external_resource: true - resource_id: { get_input: app_subnet } - openstack_config: *openstack_credentials - - external_network: - type: cloudify.openstack.nodes.Network - properties: - openstack_config: *openstack_credentials - use_external_resource: true - resource_id: { get_input: external_network} - - app_security_group: - type: cloudify.openstack.nodes.SecurityGroup - properties: - openstack_config: *openstack_credentials - use_external_resource: true - resource_id: { get_input: security_group } - - VM_001_fixed_ip: - type: cloudify.openstack.nodes.Port - properties: - openstack_config: *openstack_credentials - relationships: - - type: cloudify.relationships.contained_in - target: private_net - - type: cloudify.openstack.port_connected_to_security_group - target: app_security_group - - VM_001_floating_ip: - type: cloudify.openstack.nodes.FloatingIP - properties: - openstack_config: *openstack_credentials - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - floating_network_name: { get_input: external_network } - - VM_001: - type: cloudify.openstack.nodes.Server - properties: - openstack_config: *openstack_credentials - install_agent: false - image: { get_input: image } - flavor: { get_input: flavor } - resource_id: { get_input: vm_instancename } - management_network_name: { get_input: app_subnet } - ip: { get_attribute: [VM_001_floating_ip, floating_ip_address] } - relationships: - - type: cloudify.openstack.server_connected_to_floating_ip - target: VM_001_floating_ip - - type: cloudify.openstack.server_connected_to_keypair - target: key_pair - - type: cloudify.openstack.server_connected_to_port - target: VM_001_fixed_ip - - - app_001: - type: cloudify.nodes.SoftwareComponent - properties: - interfaces: - cloudify.interfaces.lifecycle: - start: - implementation: fabric.fabric_plugin.tasks.run_script - inputs: - script_path: scripts/appc.sh - use_sudo: true - process: - args: - [{ get_attribute: [VM_001_floating_ip, floating_ip_address]}, - { get_attribute: [VM_001_fixed_ip, fixed_ip_address]}, - { get_input: nexus_repo }, - { get_input: docker_repo}, - { get_input: nexus_username }, - { get_input: nexus_password }, - { get_input: artifacts_version }, - { get_input: dns_ip}, - { get_input: gerrit_branch }, - openstack, - { get_input: external_dns}, - { get_input: dmaap_topic}, - { get_input: openstack_username}, - { get_input: openstack_tenant_name}, - { get_input: openstack_password}, - { get_input: openstack_region}, - { get_input: openstack_auth_url}, - { get_input: appc_repo}, - { get_input: docker_version }, - { get_input: dgbuilder_docker}] - fabric_env: - host_string: { get_attribute: [VM_001_floating_ip, floating_ip_address]} - user: { get_input: ssh_user } - key_filename: { get_input: key_filename } - relationships: - - type: cloudify.relationships.contained_in - target: VM_001 - - type: cloudify.relationships.depends_on - target: VM_001_floating_ip - -outputs: - ONAP_Appc: - description: informations about app-c - value: - ip: { get_attribute: [VM_001_floating_ip, floating_ip_address] } - - - - - - - - diff --git a/TOSCA/VM/appc/scripts/appc.sh b/TOSCA/VM/appc/scripts/appc.sh deleted file mode 100644 index 1ceebae12b..0000000000 --- a/TOSCA/VM/appc/scripts/appc.sh +++ /dev/null @@ -1,75 +0,0 @@ -#!/bin/sh - -# ============LICENSE_START========================================== -# =================================================================== -# Copyright (c) 2017 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============================================ - -# -PUBIP="$1" -PVTIP="$2" -NEXUS_REPO="$3" -DOCKER_REPO="$4" -NEXUS_USERNAME="$5" -NEXUS_PASSWORD="$6" -ARTIFACTS_VERSION="$7" -DNS_IP="$8" -GERRIT_BRANCH="$9" -CLOUD_ENV="$10" -EXETERNAL_DNS="$11" -DMAAP_TOPIC="$12" -OPENSTACK_USERNAME="$13" -TENANT_ID="$14" -OPENSTACK_API_KEY="$15" -OPENSTACK_REGION="$16" -KEYSTONE="$17" -APPC_REPO="$18" -DOCKER_VERSION="$19" -DGBUILDER_DOCKER="$20" - -export HOSTNAME=`hostname` -echo 127.0.1.1 $HOSTNAME >>/etc/hosts -echo $PVTIP $HOSTNAME >>/etc/hosts -echo $PUBIP $HOSTNAME >>/etc/hosts - - -mkdir /opt/config -chmod 777 /opt/config -echo $PUBIP > /opt/config/public_ip.txt -echo $NEXUS_REPO > /opt/config/nexus_repo.txt -echo $DOCKER_REPO > /opt/config/nexus_docker_repo.txt -echo $NEXUS_USERNAME > /opt/config/nexus_username.txt -echo $NEXUS_PASSWORD > /opt/config/nexus_password.txt -echo $DMAAP_TOPIC > /opt/config/dmaap_topic.txt -echo $ARTIFACTS_VERSION > /opt/config/artifacts_version.txt -echo $DNS_IP > /opt/config/dns_ip_addr.txt -echo $DOCKER_VERSION > /opt/config/docker_version.txt -echo $GERRIT_BRANCH > /opt/config/gerrit_branch.txt -echo $DGBUILDER_DOCKER > /opt/config/dgbuilder_version.txt -echo $CLOUD_ENV > /opt/config/cloud_env.txt -echo $EXETERNAL_DNS > /opt/config/external_dns.txt -echo $APPC_REPO > /opt/config/remote_repo.txt -echo $OPENSTACK_USERNAME > /opt/config/openstack_username.txt -echo $TENANT_ID > /opt/config/tenant_id.txt -echo $OPENSTACK_API_KEY > /opt/config/openstack_api_key.txt -echo $OPENSTACK_REGION > /opt/config/openstack_region.txt -echo $KEYSTONE > /opt/config/keystone.txt - -touch /opt/appc_install.sh -chmod 777 /opt/appc_install.sh -curl -k $NEXUS_REPO/org.onap.demo/boot/$ARTIFACTS_VERSION/appc_install.sh -o /opt/appc_install.sh -cd /opt -chmod +x appc_install.sh -/opt/appc_install.sh > appc_install.log 2>&1
\ No newline at end of file diff --git a/TOSCA/VM/policy/Policy.yaml b/TOSCA/VM/policy/Policy.yaml deleted file mode 100644 index 76ff563084..0000000000 --- a/TOSCA/VM/policy/Policy.yaml +++ /dev/null @@ -1,263 +0,0 @@ -# ============LICENSE_START========================================== -# =================================================================== -# Copyright (c) 2017 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============================================ - -########################################################### -# This Blueprint installs ONAP policy on Openstack -########################################################### - -tosca_definitions_version: cloudify_dsl_1_3 - -description: > - This blueprint creates a ONAP policy - -imports: - - http://www.getcloudify.org/spec/cloudify/4.1/types.yaml - - http://cloudify.co/spec/openstack-plugin/2.2.0/plugin.yaml - - http://cloudify.co/spec/fabric-plugin/1.5/plugin.yaml - - http://www.getcloudify.org/spec/diamond-plugin/1.3.3/plugin.yaml - -inputs: - nexus_repo: - type: string - default: https://nexus.onap.org/content/sites/raw - - docker_repo: - type: string - default: nexus3.onap.org:10001 - - nexus_username: - type: string - default: docker - - nexus_password: - type: string - default: docker - - artifacts_version: - type: string - default: 1.1.0-SNAPSHOT - - dns_ip: - type: string - - cloud_env: - type: string - default: openstack - - docker_version: - type: string - default: v1.1.1 - - gerrit_branch: - type: string - default: master - - external_dns: - type: string - - policy_repo: - type: string - default: http://gerrit.onap.org/r/policy/docker.git - - vm_instancename: - type: string - - image: - description: | - A Ubuntu 14.04 image, along with the usual - type: string - default: Ubuntu 16.04 LTS Generic - - flavor: - description: > - A machine type with more than 2 CPUs, 4096 GB RAM, and 8 GB of disk space. - You might want to use 4 CPUs, 8192 MB RAM for the master. - type: string - default: m1.xlarge - - ssh_user: - description: | - User for connecting to agent VM - type: string - default: ubuntu - - security_group: - description: openstack security_group - type: string - - keypair_name: - description: | - OpenStack keypair name - type: string - - key_filename: - type: string - - external_network: - type: string - - app_subnet: - type: string - - - openstack_username: - type: string - description: username to authenticate to OpenStack - - openstack_password: - type: string - description: OpenStack tenant password for openstack_username user - - openstack_tenant_name: - type: string - description: OpenStack tenant for VM deploy - - openstack_auth_url: - type: string - description: Authentication URL for OpenStack - - openstack_region: - type: string - description: OpenStack region - -dsl_definitions: - openstack_credentials: &openstack_credentials - username: { get_input: openstack_username } - password: { get_input: openstack_password } - tenant_name: { get_input: openstack_tenant_name } - auth_url: { get_input: openstack_auth_url } - region: { get_input: openstack_region } - -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_name } - openstack_config: *openstack_credentials - - private_net: - type: cloudify.openstack.nodes.Network - properties: - use_external_resource: true - resource_id: { get_input: app_subnet } - openstack_config: *openstack_credentials - - external_network: - type: cloudify.openstack.nodes.Network - properties: - openstack_config: *openstack_credentials - use_external_resource: true - resource_id: { get_input: external_network} - - app_security_group: - type: cloudify.openstack.nodes.SecurityGroup - properties: - openstack_config: *openstack_credentials - use_external_resource: true - resource_id: { get_input: security_group } - - VM_001_fixed_ip: - type: cloudify.openstack.nodes.Port - properties: - openstack_config: *openstack_credentials - relationships: - - type: cloudify.relationships.contained_in - target: private_net - - type: cloudify.openstack.port_connected_to_security_group - target: app_security_group - - VM_001_floating_ip: - type: cloudify.openstack.nodes.FloatingIP - properties: - openstack_config: *openstack_credentials - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - floating_network_name: { get_input: external_network } - - VM_001: - type: cloudify.openstack.nodes.Server - properties: - openstack_config: *openstack_credentials - install_agent: false - image: { get_input: image } - flavor: { get_input: flavor } - resource_id: { get_input: vm_instancename } - management_network_name: { get_input: app_subnet } - ip: { get_attribute: [VM_001_floating_ip, floating_ip_address] } - relationships: - - type: cloudify.openstack.server_connected_to_floating_ip - target: VM_001_floating_ip - - type: cloudify.openstack.server_connected_to_keypair - target: key_pair - - type: cloudify.openstack.server_connected_to_port - target: VM_001_fixed_ip - - - app_001: - type: cloudify.nodes.SoftwareComponent - properties: - interfaces: - cloudify.interfaces.lifecycle: - start: - implementation: fabric.fabric_plugin.tasks.run_script - inputs: - script_path: scripts/policy.sh - use_sudo: true - process: - args: - [{ get_attribute: [VM_001_floating_ip, floating_ip_address]}, - { get_attribute: [VM_001_fixed_ip, fixed_ip_address]}, - { get_input: nexus_repo }, - { get_input: docker_repo}, - { get_input: nexus_username }, - { get_input: nexus_password }, - { get_input: artifacts_version }, - { get_input: dns_ip}, - { get_input: docker_version }, - { get_input: gerrit_branch }, - openstack, - { get_input: external_dns}, - { get_input: policy_repo}] - fabric_env: - host_string: { get_attribute: [VM_001_floating_ip, floating_ip_address]} - user: { get_input: ssh_user } - key_filename: { get_input: key_filename } - relationships: - - type: cloudify.relationships.contained_in - target: VM_001 - - type: cloudify.relationships.depends_on - target: VM_001_floating_ip - -outputs: - ONAP_Policy: - description: informations about Policy - value: - ip: { get_attribute: [VM_001_floating_ip, floating_ip_address] } - - - - - - - - diff --git a/TOSCA/VM/policy/scripts/policy.sh b/TOSCA/VM/policy/scripts/policy.sh deleted file mode 100644 index f01420cbdf..0000000000 --- a/TOSCA/VM/policy/scripts/policy.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/sh - -# ============LICENSE_START========================================== -# =================================================================== -# Copyright (c) 2017 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============================================ - -# -PUBIP="$1" -PVTIP="$2" -NEXUS_REPO="$3" -DOCKER_REPO="$4" -NEXUS_USERNAME="$5" -NEXUS_PASSWORD="$6" -ARTIFACTS_VERSION="$7" -DNS_IP="$8" -DOCKER_VERSION="$9" -GERRIT_BRANCH="$10" -CLOUD_ENV="$11" -EXETERNAL_DNS="$12" -POLICY_REPO="$13" - -export HOSTNAME=`hostname` -echo 127.0.1.1 $HOSTNAME >>/etc/hosts -echo $PVTIP $HOSTNAME >>/etc/hosts -echo $PUBIP $HOSTNAME >>/etc/hosts - - -mkdir /opt/config -chmod 777 /opt/config -echo $PUBIP > /opt/config/public_ip.txt -echo $NEXUS_REPO > /opt/config/nexus_repo.txt -echo $DOCKER_REPO > /opt/config/nexus_docker_repo.txt -echo $NEXUS_USERNAME > /opt/config/nexus_username.txt -echo $NEXUS_PASSWORD > /opt/config/nexus_password.txt -echo $ARTIFACTS_VERSION > /opt/config/artifacts_version.txt -echo $DNS_IP > /opt/config/dns_ip_addr.txt -echo $DOCKER_VERSION > /opt/config/docker_version.txt -echo $GERRIT_BRANCH > /opt/config/gerrit_branch.txt -echo $CLOUD_ENV > /opt/config/cloud_env.txt -echo $EXETERNAL_DNS > /opt/config/external_dns.txt -echo $POLICY_REPO > /opt/config/remote_repo.txt -touch /opt/policy_install.sh -chmod 777 /opt/policy_install.sh -curl -k $NEXUS_REPO/org.onap.demo/boot/$ARTIFACTS_VERSION/policy_install.sh -o /opt/policy_install.sh; -apt-get update -apt-get install -y docker.io -cd /opt -chmod +x policy_install.sh -/opt/policy_install.sh > policy_install.log 2>&1
\ No newline at end of file diff --git a/TOSCA/VM/so/scripts/so.sh b/TOSCA/VM/so/scripts/so.sh deleted file mode 100644 index ade760f507..0000000000 --- a/TOSCA/VM/so/scripts/so.sh +++ /dev/null @@ -1,81 +0,0 @@ -#!/bin/sh - -# ============LICENSE_START========================================== -# =================================================================== -# Copyright (c) 2017 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============================================ - -# -PUBIP="$1" -PVTIP="$2" -NEXUS_REPO="$3" -DOCKER_REPO="$4" -NEXUS_USERNAME="$5" -NEXUS_PASSWORD="$6" -ARTIFACTS_VERSION="$7" -DNS_IP="$8" -GERRIT_BRANCH="$9" -CLOUD_ENV="$10" -EXETERNAL_DNS="$11" -DMAAP_TOPIC="$12" -OPENSTACK_USERNAME="$13" -TENANT_ID="$14" -OPENSTACK_API_KEY="$15" -OPENSTACK_REGION="$16" -KEYSTONE="$17" -SO_REPO="$18" -DOCKER_VERSION="$19" - -export HOSTNAME=`hostname` -echo 127.0.1.1 $HOSTNAME >>/etc/hosts -echo $PVTIP $HOSTNAME >>/etc/hosts -echo $PUBIP $HOSTNAME >>/etc/hosts - - -mkdir /opt/config -chmod 777 /opt/config -echo $PUBIP > /opt/config/public_ip.txt -echo $NEXUS_REPO > /opt/config/nexus_repo.txt -echo $DOCKER_REPO > /opt/config/nexus_docker_repo.txt -echo $NEXUS_USERNAME > /opt/config/nexus_username.txt -echo $NEXUS_PASSWORD > /opt/config/nexus_password.txt -echo $ARTIFACTS_VERSION > /opt/config/artifacts_version.txt -echo $DNS_IP > /opt/config/dns_ip_addr.txt -echo $DOCKER_VERSION > /opt/config/docker_version.txt -echo $GERRIT_BRANCH > /opt/config/gerrit_branch.txt -echo $CLOUD_ENV > /opt/config/cloud_env.txt -echo $EXETERNAL_DNS > /opt/config/external_dns.txt -echo $DMAAP_TOPIC > /opt/config/dmaap_topic.txt -echo $OPENSTACK_USERNAME > /opt/config/openstack_username.txt -echo $TENANT_ID > /opt/config/tenant_id.txt -echo $OPENSTACK_API_KEY > /opt/config/openstack_api_key.txt -echo $OPENSTACK_REGION > /opt/config/openstack_region.txt -echo $KEYSTONE > /opt/config/keystone.txt -echo $SO_REPO > /opt/config/remote_repo.txt - -if [ ! -f /opt/rebooted ]; then - touch /opt/so_install.sh - chmod 777 /opt/so_install.sh - curl -k $NEXUS_REPO/org.onap.demo/boot/$ARTIFACTS_VERSION/so_install.sh -o /opt/so_install.sh - cd /opt - chmod +x so_install.sh - - echo " if [ ! -f /opt/rebooted ]; then" >/opt/install_tmp - echo " touch /opt/rebooted">>/opt/install_tmp - echo " reboot" >>/opt/install_tmp - echo " fi">>/opt/install_tmp - sed -i -e "/\treboot/r install_tmp" -e "//d" so_install.sh -fi -/opt/so_install.sh > so_install.log 2>&1
\ No newline at end of file diff --git a/TOSCA/VM/so/so.yaml b/TOSCA/VM/so/so.yaml deleted file mode 100644 index e4719dff02..0000000000 --- a/TOSCA/VM/so/so.yaml +++ /dev/null @@ -1,273 +0,0 @@ -# ============LICENSE_START========================================== -# =================================================================== -# Copyright (c) 2017 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============================================ - -########################################################### -# This Blueprint installs ONAP SO on Openstack -########################################################### - -tosca_definitions_version: cloudify_dsl_1_3 - -description: > - This blueprint creates a ONAP service orchestrator - -imports: - - http://www.getcloudify.org/spec/cloudify/4.1/types.yaml - - http://cloudify.co/spec/openstack-plugin/2.2.0/plugin.yaml - - http://cloudify.co/spec/fabric-plugin/1.5/plugin.yaml - - http://www.getcloudify.org/spec/diamond-plugin/1.3.3/plugin.yaml - -inputs: - nexus_repo: - type: string - default: https://nexus.onap.org/content/sites/raw - - docker_repo: - type: string - default: nexus3.onap.org:10001 - - nexus_username: - type: string - default: docker - - nexus_password: - type: string - default: docker - - artifacts_version: - type: string - default: 1.1.0-SNAPSHOT - - dns_ip: - type: string - - cloud_env: - type: string - default: openstack - - docker_version: - type: string - default: v1.1.1 - - gerrit_branch: - type: string - default: master - - external_dns: - type: string - - dmaap_topic: - type: string - default: AUTO - - so_repo: - type: string - default: http://gerrit.onap.org/r/so/docker-config.git - - vm_instancename: - type: string - - image: - description: | - A Ubuntu 16.04 image, along with the usual - type: string - default: Ubuntu 16.04 LTS Generic - - flavor: - description: > - A machine type with more than 2 CPUs, 4096 GB RAM, and 8 GB of disk space. - You might want to use 4 CPUs, 8192 MB RAM for the master. - type: string - default: m1.xlarge - - ssh_user: - description: | - User for connecting to agent VM - type: string - default: ubuntu - - security_group: - description: openstack security_group - type: string - - keypair_name: - description: | - OpenStack keypair name - type: string - - key_filename: - type: string - - external_network: - type: string - - app_subnet: - type: string - - - openstack_username: - type: string - description: username to authenticate to OpenStack - - openstack_password: - type: string - description: OpenStack tenant password for openstack_username user - - openstack_tenant_name: - type: string - description: OpenStack tenant for VM deploy - - openstack_auth_url: - type: string - description: Authentication URL for OpenStack - - openstack_region: - type: string - description: OpenStack region - -dsl_definitions: - openstack_credentials: &openstack_credentials - username: { get_input: openstack_username } - password: { get_input: openstack_password } - tenant_name: { get_input: openstack_tenant_name } - auth_url: { get_input: openstack_auth_url } - region: { get_input: openstack_region } - -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_name } - openstack_config: *openstack_credentials - - private_net: - type: cloudify.openstack.nodes.Network - properties: - use_external_resource: true - resource_id: { get_input: app_subnet } - openstack_config: *openstack_credentials - - external_network: - type: cloudify.openstack.nodes.Network - properties: - openstack_config: *openstack_credentials - use_external_resource: true - resource_id: { get_input: external_network} - - app_security_group: - type: cloudify.openstack.nodes.SecurityGroup - properties: - openstack_config: *openstack_credentials - use_external_resource: true - resource_id: { get_input: security_group } - - VM_001_fixed_ip: - type: cloudify.openstack.nodes.Port - properties: - openstack_config: *openstack_credentials - relationships: - - type: cloudify.relationships.contained_in - target: private_net - - type: cloudify.openstack.port_connected_to_security_group - target: app_security_group - - VM_001_floating_ip: - type: cloudify.openstack.nodes.FloatingIP - properties: - openstack_config: *openstack_credentials - interfaces: - cloudify.interfaces.lifecycle: - create: - inputs: - args: - floating_network_name: { get_input: external_network } - - VM_001: - type: cloudify.openstack.nodes.Server - properties: - openstack_config: *openstack_credentials - install_agent: false - image: { get_input: image } - flavor: { get_input: flavor } - resource_id: { get_input: vm_instancename } - management_network_name: { get_input: app_subnet } - ip: { get_attribute: [VM_001_floating_ip, floating_ip_address] } - relationships: - - type: cloudify.openstack.server_connected_to_floating_ip - target: VM_001_floating_ip - - type: cloudify.openstack.server_connected_to_keypair - target: key_pair - - type: cloudify.openstack.server_connected_to_port - target: VM_001_fixed_ip - - - app_001: - type: cloudify.nodes.SoftwareComponent - properties: - interfaces: - cloudify.interfaces.lifecycle: - start: - implementation: fabric.fabric_plugin.tasks.run_script - inputs: - script_path: scripts/so.sh - use_sudo: true - process: - args: - [{ get_attribute: [VM_001_floating_ip, floating_ip_address]}, - { get_attribute: [VM_001_fixed_ip, fixed_ip_address]}, - { get_input: nexus_repo }, - { get_input: docker_repo}, - { get_input: nexus_username }, - { get_input: nexus_password }, - { get_input: artifacts_version }, - { get_input: dns_ip}, - { get_input: gerrit_branch }, - openstack, - { get_input: external_dns}, - { get_input: dmaap_topic}, - { get_input: openstack_username}, - { get_input: openstack_tenant_name}, - { get_input: openstack_password}, - { get_input: openstack_region}, - { get_input: openstack_auth_url}, - { get_input: so_repo}, - { get_input: docker_version }] - fabric_env: - host_string: { get_attribute: [VM_001_floating_ip, floating_ip_address]} - user: { get_input: ssh_user } - key_filename: { get_input: key_filename } - relationships: - - type: cloudify.relationships.contained_in - target: VM_001 - - type: cloudify.relationships.depends_on - target: VM_001_floating_ip - -outputs: - ONAP_Service_Orchestrator: - description: informations about Service Orchestrator - value: - ip: { get_attribute: [VM_001_floating_ip, floating_ip_address] } - - - - - - - - diff --git a/cloudify-onap/blueprint.yaml b/cloudify-onap/blueprint.yaml deleted file mode 100644 index 96d297dbd3..0000000000 --- a/cloudify-onap/blueprint.yaml +++ /dev/null @@ -1,188 +0,0 @@ -tosca_definitions_version: cloudify_dsl_1_3 - -description: > - Blueprint deploys all ONAP kubernetes resources defined in YAML files on existing kubernetes cluster - The following pre-setup steps are assumed, but not required: - - Create Cloudify Example Environment: https://github.com/cloudify-examples/cloudify-environment-setup. - - Create Kubernetes Cluster: https://github.com/cloudify-examples/simple-kubernetes-blueprint. - -imports: - - https://raw.githubusercontent.com/cloudify-cosmo/cloudify-manager/4.1/resources/rest-service/cloudify/types/types.yaml - # Plugin required: https://github.com/cloudify-incubator/cloudify-kubernetes-plugin/releases/download/1.2.1rc1/cloudify_kubernetes_plugin-1.2.1rc1-py27-none-linux_x86_64-centos-Core.wgn - - https://raw.githubusercontent.com/cloudify-incubator/cloudify-kubernetes-plugin/1.2.1/plugin.yaml -# - https://github.com/cloudify-incubator/cloudify-kubernetes-plugin/archive/1.2.1.zip - - plugins/onap-installation-plugin/plugin.yaml - -inputs: - kubernetes_configuration_file_content: - description: > - File content of kubernetes master YAML configuration - default: - apiVersion: v1 - clusters: - - cluster: - certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUN5RENDQWJDZ0F3SUJBZ0lCQURBTkJna3Foa2lHOXcwQkFRc0ZBREFWTVJNd0VRWURWUVFERXdwcmRXSmwKY201bGRHVnpNQjRYRFRFM01UQXdNakV6TVRNeU4xb1hEVEkzTURrek1ERXpNVE15TjFvd0ZURVRNQkVHQTFVRQpBeE1LYTNWaVpYSnVaWFJsY3pDQ0FTSXdEUVlKS29aSWh2Y05BUUVCQlFBRGdnRVBBRENDQVFvQ2dnRUJBTDN4CnRqRllVd25GVmxnNFZhd3BNaFB1N2hDOXVNSEJmUU9JclIrU1B4TElaMUVjTERXdTBod1pWWloxSUF4K0NrQlcKU1BmVDdXSE5zNld4RHAyRUpoVlp2TEFBVW9nem5aSlJnU0Z2RW1NZWg4cXhTaSsrQmtNNmxvTytTTVE0eFJlVApFbTZpd3JrdFZNUXVocDhkVG01MGpIUjMyelBTQklZRGpQejYwWEpzNXp2MEJzL0VlSHRDS0RxV2ZoZWpYZjBECmhQNi9DSU45UjBwNk9UZTdSYUV6dUtlblRtTml0dzNJTkg4b3BhYlY2TW8ycEFvbVRRUG5pZTVZZ2EzNGNndXEKTXpYSmVQUE1CQSs4UDNmS3BFcDJQU3UzWUF3SGg4VWo0MlRDTjMxQ1BBM3F4dUxGejBwOGw5ckJ5WVh6amRybQpwNFZIV1FGOTh3eXBFUW0xNFdVQ0F3RUFBYU1qTUNFd0RnWURWUjBQQVFIL0JBUURBZ0trTUE4R0ExVWRFd0VCCi93UUZNQU1CQWY4d0RRWUpLb1pJaHZjTkFRRUxCUUFEZ2dFQkFBS3Q2a2E2R04rWksveEx5Nk1tcWpSQTZpa2QKMjYwS3g0ak9FWUtrNWtTemlPOE5Iazhza3JNNzZSVksxdUwxZkFzU0N5SnYyOUJNb3NGQkhISDltOGNBbnFFcgowRGVvdDhHY0d6OWh6ZTlOcGhGNkFNNEhCZTFDbDhkME9vdm91K3dsYk1VTDN4M1hNUHZmMDRKajZsMUJMdEx2Cjh2Nk5Eb0lWdkppS1FLM0tuK3BHUVBZd2x1UEFoSEZQZUdlZ1gvTnBlNXJjMVZGRUtLUkRQRVFRS0xrcE5TZ2IKNzgwZ2ZMTkxJUTJsQnczZHRjazcyelkyK0dlWlp3MEM2ckk5QUhBekg3ZXpZY0pvT2VmVjArZE9zV2lJNVB4UgowZnNYSlNEOVR4SDVVMlRSQ25KZ214M1ZLTGl5OTZyOGsrOTdkWlAvN3h2Q3dGSU9wc2I2UGcxdjNxZz0KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo= - server: https://192.168.120.5:6443 - name: kubernetes - contexts: - - context: - cluster: kubernetes - user: kubernetes-admin - name: kubernetes-admin@kubernetes - current-context: kubernetes-admin@kubernetes - kind: Config - preferences: {} - users: - - name: kubernetes-admin - user: - client-certificate-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUM4akNDQWRxZ0F3SUJBZ0lJRUFMaVFKV0d2ZmN3RFFZSktvWklodmNOQVFFTEJRQXdGVEVUTUJFR0ExVUUKQXhNS2EzVmlaWEp1WlhSbGN6QWVGdzB4TnpFd01ESXhNekV6TWpkYUZ3MHhPREV3TURJeE16RXpNamxhTURReApGekFWQmdOVkJBb1REbk41YzNSbGJUcHRZWE4wWlhKek1Sa3dGd1lEVlFRREV4QnJkV0psY201bGRHVnpMV0ZrCmJXbHVNSUlCSWpBTkJna3Foa2lHOXcwQkFRRUZBQU9DQVE4QU1JSUJDZ0tDQVFFQXVOWFFJSlNzSmdtWndXMTEKcEtRZTV5TkQ1THBUdDY5dENKeEpoWXZPbElUOTRwVmdtVnBLNjhlMUNhQ2YxYkt0N2hCMUFOSVJHam8xMTYxNgpGUVRkaE5ZN0tnZFFUNGsrMC9mV0hBZzdCYnhKSDFCdEVvOGorTFk0dDRMNUVCS1l2dTN4Z21NS2E3SGMxZiszCkRQdWtndDZUZm1JazZEM0JkTHQyays2ZDhMclAzYmtkVmQwS1o2OWtnRnBuSWxtNkdrQWhrZWRleE5PQ21vRE8KU0hHMEJvaWphSjRuNUUrWGtNUEpHM3c3aUhNeE5RQ1Fob1lVOC84MGZHWUd5Y2M5TklLSlRFWmVjVGxOeCtPVApyd1F4aWRWa0FNK3I2K085ZlVMSmV1VDlhbXhzOEJNbVNwQko2TU0xelZaTDA5RGp3QytKSFRmY25IMTRBTTJ5CnN3c1hSUUlEQVFBQm95Y3dKVEFPQmdOVkhROEJBZjhFQkFNQ0JhQXdFd1lEVlIwbEJBd3dDZ1lJS3dZQkJRVUgKQXdJd0RRWUpLb1pJaHZjTkFRRUxCUUFEZ2dFQkFCNkRNanRFQkMvSTlkK1VqYWNXM0R5K0pZd21hYWdOUHJycApyaWV0OExlMHFuOS9GUkRpcnpTZldUNXFSNzg3dEpqRWdIaHlvZzFQWE1ZY3l6ajhRS0hyTXJXZUJMck5EQ08wCkVFTGMzSnNyUkdiK0MxWk1MQ3k1VmRVd2Q4ZnYzNm5vRlZOelVneitBTG9WSmVUUEdBYUxTbjA5OWo0RXhxUXoKK3FYTDltZEpQc1FwVVR4OTN3Z1ppcjJRMzcxdXovU21UYkxsOEhjMUtkbC9MODFXM0xYY3JrbFAvbFBkUG9yVgpjUmFBYm94NjBTMmxFTE16dUZHRThaR0lPYlFseDJUdzAxcENvckQ0NHVqOHU1ZmRiWkxhRHZuSHZDODlvSjhNCml5VnU5dkxSajhzbmZvb0ZLMjVqOGI1SzNGMGlLcWRzaktiSWVPS3dKWWkwdGNPWC9GYz0KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo= - client-key-data: LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0tLQpNSUlFcFFJQkFBS0NBUUVBdU5YUUlKU3NKZ21ad1cxMXBLUWU1eU5ENUxwVHQ2OXRDSnhKaFl2T2xJVDk0cFZnCm1WcEs2OGUxQ2FDZjFiS3Q3aEIxQU5JUkdqbzExNjE2RlFUZGhOWTdLZ2RRVDRrKzAvZldIQWc3QmJ4SkgxQnQKRW84aitMWTR0NEw1RUJLWXZ1M3hnbU1LYTdIYzFmKzNEUHVrZ3Q2VGZtSWs2RDNCZEx0MmsrNmQ4THJQM2JrZApWZDBLWjY5a2dGcG5JbG02R2tBaGtlZGV4Tk9DbW9ET1NIRzBCb2lqYUo0bjVFK1hrTVBKRzN3N2lITXhOUUNRCmhvWVU4LzgwZkdZR3ljYzlOSUtKVEVaZWNUbE54K09UcndReGlkVmtBTStyNitPOWZVTEpldVQ5YW14czhCTW0KU3BCSjZNTTF6VlpMMDlEandDK0pIVGZjbkgxNEFNMnlzd3NYUlFJREFRQUJBb0lCQVFDTjVnL2ZRMlFaMjVyLwp4Vkhnc09MTW5lVThqdE5BbkZ1L2xZUllFeW5vR1dWejh5dnk3eisvWFZVZDdBTnBJc0NtbUZuSzVIcWV3UHVlCjlaNVl6cUJsbjdaU0lNVkdHbDV5aXIwRVRrbEpzUEFPSzBkaFRTVFhoc1ZxRlJHeWhpUmZ4L3AyR0NUaTR1eGcKR2UzaytMZW1oTXVFNWtIaFRhL2NOeUxrbFBjSjNJTHl5bnNOSmtwSlI4M0FBb1NxVkVObHhmQVFLT3VUVnNqOApRTXF4ekNMblU1RVFYc0pCamVNa0YrVllFdVRUZENUUm8vWXluR3g0K2ptR3IxTGNRRExjbllpTGtuS2YvTjNRCmpBV2QwUGVZS2p6V0M3aGs3a0JKdEl5MjcyVEtudS9nN3FIQktSVVNSUnBnWHFsTGJMZDVpZTdzTXJEdnMyd3AKMjhxK01XbE5Bb0dCQU5CSzVDc2JGNSsxZkx3VldPaWUxRlpTSVAzMnQvRWJvODJkS1VIZWxGVldEQXV3cXRUTQpsT2psUnRZVkxRODV1WWtxMExBRkl2TjNlNDlmcWQ3aUk3cEE4WE5uZnovWVozRGFEREZ0cVRuZU84VmlOTHkvCjd0SUh4bWVwWHJpay9GUXFNZjNmNnNiYzBTcDgvSXdXWlZ4Y2hmOVVFV3pOYmZpNDZoV3BjTjlUQW9HQkFPTXIKZzhrMHFlU01teTc5Z3pwMTVvT0VMWW9VdkhLZTJibk8wbnA1aldhbVprdGR1blRNMGg2dmdLQTF5UnNnejFjNApncmtZUkp5V1JhRElYb0YzOVdvMWJrbHZvaWN5NURqWUtBK0hKWUVUT0pmOC9odzJ1WngzTk54bm5UZXpJSVA5CnVDZHlJSDhRNFU1VkloeWVXTDV5WlR6WGs3YlhyRVllZjB3cW81UUhBb0dBZlhiZkFXZ01UdE5QRXl2NHBnWWwKK09qM25vSmlRZ1ZZSVo0dEg5UW1uVkI3YVA4OXAzaWpxYldSZVpxL3paQUR4aS9ZREc3TG9zT3gxYWJWOTc5WApyZlU0ZXo4NFV3alRKaEx4alVSMHpycWlYajdOYlhSZk1ud2tjb1IrM2RIamUvNytwZUdlMWJKays2YlZxTHhFCnllR2hoUzdxWUJOTnpxZnp1S0Nic0trQ2dZRUF6N2g4ZXNEekVJOFpYekJrakZJK2c4ZWJOSVdkZzFtSlVRT3oKSmxaN1czK1FUaDNZWHZEaXVUaFZieWwvU0pVSndvRmoxd2cveE1jTHgrY3ZzMGNUV3hpY1RmNEwwYmdSUTRFegpzRzh0ZGdjeldwYjFiS3NGc2ZLMm5Vc0pVV016dWoySDVGblJLUjh3UmNaR3VOQjU2VHNGSTBza1FLNlpVa3lVCnJmclhOSVVDZ1lFQW83NGp6NnBJbDgwOU51dERZeHVON3J4RzYrTVMwRkVRa2tTSGdtZTlvN0Y0QjNWRHJ6WE4Ka1g3dC95cm1ieHBjK0R2VmUzWm1hWHE1QXJzdjRVbW5Za1ArNCs0L2REcWdmbjd3ZmVKUkpzU1Uzd2V0YWJnRwpDQW5xMFpLR3RJWWhud1h5cWF6elBsUUFteFIxWUdDczIxL05kUVJvWDdsOFdyaUJmbkpVM3hZPQotLS0tLUVORCBSU0EgUFJJVkFURSBLRVktLS0tLQo= - - namespace_prefix: - type: string - description: > - Kubernetes namespace name prefix which will be uese for all ONAP apps - default: onap - -dsl_definitions: - options: &app_options - namespace: - concat: [{ get_input: namespace_prefix }, '-', { get_property: [SELF, name] }] - -node_templates: - kubernetes_master: - type: cloudify.kubernetes.nodes.Master - properties: - configuration: - file_content: { get_input: kubernetes_configuration_file_content } - - onap_environment: - type: cloudify.onap.kubernetes.Environment - properties: - namespace: { get_input: namespace_prefix } - init_pod: kubernetes/config - options: - namespace: { get_input: namespace_prefix } - relationships: - - type: cloudify.kubernetes.relationships.managed_by_master - target: kubernetes_master - -# mso_app: -# type: cloudify.onap.kubernetes.App -# properties: -# name: mso -# path: kubernetes/mso -# options: *app_options -# relationships: -# - type: cloudify.kubernetes.relationships.managed_by_master -# target: kubernetes_master -# - type: cloudify.relationships.depends_on -# target: onap_environment -# - message_router_app: - type: cloudify.onap.kubernetes.App - properties: - name: message-router - path: kubernetes/message-router - options: *app_options - relationships: - - type: cloudify.kubernetes.relationships.managed_by_master - target: kubernetes_master - - type: cloudify.relationships.depends_on - target: onap_environment -# -# sdc_app: -# type: cloudify.onap.kubernetes.App -# properties: -# name: sdc -# path: kubernetes/sdc -# options: *app_options -# relationships: -# - type: cloudify.kubernetes.relationships.managed_by_master -# target: kubernetes_master -# - type: cloudify.relationships.depends_on -# target: onap_environment -# -# aai_app: -# type: cloudify.onap.kubernetes.App -# properties: -# name: aai -# path: kubernetes/aai -# options: *app_options -# relationships: -# - type: cloudify.kubernetes.relationships.managed_by_master -# target: kubernetes_master -# - type: cloudify.relationships.depends_on -# target: onap_environment -# -# robot_app: -# type: cloudify.onap.kubernetes.App -# properties: -# name: robot -# path: kubernetes/robot -# options: *app_options -# relationships: -# - type: cloudify.kubernetes.relationships.managed_by_master -# target: kubernetes_master -# - type: cloudify.relationships.depends_on -# target: onap_environment -# -# vid_app: -# type: cloudify.onap.kubernetes.App -# properties: -# name: vid -# path: kubernetes/vid -# options: *app_options -# relationships: -# - type: cloudify.kubernetes.relationships.managed_by_master -# target: kubernetes_master -# - type: cloudify.relationships.depends_on -# target: onap_environment -# -# sdnc_app: -# type: cloudify.onap.kubernetes.App -# properties: -# name: sdnc -# path: kubernetes/sdnc -# options: *app_options -# relationships: -# - type: cloudify.kubernetes.relationships.managed_by_master -# target: kubernetes_master -# - type: cloudify.relationships.depends_on -# target: onap_environment -# -# portal_app: -# type: cloudify.onap.kubernetes.App -# properties: -# name: portal -# path: kubernetes/portal -# options: *app_options -# relationships: -# - type: cloudify.kubernetes.relationships.managed_by_master -# target: kubernetes_master -# - type: cloudify.relationships.depends_on -# target: onap_environment -# -# policy_app: -# type: cloudify.onap.kubernetes.App -# properties: -# name: policy -# path: kubernetes/policy -# options: *app_options -# relationships: -# - type: cloudify.kubernetes.relationships.managed_by_master -# target: kubernetes_master -# - type: cloudify.relationships.depends_on -# target: onap_environment -# -# appc_app: -# type: cloudify.onap.kubernetes.App -# properties: -# name: appc -# path: kubernetes/appc -# options: *app_options -# relationships: -# - type: cloudify.kubernetes.relationships.managed_by_master -# target: kubernetes_master -# - type: cloudify.relationships.depends_on -# target: onap_environment diff --git a/cloudify-onap/docker-custom-readiness/Dockerfile b/cloudify-onap/docker-custom-readiness/Dockerfile deleted file mode 100644 index d42456d336..0000000000 --- a/cloudify-onap/docker-custom-readiness/Dockerfile +++ /dev/null @@ -1,21 +0,0 @@ -from ubuntu:16.04 - -ENV no_proxy "localhost,127.0.0.1,.cluster.local,$KUBERNETES_SERVICE_HOST" -# Setup Corporate proxy -ENV https_proxy ${HTTPS_PROXY} -ENV http_proxy ${HTTP_PROXY} - -# Additional packages -RUN apt-get update -RUN apt-get install -y apt-utils git wget curl dnsutils python python-pip jq net-tools coreutils vim - -RUN pip install requests pyyaml kubernetes==1.0.2 - - -ENV CERT="/var/run/secrets/kubernetes.io/serviceaccount/ca.crt" -ENV TOKEN="/var/run/secrets/kubernetes.io/serviceaccount/token" - -COPY ready.py /root/ready.py -RUN chmod a+x /root/ready.py -#ENTRYPOINT /root/ready.py - diff --git a/cloudify-onap/docker-custom-readiness/ready.py b/cloudify-onap/docker-custom-readiness/ready.py deleted file mode 100644 index 22b24d345d..0000000000 --- a/cloudify-onap/docker-custom-readiness/ready.py +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/python -#from kubernetes import client, config -import kubernetes -import time, argparse, logging, sys, os, base64 -import yaml - -#setup logging -log = logging.getLogger(__name__) -handler = logging.StreamHandler(sys.stdout) -handler.setFormatter(logging.Formatter('%(asctime)s - %(levelname)s - %(message)s')) -handler.setLevel(logging.DEBUG) -log.addHandler(handler) -log.setLevel(logging.DEBUG) - - -def is_ready(container_name): - log.info( "Checking if " + container_name + " is ready") - - kubernetes.config.kube_config.KubeConfigLoader(config_dict=get_k8s_config_env()).load_and_set() - client = kubernetes.client - namespace = get_namespace_env() - v1 = client.CoreV1Api() - - ready = False - - try: - response = v1.list_namespaced_pod(namespace=namespace, watch=False) - for i in response.items: - for s in i.status.container_statuses: - if s.name == container_name: - log.debug ( "response %s" % response ) - ready = s.ready - if not ready: - log.info( container_name + " is not ready.") - else: - log.info( container_name + " is ready!") - else: - continue - return ready - except Exception as e: - log.error("Exception when calling list_namespaced_pod: %s\n" % e) - - -def get_k8s_config_env(): - try: - k8s_config_env = os.environ.get("K8S_CONFIG_B64") - decoded = base64.b64decode(k8s_config_env) - return yaml.load(decoded) - except KeyError as ke: - raise Exception("K8S_CONFIG_B64 variable is not set.") - - -def get_namespace_env(): - try: - namespace_env = os.environ.get("NAMESPACE") - return namespace_env - except KeyError as ke: - raise Exception("NAMESPACE variable is not set.") - - -def main(args):#from kubernetes import client, config - - # args are a list of container names - for container_name in args: - # 5 min, TODO: make configurable - timeout = time.time() + 60 * 10 - while True: - ready = is_ready(container_name) - if ready is True: - break - elif time.time() > timeout: - log.warning( "timed out waiting for '" + container_name + "' to be ready") - exit(1) - else: - time.sleep(5) - - -if __name__ == "__main__": - parser = argparse.ArgumentParser(description='Process some names.') - parser.add_argument('--container-name', action='append', required=True, help='A container name') - args = parser.parse_args() - arg_dict = vars(args) - - for arg in arg_dict.itervalues(): - main(arg) diff --git a/cloudify-onap/plugins/onap-installation-plugin/k8s_installer/__init__.py b/cloudify-onap/plugins/onap-installation-plugin/k8s_installer/__init__.py deleted file mode 100644 index 19a30ba43d..0000000000 --- a/cloudify-onap/plugins/onap-installation-plugin/k8s_installer/__init__.py +++ /dev/null @@ -1,14 +0,0 @@ -######## -# Copyright (c) 2017 GigaSpaces Technologies Ltd. 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. diff --git a/cloudify-onap/plugins/onap-installation-plugin/k8s_installer/app.py b/cloudify-onap/plugins/onap-installation-plugin/k8s_installer/app.py deleted file mode 100644 index fc8af2eea4..0000000000 --- a/cloudify-onap/plugins/onap-installation-plugin/k8s_installer/app.py +++ /dev/null @@ -1,47 +0,0 @@ -######## -# Copyright (c) 2017 GigaSpaces Technologies Ltd. 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. - - -from cloudify.decorators import operation - -from common import namespace -from common import resources_services -from common import workarounds - - -@operation -def configure_docker_secret(**kwargs): - workarounds.configure_secret() - - -@operation -def create_namespace(**kwargs): - namespace.do_create_namespace() - - -@operation -def create_resources_services(**kwargs): - resources_services.create_resoruces() - - -@operation -def delete_namespace(**kwargs): - namespace.do_delete_namespace() - - -@operation -def delete_resources_services(**kwargs): - resources_services.delete_resoruces() - diff --git a/cloudify-onap/plugins/onap-installation-plugin/k8s_installer/common/__init__.py b/cloudify-onap/plugins/onap-installation-plugin/k8s_installer/common/__init__.py deleted file mode 100644 index 19a30ba43d..0000000000 --- a/cloudify-onap/plugins/onap-installation-plugin/k8s_installer/common/__init__.py +++ /dev/null @@ -1,14 +0,0 @@ -######## -# Copyright (c) 2017 GigaSpaces Technologies Ltd. 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. diff --git a/cloudify-onap/plugins/onap-installation-plugin/k8s_installer/common/constants.py b/cloudify-onap/plugins/onap-installation-plugin/k8s_installer/common/constants.py deleted file mode 100644 index 493a44f16f..0000000000 --- a/cloudify-onap/plugins/onap-installation-plugin/k8s_installer/common/constants.py +++ /dev/null @@ -1,20 +0,0 @@ -######## -# Copyright (c) 2017 GigaSpaces Technologies Ltd. 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. - -HELM_URL = 'https://kubernetes-helm.storage.googleapis.com/helm-canary-linux-amd64.tar.gz' -OOM_GIT_URL = 'https://gerrit.onap.org/r/oom.git' - -RT_HELM_CLI_PATH = "helm_cli_path" -RT_APPS_ROOT_PATH = "app_root_path" diff --git a/cloudify-onap/plugins/onap-installation-plugin/k8s_installer/common/deployment_result.py b/cloudify-onap/plugins/onap-installation-plugin/k8s_installer/common/deployment_result.py deleted file mode 100644 index 48d49e0403..0000000000 --- a/cloudify-onap/plugins/onap-installation-plugin/k8s_installer/common/deployment_result.py +++ /dev/null @@ -1,27 +0,0 @@ -######## -# Copyright (c) 2017 GigaSpaces Technologies Ltd. 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. - -from cloudify import ctx - - -def save_deployment_result(key): - result = ctx.instance.runtime_properties['kubernetes'] - ctx.instance.runtime_properties[key] = result - ctx.instance.runtime_properties['kubernetes'] = {} - - -def set_deployment_result(key): - result = ctx.instance.runtime_properties.pop(key) - ctx.instance.runtime_properties['kubernetes'] = result
\ No newline at end of file diff --git a/cloudify-onap/plugins/onap-installation-plugin/k8s_installer/common/helm.py b/cloudify-onap/plugins/onap-installation-plugin/k8s_installer/common/helm.py deleted file mode 100644 index 4404f6f832..0000000000 --- a/cloudify-onap/plugins/onap-installation-plugin/k8s_installer/common/helm.py +++ /dev/null @@ -1,62 +0,0 @@ -######## -# Copyright (c) 2017 GigaSpaces Technologies Ltd. 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. - -import urllib -import tarfile -import os -import tempfile -from git import Repo - -def get_helm_path(url): - tarball = _fetch_helm(url) - helm_dir = _get_tmp_file_name() - _untar_helm_archive(tarball, helm_dir) - helm_binary_path = _find_file('helm', helm_dir) - return helm_binary_path - - -def get_apps_root_path(git_url): - dst_repo_path = _get_tmp_file_name() - Repo.clone_from(git_url, dst_repo_path) - apps_root = format(dst_repo_path) - return apps_root - -def _fetch_helm(url): - dst_tar_path = _get_tmp_file_name() - - file = urllib.URLopener() - file.retrieve(url, dst_tar_path) - - return dst_tar_path - -def _untar_helm_archive(tar_path, helm_dir): - helm_tar = tarfile.open(tar_path) - helm_tar.extractall(helm_dir) - helm_tar.close() - - -def _find_file(filename, base_path): - for root, dirs, files in os.walk(base_path): - for name in files: - if name == filename: - return os.path.abspath(os.path.join(root, name)) - - raise Exception('Cannot find helm binary') - - -def _get_tmp_file_name(): - return '{}/{}'.format(tempfile._get_default_tempdir(), next(tempfile._get_candidate_names())) - - diff --git a/cloudify-onap/plugins/onap-installation-plugin/k8s_installer/common/init_pod.py b/cloudify-onap/plugins/onap-installation-plugin/k8s_installer/common/init_pod.py deleted file mode 100644 index 1376818b7b..0000000000 --- a/cloudify-onap/plugins/onap-installation-plugin/k8s_installer/common/init_pod.py +++ /dev/null @@ -1,63 +0,0 @@ -######## -# Copyright (c) 2017 GigaSpaces Technologies Ltd. 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. - -from cloudify import ctx -import yaml - -import constants -import resources_services - -SERVICES_FILE_PARTS_SEPARATOR = '---' - - -def do_create_init_pod(): - ctx.logger.info('Creating init pod') - - yaml_config = resources_services.render_chart( - ctx.node.properties["init_pod"], - _retrieve_root_path(), - _retrieve_helm_cli_path() - ) - yaml_content_part = yaml_config.split(SERVICES_FILE_PARTS_SEPARATOR)[2] - enhanced_yaml = _add_openstack_envs(yaml_content_part) - - resources_services.create_resource(enhanced_yaml) - - ctx.logger.info('Init pod created successfully') - - -def do_delete_init_pod(): - ctx.logger.info('Deleting init pod') - - ctx.logger.info('Init pod deleted successfully') - -def _add_openstack_envs(yaml_content): - input_dict = yaml.load(yaml_content) - - container_dict = input_dict['spec']['containers'][0] - container_dict.pop('envFrom') - - openstack_envs = ctx.node.properties["openstack_envs"] - for item in openstack_envs.items(): - ctx.logger.debug("adding item = {}".format(item)) - container_dict['env'].append(item) - - return input_dict - -def _retrieve_root_path(): - return ctx.instance.runtime_properties.get(constants.RT_APPS_ROOT_PATH, None) - -def _retrieve_helm_cli_path(): - return ctx.instance.runtime_properties.get(constants.RT_HELM_CLI_PATH, None)
\ No newline at end of file diff --git a/cloudify-onap/plugins/onap-installation-plugin/k8s_installer/common/namespace.py b/cloudify-onap/plugins/onap-installation-plugin/k8s_installer/common/namespace.py deleted file mode 100644 index d1336768ac..0000000000 --- a/cloudify-onap/plugins/onap-installation-plugin/k8s_installer/common/namespace.py +++ /dev/null @@ -1,101 +0,0 @@ -######## -# Copyright (c) 2017 GigaSpaces Technologies Ltd. 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. - -import cloudify_kubernetes.tasks as kubernetes_plugin -from cloudify import ctx -from cloudify.exceptions import NonRecoverableError - -import deployment_result - - -def do_create_namespace(): - namespace = _retrieve_namespace() - ctx.logger.info('Creating namespace: {0}'.format(namespace)) - - namespace_resource_template = _prepare_namespace_resource_template( - namespace - ) - - ctx.logger.debug( - 'Kubernetes object which will be deployed: {0}' - .format(namespace_resource_template) - ) - - kubernetes_plugin.custom_resource_create(**namespace_resource_template) - deployment_result.save_deployment_result('namespace') - ctx.logger.info('Namespace created successfully') - - -def do_delete_namespace(): - namespace = _retrieve_namespace() - ctx.logger.info('Deleting namespace: {0}'.format(namespace)) - - namespace_resource_template = _prepare_namespace_resource_template( - namespace - ) - - ctx.logger.debug( - 'Kubernetes object which will be deleted: {0}' - .format(namespace_resource_template) - ) - - deployment_result.set_deployment_result('namespace') - kubernetes_plugin.custom_resource_delete(**namespace_resource_template) - ctx.logger.info('Namespace deleted successfully') - - - -def _retrieve_namespace(): - - default_namespace = ctx.node.properties.get('options', {}).get('namespace') - namespace = ctx.node.properties.get('namespace', default_namespace) - - if not namespace: - raise NonRecoverableError( - 'Namespace is not defined (node={})'.format(ctx.node.name) - ) - - return namespace - - -def _prepare_namespace_resource_template(name): - return { - 'definition': { - 'apiVersion': 'v1', - 'kind': 'Namespace', - 'metadata': { - 'name': name, - 'labels': { - 'name': name - }, - }, - }, - 'api_mapping': { - 'create': { - 'api': 'CoreV1Api', - 'method': 'create_namespace', - 'payload': 'V1Namespace' - }, - 'read': { - 'api': 'CoreV1Api', - 'method': 'read_namespace', - }, - 'delete': { - 'api': 'CoreV1Api', - 'method': 'delete_namespace', - 'payload': 'V1DeleteOptions' - } - } - } diff --git a/cloudify-onap/plugins/onap-installation-plugin/k8s_installer/common/resources_services.py b/cloudify-onap/plugins/onap-installation-plugin/k8s_installer/common/resources_services.py deleted file mode 100644 index 268068f00c..0000000000 --- a/cloudify-onap/plugins/onap-installation-plugin/k8s_installer/common/resources_services.py +++ /dev/null @@ -1,230 +0,0 @@ -######## -# Copyright (c) 2017 GigaSpaces Technologies Ltd. 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. - -import subprocess - -import cloudify_kubernetes.tasks as kubernetes_plugin -import yaml -from cloudify import ctx -from cloudify.exceptions import NonRecoverableError - -import constants -import deployment_result -import time -import ast -import json -import base64 - -SERVICES_FILE_PARTS_SEPARATOR = '---' - - -def create_resoruces(): - ctx.logger.info('Creating resources') - apps_path = _retrieve_root_path() - - if not apps_path: - ctx.logger.warn( - 'Apps dir is not defined. Skipping!' - ) - - return - - helm_app = ctx.node.properties.get('path', None) - - yaml_file = prepare_content(helm_app) - - yaml_content_parts = yaml_file.split(SERVICES_FILE_PARTS_SEPARATOR) - - for yaml_content_part in yaml_content_parts: - if yaml_content_part: - yaml_content = _apply_readiness_workaround(yaml_content_part) - if yaml_content: - create_resource(yaml_content) - - ctx.logger.info('Resource created successfully') - -def delete_resoruces(): - - ctx.logger.info('Deleting resources') - apps_path = _retrieve_root_path() - - if not apps_path: - ctx.logger.warn( - 'Apps dir is not defined. Skipping!' - ) - return - - helm_app = ctx.node.properties.get('path', None) - - yaml_file = prepare_content(helm_app) - - yaml_content_parts = yaml_file.split(SERVICES_FILE_PARTS_SEPARATOR) - - for yaml_content_part in yaml_content_parts: - if yaml_content_part: - yaml_content = _apply_readiness_workaround(yaml_content_part) - if yaml_content: - delete_resource(yaml_content) - - ctx.logger.info('Resources deleted successfully') - - -def prepare_content(resource): - helm_path = _retrieve_helm_cli_path() - yaml_file = render_chart(resource, _retrieve_root_path(), helm_path) - - return yaml_file - - -def create_resource(yaml_content_dict): - ctx.logger.debug("Loading yaml: {}".format(yaml_content_dict)) - - if yaml_content_dict.get('kind', '') == 'PersistentVolumeClaim': - ctx.logger.debug("PersistentVolumeClaim custom handling") - kubernetes_plugin.custom_resource_create(definition=yaml_content_dict, api_mapping=_get_persistent_volume_mapping_claim_api()) - else: - kubernetes_plugin.resource_create(definition=yaml_content_dict) - - deployment_result.save_deployment_result('resource_{0}'.format(yaml_content_dict['metadata']['name'])) - -def delete_resource(yaml_content_dict): - ctx.logger.debug("Loading yaml: {}".format(yaml_content_dict)) - - deployment_result.save_deployment_result('resource_{0}'.format(yaml_content_dict['metadata']['name'])) - if yaml_content_dict.get('kind', '') == 'PersistentVolumeClaim': - ctx.logger.debug("PersistentVolumeClaim custom handling") - kubernetes_plugin.custom_resource_delete(definition=yaml_content_dict, api_mapping=_get_persistent_volume_mapping_claim_api()) - else: - kubernetes_plugin.resource_delete(definition=yaml_content_dict) - - -def render_chart(app, app_root_path, helm_cli_path): - app_chart_path = "{}/{}/".format(app_root_path, app) - ctx.logger.debug('App chart path = {}'.format(app_chart_path)) - return _exec_helm_template(helm_cli_path, app_chart_path) - - -def _exec_helm_template(helm_path, chart): - cmd = '{0} template {1}'.format(helm_path, chart) - ctx.logger.debug('Executing helm template cmd: {}'.format(cmd)) - rendered = subprocess.Popen(cmd.split(" "), stdout=subprocess.PIPE).stdout.read().decode() - - return rendered - -def _get_persistent_volume_mapping_claim_api(): - api_mapping = { - 'create' : { - 'api': 'CoreV1Api', - 'method': 'create_namespaced_persistent_volume_claim', - 'payload': 'V1PersistentVolumeClaim' - }, - 'read' : { - 'api': 'CoreV1Api', - 'method': 'read_namespaced_persistent_volume_claim', - }, - 'delete': { - 'api': 'CoreV1Api', - 'method': 'delete_namespaced_persistent_volume_claim', - 'payload': 'V1DeleteOptions' - } - } - - return api_mapping - - -def _apply_readiness_workaround(yaml_file): - b64_env = _get_k8s_b64_env() - - input_dict = yaml.load(yaml_file) - - try: - init_containers = input_dict['spec']['template']['metadata']['annotations'][ - 'pod.beta.kubernetes.io/init-containers'] - init_cont_list = eval(init_containers) - - new_init_cont_list = list() - new_cont = None - for init_cont in init_cont_list: - if "oomk8s/readiness-check" in init_cont['image']: - init_cont['image'] = "clfy/oomk8s-cfy-readiness-check:1.0.1" - #init_cont['imagePullPolicy'] = "IfNotPresent" - init_cont['env'].append(b64_env) - new_cont = init_cont - new_init_cont_list.append(json.dumps(init_cont)) - - new_payload = ",".join(new_init_cont_list) - - if new_cont: - input_dict['spec']['template']['metadata']['annotations'].pop('pod.beta.kubernetes.io/init-containers') - input_dict['spec']['template']['metadata']['annotations']['pod.beta.kubernetes.io/init-containers'] = '[{}]'.format(new_payload) - - - except KeyError as ke: - ctx.logger.debug('Readiness section is not found.') - - return input_dict - - -def _get_k8s_b64(): - target_relationship = _retrieve_managed_by_master() - - k8s_config = target_relationship.node.properties.get('configuration').get('file_content') - - if not k8s_config: - raise Exception("Cannot find kubernetes config") - - k8s_config_plain = yaml.dump(k8s_config, allow_unicode=True) - - k8s_config_b64 = base64.b64encode(k8s_config_plain) - - return k8s_config_b64 - - -def _get_k8s_b64_env(): - env = dict() - env['name'] = 'K8S_CONFIG_B64' - env['value'] = _get_k8s_b64() - return env - - -def _retrieve_root_path(): - target_relationship = _retrieve_depends_on() - - apps_root_path = target_relationship.instance.runtime_properties.get(constants.RT_APPS_ROOT_PATH, None) - - ctx.logger.debug("Retrived apps root path = {}".format(apps_root_path)) - - return apps_root_path - -def _retrieve_helm_cli_path(): - target_relationship = _retrieve_depends_on() - - helm_cli_path = target_relationship.instance.runtime_properties.get(constants.RT_HELM_CLI_PATH, None) - - ctx.logger.debug("Retrived helm clis path = {}".format(helm_cli_path)) - - return helm_cli_path - -def _retrieve_depends_on(): - result = None - for relationship in ctx.instance.relationships: - if relationship.type == 'cloudify.relationships.depends_on': - return relationship.target - -def _retrieve_managed_by_master(): - result = None - for relationship in ctx.instance.relationships: - if relationship.type == 'cloudify.kubernetes.relationships.managed_by_master': - return relationship.target diff --git a/cloudify-onap/plugins/onap-installation-plugin/k8s_installer/common/workarounds.py b/cloudify-onap/plugins/onap-installation-plugin/k8s_installer/common/workarounds.py deleted file mode 100644 index fe3e892c5b..0000000000 --- a/cloudify-onap/plugins/onap-installation-plugin/k8s_installer/common/workarounds.py +++ /dev/null @@ -1,67 +0,0 @@ -######## -# Copyright (c) 2017 GigaSpaces Technologies Ltd. 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. - -from cloudify import ctx -from cloudify.exceptions import NonRecoverableError - -from fabric import api as fabric_api - -def _retrieve_namespace(): - namespace = ctx.node.properties.get( - 'namespace', - ctx.node.properties - .get('options', {}) - .get('namespace', None) - ) - - if not namespace: - raise NonRecoverableError( - 'Namespace is not defined (node={})'.format(ctx.node.name) - ) - - return namespace - - -def configure_secret(): - namespace = _retrieve_namespace() - ctx.logger.info( - 'Configuring docker secrets for namespace: {0}'.format(namespace) - ) - - command = 'kubectl create secret ' \ - 'docker-registry onap-docker-registry-key ' \ - '--docker-server=nexus3.onap.org:10001 ' \ - '--docker-username=docker ' \ - '--docker-password=docker ' \ - '--docker-email=email@email.com ' \ - '--namespace={0}'.format(namespace) - - ctx.logger.info('Command "{0}" will be executed'.format(command)) - - with fabric_api.settings( - **ctx.node.properties.get('ssh_credentials')): - fabric_api.run(command) - - ctx.logger.info('Docker secrets configured successfully') - - -def _get_fabric_env(): - result = dict() - - result['host_string'] = ctx.node.properties.get('ssh_credentials')['host_string'] - result['user'] = ctx.node.properties.get('ssh_credentials')['user'] - result['key'] = ctx.node.properties.get('ssh_credentials')['key'] - - return result diff --git a/cloudify-onap/plugins/onap-installation-plugin/k8s_installer/environment.py b/cloudify-onap/plugins/onap-installation-plugin/k8s_installer/environment.py deleted file mode 100644 index 741f28ec32..0000000000 --- a/cloudify-onap/plugins/onap-installation-plugin/k8s_installer/environment.py +++ /dev/null @@ -1,58 +0,0 @@ -######## -# Copyright (c) 2017 GigaSpaces Technologies Ltd. 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. - - -from cloudify import ctx -from cloudify.decorators import operation - -from common import constants -from common import helm -from common import init_pod, namespace - - -@operation -def create_init_pod(**kwargs): - init_pod.do_create_init_pod() - pass - - -@operation -def create_namespace(**kwargs): - namespace.do_create_namespace() - - -@operation -def delete_init_pod(**kwargs): - init_pod.do_delete_init_pod() - - -@operation -def delete_namespace(**kwargs): - namespace.do_delete_namespace() - - -@operation -def setup_helm_templates(**kwargs): - helm_url = constants.HELM_URL - ctx.instance.runtime_properties[constants.RT_HELM_CLI_PATH] = helm.get_helm_path(helm_url) - ctx.logger.debug('Helm cli path = {}'.format(ctx.instance.runtime_properties[constants.RT_HELM_CLI_PATH])) - - oom_git_url = constants.OOM_GIT_URL - ctx.instance.runtime_properties[constants.RT_APPS_ROOT_PATH] = helm.get_apps_root_path(oom_git_url) - ctx.logger.debug('Apps root path = {}'.format(ctx.instance.runtime_properties[constants.RT_APPS_ROOT_PATH])) - - - - diff --git a/cloudify-onap/plugins/onap-installation-plugin/k8s_installer/requirements.txt b/cloudify-onap/plugins/onap-installation-plugin/k8s_installer/requirements.txt deleted file mode 100644 index 9d8d880932..0000000000 --- a/cloudify-onap/plugins/onap-installation-plugin/k8s_installer/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -https://github.com/cloudify-incubator/cloudify-kubernetes-plugin/archive/1.2.1.zip
\ No newline at end of file diff --git a/cloudify-onap/plugins/onap-installation-plugin/plugin.yaml b/cloudify-onap/plugins/onap-installation-plugin/plugin.yaml deleted file mode 100755 index f88b50bc78..0000000000 --- a/cloudify-onap/plugins/onap-installation-plugin/plugin.yaml +++ /dev/null @@ -1,87 +0,0 @@ -plugins: - onap: - executor: central_deployment_agent - package_name: onap-installation-plugin - package_version: '1.0.0' - source: onap-installation-plugin - # install_arguments: '--process-dependency-links' - -node_types: - cloudify.onap.kubernetes.Environment: - derived_from: cloudify.nodes.Root - properties: - namespace: - type: string - init_pod: - type: string - description: > - Path to init pod chart - openstack_envs: - description: > - ONAP parameters defined at the onap-parameters.yaml file - default: {} - options: - description: > - For compatibility with kubernetes plugin. - To be removed in the future. - default: {} - interfaces: - cloudify.interfaces.lifecycle: - create: - implementation: onap.k8s_installer.environment.create_namespace - executor: central_deployment_agent - configure: - implementation: onap.k8s_installer.environment.setup_helm_templates - executor: central_deployment_agent - start: - implementation: onap.k8s_installer.environment.create_init_pod - executor: central_deployment_agent - stop: - implementation: onap.k8s_installer.environment.delete_init_pod - executor: central_deployment_agent - delete: - implementation: onap.k8s_installer.environment.delete_namespace - executor: central_deployment_agent - - cloudify.onap.kubernetes.App: - derived_from: cloudify.nodes.Root - properties: - name: - type: string - description: > - Name of ONAP app - path: - type: string - description: > - Paths (relative, blueprint prespective) to app chart directory - required: false - options: - description: > - For compatibility with kubernetes plugin. - To be removed in the future. - default: {} - ssh_credentials: - description: > - Workaround for docker secret settings - via fabric plugin - default: - host_string: { get_secret: kubernetes_master_ip } - user: { get_secret: agent_user } - key: { get_secret: agent_key_private } - interfaces: - cloudify.interfaces.lifecycle: - create: - implementation: onap.k8s_installer.app.create_namespace - executor: central_deployment_agent - configure: - implementation: onap.k8s_installer.app.configure_docker_secret - executor: central_deployment_agent - start: - implementation: onap.k8s_installer.app.create_resources_services - executor: central_deployment_agent - stop: - implementation: onap.k8s_installer.app.delete_resources_services - executor: central_deployment_agent - delete: - implementation: onap.k8s_installer.app.delete_namespace - executor: central_deployment_agent diff --git a/cloudify-onap/plugins/onap-installation-plugin/requirements.txt b/cloudify-onap/plugins/onap-installation-plugin/requirements.txt deleted file mode 100644 index 9d8d880932..0000000000 --- a/cloudify-onap/plugins/onap-installation-plugin/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -https://github.com/cloudify-incubator/cloudify-kubernetes-plugin/archive/1.2.1.zip
\ No newline at end of file diff --git a/cloudify-onap/plugins/onap-installation-plugin/setup.py b/cloudify-onap/plugins/onap-installation-plugin/setup.py deleted file mode 100755 index d413daa4ac..0000000000 --- a/cloudify-onap/plugins/onap-installation-plugin/setup.py +++ /dev/null @@ -1,40 +0,0 @@ -######## -# Copyright (c) 2017 GigaSpaces Technologies Ltd. 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. - - -from setuptools import setup - -try: - import cloudify_kubernetes -except ImportError: - import pip - pip.main(['install', 'https://github.com/cloudify-incubator/cloudify-kubernetes-plugin/archive/1.2.1.zip']) - -setup( - name='onap-installation-plugin', - version='1.0.0', - author='', - author_email='', - packages=['k8s_installer', 'k8s_installer.common'], - install_requires=[ - 'cloudify-plugins-common>=3.3.1', - 'cloudify-kubernetes-plugin==1.2.1', - #'/tmp/k8spl/cloudify-kubernetes-plugin' - 'pyyaml', - 'gitpython', - 'paramiko==1.18.3', - 'fabric==1.13.1' - ] -) diff --git a/kubernetes/uui/charts/uui-server/values.yaml b/kubernetes/uui/charts/uui-server/values.yaml index 107b125647..25a9538866 100644 --- a/kubernetes/uui/charts/uui-server/values.yaml +++ b/kubernetes/uui/charts/uui-server/values.yaml @@ -43,14 +43,14 @@ affinity: {} # probe configuration parameters liveness: - initialDelaySeconds: 10 + initialDelaySeconds: 120 periodSeconds: 10 # necessary to disable liveness probe when setting breakpoints # in debugger so K8s doesn't restart unresponsive container enabled: true readiness: - initialDelaySeconds: 10 + initialDelaySeconds: 60 periodSeconds: 10 service: diff --git a/message-router-blueprint.yaml b/message-router-blueprint.yaml deleted file mode 100644 index 98a283020b..0000000000 --- a/message-router-blueprint.yaml +++ /dev/null @@ -1,532 +0,0 @@ -tosca_definitions_version: cloudify_dsl_1_3 - -description: > - This example deploys the OOM Message Router application. Each service/deployment pair is associated with a single Kubernetes node. - Node template naming convention: PROVISIONINGAPI_RESOURCETYPE_APPLICATIONCOMPONENT - The following resources are created: - - Security Group - - openstack_port_zookeeper - NIC that connects to the Openstack Server - - openstack_port_kafka - NIC that connects to the Openstack Server - - openstack_port_dmaap - NIC that connects to the Openstack Server - - openstack_server_zookeeper - a VM that a Kubernetes Node is installed on. - - openstack_server_kafka - a VM that a Kubernetes Node is installed on. - - openstack_server_dmaap - a VM that a Kubernetes Node is installed on. - - kubernetes_node_zookeeper - a Kubernetes node that will join the Kubernetes cluster. - - kubernetes_node_kafka - a Kubernetes node that will join the Kubernetes cluster. - - kubernetes_node_dmaap - a Kubernetes node that will join the Kubernetes cluster. - - kubernetes_deployment_zookeeper - a Kubernetes deployment. - - kubernetes_deployment_kafka - a Kubernetes deployment. - - kubernetes_deployment_dmaap - a Kubernetes deployment. - - kubernetes_service_zookeeper - a Kubernetes service. - - kubernetes_service_kafka - a Kubernetes service. - - kubernetes_service_dmaap - a Kubernetes service. - The following pre-setup steps are assumed, but not required: - - Create Cloudify Example Environment: https://github.com/cloudify-examples/cloudify-environment-setup. - - Create Kubernetes Cluster: https://github.com/cloudify-examples/simple-kubernetes-blueprint. - -imports: - - https://raw.githubusercontent.com/cloudify-cosmo/cloudify-manager/4.1/resources/rest-service/cloudify/types/types.yaml - # Plugin required: https://github.com/cloudify-cosmo/cloudify-openstack-plugin/releases/download/2.2.0/cloudify_openstack_plugin-2.2.0-py27-none-linux_x86_64-centos-Core.wgn - - https://raw.githubusercontent.com/cloudify-cosmo/cloudify-openstack-plugin/2.2.0/plugin.yaml - # Plugin required: https://github.com/cloudify-incubator/cloudify-utilities-plugin/releases/download/1.2.5/cloudify_utilities_plugin-1.2.5-py27-none-linux_x86_64-centos-Core.wgn - - https://raw.githubusercontent.com/cloudify-incubator/cloudify-utilities-plugin/1.2.5/plugin.yaml - # Plugin required: https://github.com/cloudify-incubator/cloudify-kubernetes-plugin/releases/download/1.2.0/cloudify_kubernetes_plugin-1.2.0-py27-none-linux_x86_64-centos-Core.wgn - - https://raw.githubusercontent.com/cloudify-incubator/cloudify-kubernetes-plugin/1.2.0/plugin.yaml - # Plugin required: http://repository.cloudifysource.org/cloudify/wagons/cloudify-diamond-plugin/1.3.5/cloudify_diamond_plugin-1.3.5-py27-none-linux_x86_64-centos-Core.wgn - - https://raw.githubusercontent.com/cloudify-cosmo/cloudify-diamond-plugin/1.3.5/plugin.yaml - # Plugin required: http://repository.cloudifysource.org/cloudify/wagons/cloudify-fabric-plugin/1.5/cloudify_fabric_plugin-1.5-py27-none-linux_x86_64-centos-Core.wgn - - https://raw.githubusercontent.com/cloudify-cosmo/cloudify-fabric-plugin/1.5/plugin.yaml - - cloudify/types/kubernetes.yaml - -inputs: - - configuration_file_content: - type: string - - NS: - default: oom - - image: - description: Image to be used when launching agent VMs - default: { get_secret: centos_core_image } - - flavor: - description: Flavor of the agent VMs - default: { get_secret: large_image_flavor } - - agent_user: - description: > - User for connecting to agent VMs - default: centos - - app_name: - default: message-router - - security_group: - default: { concat: [ 'secgrp_', { get_input: app_name } ] } - -dsl_definitions: - - openstack_config: &openstack_config - username: { get_secret: keystone_username } - password: { get_secret: keystone_password } - tenant_name: { get_secret: keystone_tenant_name } - auth_url: { get_secret: keystone_url } - region: { get_secret: region } - -groups: - - openstack_server_port_group_zookeeper: - members: - - openstack_server_zookeeper - - openstack_port_zookeeper - - openstack_server_port_group_kafka: - members: - - openstack_server_kafka - - openstack_port_kafka - - openstack_server_port_group_dmaap: - members: - - openstack_server_dmaap - - openstack_port_dmaap - -policies: - - openstack_server_port_policies_scaling: - type: cloudify.policies.scaling - properties: - default_instances: 1 - targets: - - openstack_server_port_group_zookeeper - - openstack_server_port_group_kafka - - openstack_server_port_group_dmaap - -node_templates: - - kubernetes_service_zookeeper: - type: cloudify.kubernetes.resources.Service - properties: - definition: - apiVersion: v1 - kind: Service - metadata: - name: zookeeper - labels: - app: zookeeper - spec: - ports: - - name: zookeeper1 - port: 2181 - selector: - app: zookeeper - clusterIP: None - relationships: - - type: cloudify.kubernetes.relationships.managed_by_master - target: k8s - - type: cloudify.relationships.depends_on - target: kubernetes_deployment_zookeeper - - kubernetes_deployment_zookeeper: - type: cloudify.kubernetes.resources.Deployment - properties: - definition: - file: - resource_path: kubernetes/message-router/message-router-zookeeper.yaml - relationships: - - type: cloudify.kubernetes.relationships.managed_by_master - target: k8s - - type: cloudify.relationships.depends_on - target: kubernetes_node_zookeeper - - kubernetes_node_zookeeper: - type: cloudify.nodes.Kubernetes.Node - relationships: - - type: cloudify.relationships.contained_in - target: openstack_server_zookeeper - interfaces: - cloudify.interfaces.lifecycle: - start: - implementation: fabric.fabric_plugin.tasks.run_task - inputs: - task_properties: - hostname: { get_attribute: [ SELF, hostname ] } - labels: - app: zookeeper - - openstack_server_zookeeper: - type: cloudify.openstack.nodes.Server - properties: &openstack_server_properties - openstack_config: *openstack_config - agent_config: - user: { get_input: agent_user } - install_method: remote - port: 22 - key: { get_secret: agent_key_private } - server: - key_name: '' - image: '' - flavor: '' - management_network_name: { get_property: [ private_network, resource_id ] } - relationships: - - type: cloudify.relationships.contained_in - target: k8s_node_scaling_tier - - target: openstack_port_zookeeper - type: cloudify.openstack.server_connected_to_port - - type: cloudify.relationships.depends_on - target: cloud_init_openstack_server - interfaces: &openstack_server_interfaces - cloudify.interfaces.lifecycle: - create: - inputs: - args: - image: { get_input: image } - flavor: { get_input: flavor } - userdata: { get_attribute: [ cloud_init_openstack_server, cloud_config ] } - cloudify.interfaces.monitoring_agent: - install: - implementation: diamond.diamond_agent.tasks.install - inputs: - diamond_config: - interval: 1 - start: diamond.diamond_agent.tasks.start - stop: diamond.diamond_agent.tasks.stop - uninstall: diamond.diamond_agent.tasks.uninstall - cloudify.interfaces.monitoring: - start: - implementation: diamond.diamond_agent.tasks.add_collectors - inputs: - collectors_config: - CPUCollector: {} - MemoryCollector: {} - LoadAverageCollector: {} - DiskUsageCollector: - config: - devices: x?vd[a-z]+[0-9]*$ - NetworkCollector: {} - ProcessResourcesCollector: - config: - enabled: true - unit: B - measure_collector_time: true - cpu_interval: 0.5 - process: - hyperkube: - name: hyperkube - - openstack_port_zookeeper: - type: cloudify.openstack.nodes.Port - properties: - openstack_config: *openstack_config - relationships: &openstack_port_relationships - - type: cloudify.relationships.contained_in - target: k8s_node_scaling_tier - - type: cloudify.relationships.connected_to - target: private_network - - type: cloudify.relationships.depends_on - target: private_subnet - - type: cloudify.openstack.port_connected_to_security_group - target: security_group - - kubernetes_service_kafka: - type: cloudify.kubernetes.resources.Service - properties: - definition: - apiVersion: v1 - kind: Service - metadata: - name: global-kafka - labels: - app: global-kafka - spec: - ports: - - name: kafka1 - port: 9092 - selector: - app: global-kafka - clusterIP: None - relationships: - - type: cloudify.kubernetes.relationships.managed_by_master - target: k8s - - type: cloudify.relationships.depends_on - target: kubernetes_deployment_kafka - - kubernetes_deployment_kafka: - type: cloudify.kubernetes.resources.Deployment - properties: - definition: - file: - resource_path: kubernetes/message-router/message-router-kafka.yaml - relationships: - - type: cloudify.kubernetes.relationships.managed_by_master - target: k8s - - type: cloudify.relationships.depends_on - target: kubernetes_node_kafka - - type: cloudify.relationships.depends_on - target: kubernetes_deployment_zookeeper - - kubernetes_node_kafka: - type: cloudify.nodes.Kubernetes.Node - relationships: - - type: cloudify.relationships.contained_in - target: openstack_server_kafka - interfaces: - cloudify.interfaces.lifecycle: - start: - implementation: fabric.fabric_plugin.tasks.run_task - inputs: - task_properties: - hostname: { get_attribute: [ SELF, hostname ] } - labels: - app: global-kafka - - openstack_server_kafka: - type: cloudify.openstack.nodes.Server - properties: *openstack_server_properties - relationships: - - type: cloudify.relationships.contained_in - target: k8s_node_scaling_tier - - target: openstack_port_kafka - type: cloudify.openstack.server_connected_to_port - - type: cloudify.relationships.depends_on - target: cloud_init_openstack_server - interfaces: *openstack_server_interfaces - - openstack_port_kafka: - type: cloudify.openstack.nodes.Port - properties: - openstack_config: *openstack_config - relationships: *openstack_port_relationships - - kubernetes_service_dmaap: - type: cloudify.kubernetes.resources.Service - properties: - definition: - apiVersion: v1 - kind: Service - metadata: - name: dmaap - labels: - app: dmaap - version: 1.0.0 - spec: - ports: - - name: mr1 - port: 3904 - nodePort: 30227 - - name: mr2 - port: 3905 - nodePort: 30226 - selector: - app: dmaap - type: NodePort - relationships: - - type: cloudify.kubernetes.relationships.managed_by_master - target: k8s - - type: cloudify.relationships.depends_on - target: kubernetes_deployment_dmaap - - kubernetes_deployment_dmaap: - type: cloudify.kubernetes.resources.Deployment - properties: - definition: - file: - resource_path: kubernetes/message-router/message-router-dmaap.yaml - relationships: - - type: cloudify.kubernetes.relationships.managed_by_master - target: k8s - - type: cloudify.relationships.depends_on - target: kubernetes_node_dmaap - - type: cloudify.relationships.depends_on - target: kubernetes_deployment_zookeeper - - kubernetes_node_dmaap: - type: cloudify.nodes.Kubernetes.Node - relationships: - - type: cloudify.relationships.contained_in - target: openstack_server_dmaap - interfaces: - cloudify.interfaces.lifecycle: - start: - implementation: fabric.fabric_plugin.tasks.run_task - inputs: - task_properties: - hostname: { get_attribute: [ SELF, hostname ] } - labels: - app: global-dmaap - - openstack_server_dmaap: - type: cloudify.openstack.nodes.Server - properties: *openstack_server_properties - relationships: - - type: cloudify.relationships.contained_in - target: k8s_node_scaling_tier - - target: openstack_port_dmaap - type: cloudify.openstack.server_connected_to_port - - type: cloudify.relationships.depends_on - target: cloud_init_openstack_server - interfaces: *openstack_server_interfaces - - openstack_port_dmaap: - type: cloudify.openstack.nodes.Port - properties: - openstack_config: *openstack_config - relationships: *openstack_port_relationships - - security_group: - type: cloudify.openstack.nodes.SecurityGroup - properties: - openstack_config: *openstack_config - security_group: - name: { get_input: security_group } - description: kubernetes master security group - rules: - rules: - - remote_ip_prefix: 0.0.0.0/0 - port: 22 - - remote_ip_prefix: 0.0.0.0/0 - port: 53 - - remote_ip_prefix: 0.0.0.0/0 - port: 53 - protocol: udp - - remote_ip_prefix: 0.0.0.0/0 - port: 80 - - remote_ip_prefix: 0.0.0.0/0 - port: 443 - - remote_ip_prefix: 0.0.0.0/0 - port: 2379 - - remote_ip_prefix: 0.0.0.0/0 - port: 4001 - - remote_ip_prefix: 0.0.0.0/0 - port: 4789 - - remote_ip_prefix: 0.0.0.0/0 - port: 6443 - - remote_ip_prefix: 0.0.0.0/0 - port: 6783 - protocol: tcp - - remote_ip_prefix: 0.0.0.0/0 - port: 6783 - protocol: udp - - remote_ip_prefix: 0.0.0.0/0 - port: 6784 - protocol: tcp - - remote_ip_prefix: 0.0.0.0/0 - port: 6784 - protocol: udp - - remote_ip_prefix: 0.0.0.0/0 - port: 8000 - - remote_ip_prefix: 0.0.0.0/0 - port: 8080 - - remote_ip_prefix: 0.0.0.0/0 - port: 9090 - - remote_ip_prefix: 0.0.0.0/0 - port: 10250 - - remote_ip_prefix: 0.0.0.0/0 - port: 2181 - - remote_ip_prefix: 0.0.0.0/0 - port: 9092 - - remote_ip_prefix: 0.0.0.0/0 - port: 3904 - - remote_ip_prefix: 0.0.0.0/0 - port: 30227 - - remote_ip_prefix: 0.0.0.0/0 - port: 3905 - - remote_ip_prefix: 0.0.0.0/0 - port: 30226 - - private_subnet: - type: cloudify.openstack.nodes.Subnet - properties: - openstack_config: *openstack_config - use_external_resource: true - resource_id: { get_secret: private_subnet_name } - relationships: - - target: private_network - type: cloudify.relationships.contained_in - - private_network: - type: cloudify.openstack.nodes.Network - properties: - openstack_config: *openstack_config - use_external_resource: true - resource_id: { get_secret: private_network_name } - - external_network: - type: cloudify.openstack.nodes.Network - properties: - openstack_config: *openstack_config - use_external_resource: true - resource_id: { get_secret: external_network_name } - - cloud_init_openstack_server: - type: cloudify.nodes.CloudInit.CloudConfig - properties: - resource_config: - groups: - - docker - users: - - name: { get_input: agent_user } - primary-group: wheel - groups: docker - shell: /bin/bash - sudo: ['ALL=(ALL) NOPASSWD:ALL'] - ssh-authorized-keys: - - { get_secret: agent_key_public } - write_files: - - path: /etc/yum.repos.d/kubernetes.repo - owner: root:root - permissions: '0444' - content: | - # installed by cloud-init - [kubernetes] - name=Kubernetes - baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64 - enabled=1 - gpgcheck=1 - repo_gpgcheck=1 - gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg - https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg - packages: - - [epel-release] - - [gcc] - - [python-dev] - - [python-wheel] - - [python-setuptools] - - [libffi-devel] - - [python-devel] - - [openssl-devel] - - [docker, 1.12.6-28.git1398f24.el7.centos] - - [kubelet, 1.6.4-0] - - [kubeadm, 1.6.4-0] - - [kubectl, 1.6.4-0] - - [kubernetes-cni, 0.5.1-0] - - [git] - - [wget] - runcmd: - - systemctl enable docker - - systemctl start docker - - systemctl enable kubelet - - systemctl start kubelet - - yum install -y python-pip - - pip install --upgrade pip - - pip install docker-compose - - pip install backports.ssl_match_hostname --upgrade - - mkdir -p /tmp/oom/ - - git clone https://gerrit.onap.org/r/oom.git /tmp/oom - - sleep 15 - - chmod 755 /tmp/oom/kubernetes/config/docker/init/src/config/message-router/dcae-startup-vm-message-router/deploy.sh - - sed -i -e "s/\.\/docker_files/\/tmp\/oom\/kubernetes\/config\/docker\/init\/src\/config\/message-router\/dcae-startup-vm-message-router\/docker_files/g" /tmp/oom/kubernetes/config/docker/init/src/config/message-router/dcae-startup-vm-message-router/deploy.sh - - sed -i -e "s/\/opt\/docker\/docker-compose/\/bin\/docker-compose/g" /tmp/oom/kubernetes/config/docker/init/src/config/message-router/dcae-startup-vm-message-router/deploy.sh - - mv /tmp/oom/kubernetes/config/docker/init/src/config/message-router/dcae-startup-vm-message-router/docker_files/__docker-compose.yml /tmp/oom/kubernetes/config/docker/init/src/config/message-router/dcae-startup-vm-message-router/docker_files/docker-compose.yml - - mv /tmp/oom/kubernetes/config/docker/init/src/config/message-router/dcae-startup-vm-message-router/docker_files/__MsgRtrApi.properties /tmp/oom/kubernetes/config/docker/init/src/config/message-router/dcae-startup-vm-message-router/docker_files/MsgRtrApi.properties - - sh -c /tmp/oom/kubernetes/config/docker/init/src/config/message-router/dcae-startup-vm-message-router/deploy.sh - - k8s_node_scaling_tier: - type: cloudify.nodes.Root - - k8s: - type: cloudify.kubernetes.nodes.Master - properties: - configuration: - file_content: { get_input: configuration_file_content } - |