From 1e083940563e5e4b996d0389c62771cfbdd74cf6 Mon Sep 17 00:00:00 2001 From: Rajamohan Raj Date: Thu, 2 Jul 2020 00:48:08 +0000 Subject: Script for prometheus as composite app using orchestrator In this patch, identified few issues with rsync and came with a work around for handling list as a kind. Wrote a scipt which can deploy prometheus as a composite app using orchestrator. Issue-ID: MULTICLOUD-1110 Signed-off-by: Rajamohan Raj Change-Id: Ib7172c16a2f37dbc4715e59c5be217e154cd3be0 --- kud/tests/_common.sh | 21 +- kud/tests/prometheus-test.sh | 593 +++++++++++++++++++++ .../prometheus/servicemonitor-collectd.yaml | 20 + .../templates/prometheus/servicemonitors.yaml | 34 -- .../app2/helm/prometheus-operator/values.yaml | 20 +- 5 files changed, 642 insertions(+), 46 deletions(-) mode change 100755 => 100644 kud/tests/_common.sh create mode 100755 kud/tests/prometheus-test.sh create mode 100644 kud/tests/vnfs/comp-app/collection/app2/helm/prometheus-operator/templates/prometheus/servicemonitor-collectd.yaml delete mode 100755 kud/tests/vnfs/comp-app/collection/app2/helm/prometheus-operator/templates/prometheus/servicemonitors.yaml (limited to 'kud') diff --git a/kud/tests/_common.sh b/kud/tests/_common.sh old mode 100755 new mode 100644 index c7cd898b..35023708 --- a/kud/tests/_common.sh +++ b/kud/tests/_common.sh @@ -1189,9 +1189,26 @@ function populate_CSAR_composite_app_helm { print_msg "Create Helm Chart Archives for compositeApp" rm -f *.tar.gz tar -czf collectd.tar.gz -C $test_folder/vnfs/comp-app/collection/app1/helm . - tar -czf prometheus.tar.gz -C $test_folder/vnfs/comp-app/collection/app2/helm . + tar -czf prometheus-operator.tar.gz -C $test_folder/vnfs/comp-app/collection/app2/helm . + tar -czf m3db.tar.gz -C $test_folder/vnfs/comp-app/collection/app3/helm . tar -czf collectd_profile.tar.gz -C $test_folder/vnfs/comp-app/collection/app1/profile . - tar -czf prometheus_profile.tar.gz -C $test_folder/vnfs/comp-app/collection/app2/profile . + tar -czf prometheus-operator_profile.tar.gz -C $test_folder/vnfs/comp-app/collection/app2/profile . + tar -czf m3db_profile.tar.gz -C $test_folder/vnfs/comp-app/collection/app3/profile . + export prometheus_helm_path="${CSAR_DIR}/$1/prometheus-operator.tar.gz" + export collectd_helm_path="${CSAR_DIR}/$1/collectd.tar.gz" + export m3db_helm_path="${CSAR_DIR}/$1/m3db.tar.gz" + popd +} + + +function populate_CSAR_operator_helm { + _checks_args "$1" + pushd "${CSAR_DIR}/$1" + print_msg "Create Helm Chart Archives for operators" + rm -f *.tar.gz + tar -czf operator.tar.gz -C $test_folder/vnfs/comp-app/collection/operators/helm . + tar -czf operator_profile.tar.gz -C $test_folder/vnfs/comp-app/collection/operators/profile . + export operator_helm_path="${CSAR_DIR}/$1/operator.tar.gz" popd } diff --git a/kud/tests/prometheus-test.sh b/kud/tests/prometheus-test.sh new file mode 100755 index 00000000..6dcd29e1 --- /dev/null +++ b/kud/tests/prometheus-test.sh @@ -0,0 +1,593 @@ +# /* +# * Copyright 2020 Intel Corporation, Inc +# * +# * 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 -o errexit +set -o nounset +set -o pipefail + + +source _common_test.sh +source _functions.sh +source _common.sh + + +base_url_clm=${base_url_clm:-"http://192.168.121.29:32551/v2"} +base_url_ncm=${base_url_ncm:-"http://192.168.121.29:31406/v2"} +base_url_orchestrator=${base_url_orchestrator:-"http://192.168.121.29:30356/v2"} +base_url_rysnc=${base_url_orchestrator:-"http://192.168.121.29:31751/v2"} +CSAR_DIR="/opt/csar" +csar_id="cb009bfe-bbee-11e8-9766-525400435678" + + +app1_helm_path="$CSAR_DIR/$csar_id/prometheus-operator.tar.gz" +app1_profile_path="$CSAR_DIR/$csar_id/prometheus-operator_profile.tar.gz" +app2_helm_path="$CSAR_DIR/$csar_id/collectd.tar.gz" +app2_profile_path="$CSAR_DIR/$csar_id/collectd_profile.tar.gz" +app3_helm_path="$CSAR_DIR/$csar_id/m3db.tar.gz" +app3_profile_path="$CSAR_DIR/$csar_id/m3db_profile.tar.gz" + + +# ---------BEGIN: SET CLM DATA--------------- + +clusterprovidername="collection-cluster-provider" +clusterproviderdata="$(cat<