diff options
Diffstat (limited to 'operations')
-rw-r--r-- | operations/dcae/blueprints/k8s-datacollector.yaml | 11 | ||||
-rw-r--r-- | operations/dcae/blueprints/k8s-sleepingcelldetector.yaml | 4 | ||||
-rwxr-xr-x | operations/dcae/dcae-cli.py | 15 | ||||
-rwxr-xr-x | operations/dcae/dcae.sh | 14 | ||||
-rw-r--r-- | operations/dcae/inputs_database_password.sh | 14 | ||||
-rwxr-xr-x | operations/dcae/rapps.sh | 14 | ||||
-rwxr-xr-x | operations/scripts/enrich.sh | 11 | ||||
-rwxr-xr-x | operations/scripts/k8s_get_node_ip.sh | 17 | ||||
-rwxr-xr-x | operations/scripts/onboard-cba.sh | 14 | ||||
-rwxr-xr-x | operations/scripts/setup_onap_for_cnf.sh | 84 |
10 files changed, 162 insertions, 36 deletions
diff --git a/operations/dcae/blueprints/k8s-datacollector.yaml b/operations/dcae/blueprints/k8s-datacollector.yaml index 7cc28a4..d092936 100644 --- a/operations/dcae/blueprints/k8s-datacollector.yaml +++ b/operations/dcae/blueprints/k8s-datacollector.yaml @@ -19,7 +19,7 @@ tosca_definitions_version: cloudify_dsl_1_3 imports: - https://www.getcloudify.org/spec/cloudify/4.5.5/types.yaml - - plugin:k8splugin?version=3.4.2 + - plugin:k8splugin?version=>=3.4.3,<4.0.0 inputs: service_id: type: string @@ -28,7 +28,7 @@ inputs: image: type: string description: docker image name and version - default: "nexus3.onap.org:10001/onap/datacollector/datacollector:0.0.1-SNAPSHOT" + default: "nexus3.onap.org:10001/onap/integration/usecase/a1-policy-enforcement/datacollector" database_host: type: string description: Database host. @@ -46,9 +46,9 @@ inputs: type: string description: DMaaP host. default: "message-router" - ves_measurements_topic_name: + ves_measurements_topics_name: type: string - default: "unauthenticated.VES_MEASUREMENT_OUTPUT" + default: "events/unauthenticated.VES_MEASUREMENT_OUTPUT/mygroup/mycus, events/org.onap.dmaap.mr.PERFORMANCE_MEASUREMENTS/mygroup/mycus" node_templates: @@ -62,8 +62,7 @@ node_templates: DMAAP_HOST: { get_input: dmaap_host } DMAAP_PORT: "3904" DMAAP_PROTOCOL: "http" - # "events/unauthenticated.VES_MEASUREMENT_OUTPUT/mygroup/mycus" - DMAAP_MEASUREMENTS_TOPIC: {concat: ["events/", { get_input: ves_measurements_topic_name }, "/mygroup/mycus"]} + DMAAP_MEASUREMENTS_TOPICS: { get_input: ves_measurements_topics_name } DATABASE_HOST: { get_input: database_host } DATABASE_PORT: "3306" DATABASE_NAME: "ves" diff --git a/operations/dcae/blueprints/k8s-sleepingcelldetector.yaml b/operations/dcae/blueprints/k8s-sleepingcelldetector.yaml index e06b508..fe087fa 100644 --- a/operations/dcae/blueprints/k8s-sleepingcelldetector.yaml +++ b/operations/dcae/blueprints/k8s-sleepingcelldetector.yaml @@ -19,7 +19,7 @@ tosca_definitions_version: cloudify_dsl_1_3 imports: - https://www.getcloudify.org/spec/cloudify/4.5.5/types.yaml - - plugin:k8splugin?version=3.4.2 + - plugin:k8splugin?version=>=3.4.3,<4.0.0 inputs: service_id: type: string @@ -28,7 +28,7 @@ inputs: image: type: string description: docker image name and version - default: "nexus3.onap.org:10001/onap/sleepingcelldetector/sleepingcelldetector:0.0.1-SNAPSHOT" + default: "nexus3.onap.org:10001/onap/integration/usecase/a1-policy-enforcement/sleepingcelldetector" node_templates: rapp-sleepingcelldetector: diff --git a/operations/dcae/dcae-cli.py b/operations/dcae/dcae-cli.py index 49db4f1..aee288e 100755 --- a/operations/dcae/dcae-cli.py +++ b/operations/dcae/dcae-cli.py @@ -1,10 +1,15 @@ #!/usr/bin/env python +# Copyright (C) 2021 by Samsung Electronics Co., Ltd. # -# Copyright (C) 2020 by Samsung Electronics Co., Ltd. -# -# This software is the confidential and proprietary information of Samsung Electronics co., Ltd. -# ("Confidential Information"). You shall not disclose such Confidential Information and shall use -# it only in accordance with the terms of the license agreement you entered into with Samsung. +# 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 """Cli application for ONAP DCAE Dashboard for managing DCAE Microservices. diff --git a/operations/dcae/dcae.sh b/operations/dcae/dcae.sh index 31bb334..a7807ea 100755 --- a/operations/dcae/dcae.sh +++ b/operations/dcae/dcae.sh @@ -1,9 +1,15 @@ #!/bin/bash -# Copyright (C) 2019 by Samsung Electronics Co., Ltd. +# Copyright (C) 2021 by Samsung Electronics Co., Ltd. # -# This software is the confidential and proprietary information of Samsung Electronics co., Ltd. -# ("Confidential Information"). You shall not disclose such Confidential Information and shall use -# it only in accordance with the terms of the license agreement you entered into with Samsung. +# 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 # # Onboard R-APP blueprint and deploy R-APP as DCAE Microservice. diff --git a/operations/dcae/inputs_database_password.sh b/operations/dcae/inputs_database_password.sh index 9e4f883..e20866b 100644 --- a/operations/dcae/inputs_database_password.sh +++ b/operations/dcae/inputs_database_password.sh @@ -1,8 +1,14 @@ #!/bin/bash -# Copyright (C) 2019 by Samsung Electronics Co., Ltd. +# Copyright (C) 2021 by Samsung Electronics Co., Ltd. # -# This software is the confidential and proprietary information of Samsung Electronics co., Ltd. -# ("Confidential Information"). You shall not disclose such Confidential Information and shall use -# it only in accordance with the terms of the license agreement you entered into with Samsung. +# 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 export DATABASE_PASSWORD=${DATABASE_PASSWORD:-$(kubectl get secret `kubectl get secrets | grep mariadb-galera-db-root-password | awk '{print $1}'` -o jsonpath="{.data.password}" | base64 --decode)} diff --git a/operations/dcae/rapps.sh b/operations/dcae/rapps.sh index 8d51f5b..fe58f6f 100755 --- a/operations/dcae/rapps.sh +++ b/operations/dcae/rapps.sh @@ -1,9 +1,15 @@ #!/bin/bash -# Copyright (C) 2019 by Samsung Electronics Co., Ltd. +# Copyright (C) 2021 by Samsung Electronics Co., Ltd. # -# This software is the confidential and proprietary information of Samsung Electronics co., Ltd. -# ("Confidential Information"). You shall not disclose such Confidential Information and shall use -# it only in accordance with the terms of the license agreement you entered into with Samsung. +# 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 set -e diff --git a/operations/scripts/enrich.sh b/operations/scripts/enrich.sh index 0e3921f..e02efa1 100755 --- a/operations/scripts/enrich.sh +++ b/operations/scripts/enrich.sh @@ -1,4 +1,15 @@ #!/bin/bash +# Copyright (C) 2021 by Samsung Electronics Co., Ltd. +# +# 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 usage() { echo "Usage:" diff --git a/operations/scripts/k8s_get_node_ip.sh b/operations/scripts/k8s_get_node_ip.sh index 4f423e8..36e416c 100755 --- a/operations/scripts/k8s_get_node_ip.sh +++ b/operations/scripts/k8s_get_node_ip.sh @@ -1,11 +1,14 @@ #!/bin/bash -# Copyright (C) 2018 by Samsung Electronics Co., Ltd. +# Copyright (C) 2021 by Samsung Electronics Co., Ltd. # -# This software is the confidential and proprietary information of Samsung Electronics co., Ltd. -# ("Confidential Information"). You shall not disclose such Confidential Information and shall use -# it only in accordance with the terms of the license agreement you entered into with Samsung. +# 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 -# -# Echo Kubernetes cluster first node's internal IP address -# kubectl get nodes -o jsonpath='{ $.items[*].status.addresses[?(@.type=="InternalIP")].address }' | cut -d ' ' -f 1 diff --git a/operations/scripts/onboard-cba.sh b/operations/scripts/onboard-cba.sh index 9c80d58..bdd8de7 100755 --- a/operations/scripts/onboard-cba.sh +++ b/operations/scripts/onboard-cba.sh @@ -1,9 +1,15 @@ #!/bin/bash -# Copyright (C) 2019 by Samsung Electronics Co., Ltd. +# Copyright (C) 2021 by Samsung Electronics Co., Ltd. # -# This software is the confidential and proprietary information of Samsung Electronics co., Ltd. -# ("Confidential Information"). You shall not disclose such Confidential Information and shall use -# it only in accordance with the terms of the license agreement you entered into with Samsung. +# 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 # # Onboards CDS model into CDS runtime. CDS model package file is called CBA (CDS Model Package). diff --git a/operations/scripts/setup_onap_for_cnf.sh b/operations/scripts/setup_onap_for_cnf.sh new file mode 100755 index 0000000..e5cba41 --- /dev/null +++ b/operations/scripts/setup_onap_for_cnf.sh @@ -0,0 +1,84 @@ +#!/bin/bash +# This scripts preloads ONAP with some relevant entries required to orchestrate CNFs +# Some steps may fail if script is ran non-first time on environment so strict error checking is turned off +set +e -x +aai_curl() { + curl -ksSL -H "X-TransactionId: $RANDOM" -H "X-FromAppId: Jenkins" -H "Content-Type: application/json" -H "Accept: application/json" \ + -H "Authorization: Basic QUFJOkFBSQ==" "$@" +} +MASTER_IP="${1:?Missing mandatory positional parameter}" + +echo "Handling AAI Entries" +aai_curl -X PUT "https://${MASTER_IP}:30233/aai/v16/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/K8sRegion" \ + --data '{ + "cloud-owner": "CloudOwner", + "cloud-region-id": "K8sRegion", + "cloud-type": "k8s", + "owner-defined-type": "t1", + "cloud-region-version": "1.0", + "complex-name": "clli1", + "cloud-zone": "CloudZone", + "sriov-automation": false + }' +aai_curl -X PUT "https://${MASTER_IP}:30233/aai/v16/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/K8sRegion/vip-ipv4-address-list/${MASTER_IP}" \ + --data "{ + \"vip-ipv4-address\": \"${MASTER_IP}\" + }" +aai_curl -X PUT "https://${MASTER_IP}:30233/aai/v16/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/K8sRegion/relationship-list/relationship" \ + --data '{ + "related-to": "complex", + "related-link": "/aai/v16/cloud-infrastructure/complexes/complex/clli1", + "relationship-data": [ + { + "relationship-key": "complex.physical-location-id", + "relationship-value": "clli1" + } + ] + }' +aai_curl -X PUT "https://${MASTER_IP}:30233/aai/v16/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/K8sRegion/availability-zones/availability-zone/k8savz" \ + --data '{ + "availability-zone-name": "k8savz", + "hypervisor-type": "k8s" + }' +aai_curl -X PUT "https://${MASTER_IP}:30233/aai/v16/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/K8sRegion/tenants/tenant/k8stenant" \ + --data '{ + "tenant-id": "k8stenant", + "tenant-name": "k8stenant", + "relationship-list": { + "relationship": [ + { + "related-to": "service-subscription", + "relationship-label": "org.onap.relationships.inventory.Uses", + "related-link": "/aai/v16/business/customers/customer/Demonstration/service-subscriptions/service-subscription/vFW", + "relationship-data": [ + { + "relationship-key": "customer.global-customer-id", + "relationship-value": "Demonstration" + }, + { + "relationship-key": "service-subscription.service-type", + "relationship-value": "vFW" + } + ] + } + ] + } + }' + +echo "Configuring k8splugin" +curl -ksSL -X POST "https://${MASTER_IP}:30283/api/multicloud-k8s/v1/v1/connectivity-info" \ + --header "Content-Type: multipart/form-data" \ + --form "file=@${HOME}/.kube/config" \ + --form metadata='{ + "cloud-region": "K8sRegion", + "cloud-owner": "CloudOwner" + }' + +echo "Configuring SO" +pass=$(kubectl get "$(kubectl get secrets -o name | grep mariadb-galera-db-root-password)" \ + -o jsonpath="{.data.password}" | base64 --decode) +kubectl -n onap exec onap-mariadb-galera-0 -- \ + mysql -uroot -p"${pass}" -D catalogdb -e \ + 'INSERT IGNORE INTO + cloud_sites(ID, REGION_ID, IDENTITY_SERVICE_ID, CLOUD_VERSION, CLLI, ORCHESTRATOR) + values("K8sRegion", "K8sRegion", "DEFAULT_KEYSTONE", "2.5", "clli1", "multicloud");' |