diff options
author | Rajamohan Raj <rajamohan.raj@intel.com> | 2020-07-02 00:48:08 +0000 |
---|---|---|
committer | Rajamohan Raj <rajamohan.raj@intel.com> | 2020-07-07 01:37:58 +0000 |
commit | 1e083940563e5e4b996d0389c62771cfbdd74cf6 (patch) | |
tree | c83e3d9f67a1a2a7895ccb7aecbf3f38667c599d /kud | |
parent | 8b071065d68d664446a5e232a931c43ad2edebc5 (diff) |
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 <rajamohan.raj@intel.com>
Change-Id: Ib7172c16a2f37dbc4715e59c5be217e154cd3be0
Diffstat (limited to 'kud')
5 files changed, 642 insertions, 46 deletions
diff --git a/kud/tests/_common.sh b/kud/tests/_common.sh index c7cd898b..35023708 100755..100644 --- 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<<EOF +{ + "metadata": { + "name": "$clusterprovidername", + "description": "description of $clusterprovidername", + "userData1": "$clusterprovidername user data 1", + "userData2": "$clusterprovidername user data 2" + } +} +EOF +)" + +clustername="edge1" +clusterdata="$(cat<<EOF +{ + "metadata": { + "name": "$clustername", + "description": "description of $clustername", + "userData1": "$clustername user data 1", + "userData2": "$clustername user data 2" + } +} +EOF +)" + +kubeconfigedge1="/opt/kud/multi-cluster/edge1/artifacts/admin.conf" + +labelname="LabelA" +labeldata="$(cat<<EOF +{"label-name": "$labelname"} +EOF +)" + +clustername2="edge2" +clusterdata2="$(cat<<EOF +{ + "metadata": { + "name": "$clustername2", + "description": "description of $clustername2", + "userData1": "$clustername2 user data 1", + "userData2": "$clustername2 user data 2" + } +} +EOF +)" + +kubeconfigedge2="/opt/kud/multi-cluster/edge2/artifacts/admin.conf" + +labelname2="LabelA" +labeldata2="$(cat<<EOF +{"label-name": "$labelname2"} +EOF +)" + +clustername3="cluster1" +clusterdata3="$(cat<<EOF +{ + "metadata": { + "name": "$clustername3", + "description": "description of $clustername3", + "userData1": "$clustername3 user data 1", + "userData2": "$clustername3 user data 2" + } +} +EOF +)" + +kubeconfigcluster1="/opt/kud/multi-cluster/cluster1/artifacts/admin.conf" + +labelname3="LabelForCluster1" +labeldata3="$(cat<<EOF +{"label-name": "$labelname3"} +EOF +)" + +#--TODO--Creating provider network and network intents---- + +# add the rsync controller entry +rsynccontrollername="rsync" +rsynccontrollerdata="$(cat<<EOF +{ + "metadata": { + "name": "rsync", + "description": "description of $rsynccontrollername controller", + "userData1": "user data 1 for $rsynccontrollername", + "userData2": "user data 2 for $rsynccontrollername" + }, + "spec": { + "host": "${rsynccontrollername}", + "port": 9041 + } +} +EOF +)" + +# ------------END: SET CLM DATA-------------- + + +#-------------BEGIN:SET ORCH DATA------------------ + +# define a project +projectname="TestProject" +projectdata="$(cat<<EOF +{ + "metadata": { + "name": "$projectname", + "description": "description of $projectname controller", + "userData1": "$projectname user data 1", + "userData2": "$projectname user data 2" + } +} +EOF +)" + +# define a composite application +collection_compositeapp_name="CollectionCompositeApp" +compositeapp_version="v1" +compositeapp_data="$(cat <<EOF +{ + "metadata": { + "name": "${collection_compositeapp_name}", + "description": "description of ${collection_compositeapp_name}", + "userData1": "user data 1 for ${collection_compositeapp_name}", + "userData2": "user data 2 for ${collection_compositeapp_name}" + }, + "spec":{ + "version":"${compositeapp_version}" + } +} +EOF +)" + +# add app entries for the prometheus app into +# compositeApp + +prometheus_app_name="prometheus-operator" +prometheus_helm_chart=${app1_helm_path} + +prometheus_app_data="$(cat <<EOF +{ + "metadata": { + "name": "${prometheus_app_name}", + "description": "description for app ${prometheus_app_name}", + "userData1": "user data 2 for ${prometheus_app_name}", + "userData2": "user data 2 for ${prometheus_app_name}" + } +} +EOF +)" + +# add app entries for the collectd app into +# compositeApp + +collectd_app_name="collectd" +collectd_helm_chart=${app2_helm_path} + +collectd_app_data="$(cat <<EOF +{ + "metadata": { + "name": "${collectd_app_name}", + "description": "description for app ${collectd_app_name}", + "userData1": "user data 2 for ${collectd_app_name}", + "userData2": "user data 2 for ${collectd_app_name}" + } +} +EOF +)" + +# add app entries for the m3db app into +# compositeApp + +m3db_app_name="m3db" +m3db_helm_chart=${app3_helm_path} + +m3db_app_data="$(cat <<EOF +{ + "metadata": { + "name": "${m3db_app_name}", + "description": "description for app ${m3db_app_name}", + "userData1": "user data 2 for ${m3db_app_name}", + "userData2": "user data 2 for ${m3db_app_name}" + } +} +EOF +)" + +# Add the composite profile +collection_composite_profile_name="collection_composite-profile" +collection_composite_profile_data="$(cat <<EOF +{ + "metadata":{ + "name":"${collection_composite_profile_name}", + "description":"description of ${collection_composite_profile_name}", + "userData1":"user data 1 for ${collection_composite_profile_name}", + "userData2":"user data 2 for ${collection_composite_profile_name}" + } +} +EOF +)" + +# Add the prometheus profile data into collection profile data +prometheus_profile_name="prometheus-profile" +prometheus_profile_file=$app1_profile_path +prometheus_profile_data="$(cat <<EOF +{ + "metadata":{ + "name":"${prometheus_profile_name}", + "description":"description of ${prometheus_profile_name}", + "userData1":"user data 1 for ${prometheus_profile_name}", + "userData2":"user data 2 for ${prometheus_profile_name}" + }, + "spec":{ + "app-name": "${prometheus_app_name}" + } +} +EOF +)" + +# Add the collectd profile data into collection profile data +collectd_profile_name="collectd-profile" +collectd_profile_file=$app2_profile_path +collectd_profile_data="$(cat <<EOF +{ + "metadata":{ + "name":"${collectd_profile_name}", + "description":"description of ${collectd_profile_name}", + "userData1":"user data 1 for ${collectd_profile_name}", + "userData2":"user data 2 for ${collectd_profile_name}" + }, + "spec":{ + "app-name": "${collectd_app_name}" + } +} +EOF +)" + +# Add the m3db profile data into collection profile data +m3db_profile_name="m3db-profile" +m3db_profile_file=$app3_profile_path +m3db_profile_data="$(cat <<EOF +{ + "metadata":{ + "name":"${m3db_profile_name}", + "description":"description of ${m3db_profile_name}", + "userData1":"user data 1 for ${m3db_profile_name}", + "userData2":"user data 2 for ${m3db_profile_name}" + }, + "spec":{ + "app-name": "${m3db_app_name}" + } +} +EOF +)" + +# define the generic placement intent +generic_placement_intent_name="generic-placement-intent" +generic_placement_intent_data="$(cat <<EOF +{ + "metadata":{ + "name":"${generic_placement_intent_name}", + "description":"${generic_placement_intent_name}", + "userData1":"${generic_placement_intent_name}", + "userData2":"${generic_placement_intent_name}" + }, + "spec":{ + "logical-cloud":"unused_logical_cloud" + } +} +EOF +)" + +# define app placement intent for prometheus +prometheus_placement_intent_name="prometheus-placement-intent" +prometheus_placement_intent_data="$(cat <<EOF +{ + "metadata":{ + "name":"${prometheus_placement_intent_name}", + "description":"description of ${prometheus_placement_intent_name}", + "userData1":"user data 1 for ${prometheus_placement_intent_name}", + "userData2":"user data 2 for ${prometheus_placement_intent_name}" + }, + "spec":{ + "app-name":"${prometheus_app_name}", + "intent":{ + "allOf":[ + { "provider-name":"${clusterprovidername}", + "cluster-label-name":"${labelname}" + } + ] + } + } +} +EOF +)" + +# define app placement intent for collectd +collectd_placement_intent_name="collectd-placement-intent" +collectd_placement_intent_data="$(cat <<EOF +{ + "metadata":{ + "name":"${collectd_placement_intent_name}", + "description":"description of ${collectd_placement_intent_name}", + "userData1":"user data 1 for ${collectd_placement_intent_name}", + "userData2":"user data 2 for ${collectd_placement_intent_name}" + }, + "spec":{ + "app-name":"${collectd_app_name}", + "intent":{ + "allOf":[ + { "provider-name":"${clusterprovidername}", + "cluster-label-name":"${labelname}" + } + ] + } + } +} +EOF +)" + +# define app placement intent for m3db +m3db_placement_intent_name="m3db-placement-intent" +m3db_placement_intent_data="$(cat <<EOF +{ + "metadata":{ + "name":"${m3db_placement_intent_name}", + "description":"description of ${m3db_placement_intent_name}", + "userData1":"user data 1 for ${m3db_placement_intent_name}", + "userData2":"user data 2 for ${m3db_placement_intent_name}" + }, + "spec":{ + "app-name":"${m3db_app_name}", + "intent":{ + "allOf":[ + { "provider-name":"${clusterprovidername}", + "cluster-label-name":"${labelname3}" + } + ] + } + } +} +EOF +)" + +# define a deployment intent group +release="collection" +deployment_intent_group_name="collection_deployment_intent_group" +deployment_intent_group_data="$(cat <<EOF +{ + "metadata":{ + "name":"${deployment_intent_group_name}", + "description":"descriptiont of ${deployment_intent_group_name}", + "userData1":"user data 1 for ${deployment_intent_group_name}", + "userData2":"user data 2 for ${deployment_intent_group_name}" + }, + "spec":{ + "profile":"${collection_composite_profile_name}", + "version":"${release}", + "override-values":[] + } +} +EOF +)" + +# define the intents to be used by the group +deployment_intents_in_group_name="collection_deploy_intents" +deployment_intents_in_group_data="$(cat <<EOF +{ + "metadata":{ + "name":"${deployment_intents_in_group_name}", + "description":"descriptionf of ${deployment_intents_in_group_name}", + "userData1":"user data 1 for ${deployment_intents_in_group_name}", + "userData2":"user data 2 for ${deployment_intents_in_group_name}" + }, + "spec":{ + "intent":{ + "genericPlacementIntent":"${generic_placement_intent_name}" + } + } +} +EOF +)" + + +#---------END: SET ORCH DATA-------------------- + + +function createOrchestratorData { + + print_msg "creating controller entries" + call_api -d "${rsynccontrollerdata}" "${base_url_orchestrator}/controllers" + print_msg "creating project entry" + call_api -d "${projectdata}" "${base_url_orchestrator}/projects" + + print_msg "creating collection composite app entry" + call_api -d "${compositeapp_data}" "${base_url_orchestrator}/projects/${projectname}/composite-apps" + + print_msg "adding prometheus app to the composite app" + call_api -F "metadata=${prometheus_app_data}" \ + -F "file=@${prometheus_helm_chart}" \ + "${base_url_orchestrator}/projects/${projectname}/composite-apps/${collection_compositeapp_name}/${compositeapp_version}/apps" + + print_msg "adding collectd app to the composite app" + call_api -F "metadata=${collectd_app_data}" \ + -F "file=@${collectd_helm_chart}" \ + "${base_url_orchestrator}/projects/${projectname}/composite-apps/${collection_compositeapp_name}/${compositeapp_version}/apps" + + + print_msg "adding m3db app to the composite app" + call_api -F "metadata=${m3db_app_data}" \ + -F "file=@${m3db_helm_chart}" \ + "${base_url_orchestrator}/projects/${projectname}/composite-apps/${collection_compositeapp_name}/${compositeapp_version}/apps" + + print_msg "creating collection composite profile entry" + call_api -d "${collection_composite_profile_data}" "${base_url_orchestrator}/projects/${projectname}/composite-apps/${collection_compositeapp_name}/${compositeapp_version}/composite-profiles" + + print_msg "adding prometheus app profiles to the composite profile" + call_api -F "metadata=${prometheus_profile_data}" \ + -F "file=@${prometheus_profile_file}" \ + "${base_url_orchestrator}/projects/${projectname}/composite-apps/${collection_compositeapp_name}/${compositeapp_version}/composite-profiles/${collection_composite_profile_name}/profiles" + + print_msg "adding collectd app profiles to the composite profile" + call_api -F "metadata=${collectd_profile_data}" \ + -F "file=@${collectd_profile_file}" \ + "${base_url_orchestrator}/projects/${projectname}/composite-apps/${collection_compositeapp_name}/${compositeapp_version}/composite-profiles/${collection_composite_profile_name}/profiles" + + print_msg "adding m3db app profiles to the composite profile" + call_api -F "metadata=${m3db_profile_data}" \ + -F "file=@${m3db_profile_file}" \ + "${base_url_orchestrator}/projects/${projectname}/composite-apps/${collection_compositeapp_name}/${compositeapp_version}/composite-profiles/${collection_composite_profile_name}/profiles" + + print_msg "create the generic placement intent" + call_api -d "${generic_placement_intent_data}" \ + "${base_url_orchestrator}/projects/${projectname}/composite-apps/${collection_compositeapp_name}/${compositeapp_version}/generic-placement-intents" + + print_msg "add the prometheus app placement intent to the generic placement intent" + call_api -d "${prometheus_placement_intent_data}" \ + "${base_url_orchestrator}/projects/${projectname}/composite-apps/${collection_compositeapp_name}/${compositeapp_version}/generic-placement-intents/${generic_placement_intent_name}/app-intents" + + print_msg "add the collectd app placement intent to the generic placement intent" + call_api -d "${collectd_placement_intent_data}" \ + "${base_url_orchestrator}/projects/${projectname}/composite-apps/${collection_compositeapp_name}/${compositeapp_version}/generic-placement-intents/${generic_placement_intent_name}/app-intents" + + print_msg "add the collectd app placement intent to the generic placement intent" + call_api -d "${m3db_placement_intent_data}" \ + "${base_url_orchestrator}/projects/${projectname}/composite-apps/${collection_compositeapp_name}/${compositeapp_version}/generic-placement-intents/${generic_placement_intent_name}/app-intents" + + + print_msg "create the deployment intent group" + call_api -d "${deployment_intent_group_data}" \ + "${base_url_orchestrator}/projects/${projectname}/composite-apps/${collection_compositeapp_name}/${compositeapp_version}/deployment-intent-groups" + call_api -d "${deployment_intents_in_group_data}" \ + "${base_url_orchestrator}/projects/${projectname}/composite-apps/${collection_compositeapp_name}/${compositeapp_version}/deployment-intent-groups/${deployment_intent_group_name}/intents" + +} + +function deleteOrchestratorData { + # TODO- delete rsync controller and any other controller + delete_resource "${base_url_orchestrator}/controllers/${rsynccontrollername}" + + delete_resource "${base_url_orchestrator}/projects/${projectname}/composite-apps/${collection_compositeapp_name}/${compositeapp_version}/deployment-intent-groups/${deployment_intent_group_name}/intents/${deployment_intents_in_group_name}" + delete_resource "${base_url_orchestrator}/projects/${projectname}/composite-apps/${collection_compositeapp_name}/${compositeapp_version}/deployment-intent-groups/${deployment_intent_group_name}" + delete_resource "${base_url_orchestrator}/projects/${projectname}/composite-apps/${collection_compositeapp_name}/${compositeapp_version}/generic-placement-intents/${generic_placement_intent_name}/app-intents/${prometheus_placement_intent_name}" + delete_resource "${base_url_orchestrator}/projects/${projectname}/composite-apps/${collection_compositeapp_name}/${compositeapp_version}/generic-placement-intents/${generic_placement_intent_name}/app-intents/${collectd_placement_intent_name}" + + delete_resource "${base_url_orchestrator}/projects/${projectname}/composite-apps/${collection_compositeapp_name}/${compositeapp_version}/generic-placement-intents/${generic_placement_intent_name}/app-intents/${m3db_placement_intent_name}" + + delete_resource "${base_url_orchestrator}/projects/${projectname}/composite-apps/${collection_compositeapp_name}/${compositeapp_version}/generic-placement-intents/${generic_placement_intent_name}" + + delete_resource "${base_url_orchestrator}/projects/${projectname}/composite-apps/${collection_compositeapp_name}/${compositeapp_version}/composite-profiles/${collection_composite_profile_name}/profiles/${prometheus_profile_name}" + delete_resource "${base_url_orchestrator}/projects/${projectname}/composite-apps/${collection_compositeapp_name}/${compositeapp_version}/composite-profiles/${collection_composite_profile_name}/profiles/${collectd_profile_name}" + + delete_resource "${base_url_orchestrator}/projects/${projectname}/composite-apps/${collection_compositeapp_name}/${compositeapp_version}/composite-profiles/${collection_composite_profile_name}/profiles/${m3db_profile_name}" + + delete_resource "${base_url_orchestrator}/projects/${projectname}/composite-apps/${collection_compositeapp_name}/${compositeapp_version}/composite-profiles/${collection_composite_profile_name}" + + delete_resource "${base_url_orchestrator}/projects/${projectname}/composite-apps/${collection_compositeapp_name}/${compositeapp_version}/apps/${prometheus_app_name}" + + delete_resource "${base_url_orchestrator}/projects/${projectname}/composite-apps/${collection_compositeapp_name}/${compositeapp_version}/apps/${collectd_app_name}" + + delete_resource "${base_url_orchestrator}/projects/${projectname}/composite-apps/${collection_compositeapp_name}/${compositeapp_version}/apps/${m3db_app_name}" + + delete_resource "${base_url_orchestrator}/projects/${projectname}/composite-apps/${collection_compositeapp_name}/${compositeapp_version}" + delete_resource "${base_url_orchestrator}/projects/${projectname}" +} + + +function createClmData { + print_msg "Creating cluster provider and cluster" + call_api -d "${clusterproviderdata}" "${base_url_clm}/cluster-providers" + + call_api -H "Content-Type: multipart/form-data" -F "metadata=$clusterdata" -F "file=@$kubeconfigedge1" "${base_url_clm}/cluster-providers/${clusterprovidername}/clusters" + + call_api -H "Content-Type: multipart/form-data" -F "metadata=$clusterdata2" -F "file=@$kubeconfigedge2" "${base_url_clm}/cluster-providers/${clusterprovidername}/clusters" + + call_api -H "Content-Type: multipart/form-data" -F "metadata=$clusterdata3" -F "file=@$kubeconfigcluster1" "${base_url_clm}/cluster-providers/${clusterprovidername}/clusters" + + call_api -d "${labeldata}" "${base_url_clm}/cluster-providers/${clusterprovidername}/clusters/${clustername}/labels" + + call_api -d "${labeldata2}" "${base_url_clm}/cluster-providers/${clusterprovidername}/clusters/${clustername2}/labels" + + call_api -d "${labeldata3}" "${base_url_clm}/cluster-providers/${clusterprovidername}/clusters/${clustername3}/labels" +} + +function deleteClmData { + + delete_resource "${base_url_clm}/cluster-providers/${clusterprovidername}/clusters/${clustername}/labels/${labelname}" + delete_resource "${base_url_clm}/cluster-providers/${clusterprovidername}/clusters/${clustername2}/labels/${labelname2}" + delete_resource "${base_url_clm}/cluster-providers/${clusterprovidername}/clusters/${clustername3}/labels/${labelname3}" + + delete_resource "${base_url_clm}/cluster-providers/${clusterprovidername}/clusters/${clustername}" + delete_resource "${base_url_clm}/cluster-providers/${clusterprovidername}/clusters/${clustername2}" + delete_resource "${base_url_clm}/cluster-providers/${clusterprovidername}/clusters/${clustername3}" + + delete_resource "${base_url_clm}/cluster-providers/${clusterprovidername}" +} + +function createData { + createClmData + createOrchestratorData +} +function deleteData { + deleteClmData + deleteOrchestratorData +} +# function ApplyNcmData { +# call_api -d "{ }" "${base_url_ncm}/cluster-providers/${clusterprovidername}/clusters/${clustername}/apply" +# call_api -d "{ }" "${base_url_ncm}/cluster-providers/${clusterprovidername}/clusters/${clustername2}/apply" +# } + +# function terminateNcmData { +# call_api -d "{ }" "${base_url_ncm}/cluster-providers/${clusterprovidername}/clusters/${clustername}/terminate" +# call_api -d "{ }" "${base_url_ncm}/cluster-providers/${clusterprovidername}/clusters/${clustername2}/terminate" +# } + +function instantiate { + # call_api -d "{ }" "${base_url_orchestrator}/projects/${projectname}/composite-apps/${vfw_compositeapp_name}/${vfw_compositeapp_version}/deployment-intent-groups/${deployment_intent_group_name}/approve" + call_api -d "{ }" "${base_url_orchestrator}/projects/${projectname}/composite-apps/${collection_compositeapp_name}/${compositeapp_version}/deployment-intent-groups/${deployment_intent_group_name}/instantiate" +} + +# Setup +install_deps +populate_CSAR_composite_app_helm "$csar_id" + +deleteData +createData +instantiate + diff --git a/kud/tests/vnfs/comp-app/collection/app2/helm/prometheus-operator/templates/prometheus/servicemonitor-collectd.yaml b/kud/tests/vnfs/comp-app/collection/app2/helm/prometheus-operator/templates/prometheus/servicemonitor-collectd.yaml new file mode 100644 index 00000000..6bd961c0 --- /dev/null +++ b/kud/tests/vnfs/comp-app/collection/app2/helm/prometheus-operator/templates/prometheus/servicemonitor-collectd.yaml @@ -0,0 +1,20 @@ +{{- if and .Values.prometheus.enabled .Values.prometheus.additionalServiceMonitors }} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: service-monitor-collectd + namespace: {{ $.Release.Namespace | quote }} + labels: + app: {{ template "prometheus-operator.name" $ }}-prometheus +{{ include "prometheus-operator.labels" $ | indent 8 }} + collector: collectd +spec: + endpoints: + - interval : 10s + path: /metrics + port: collectd-prometheus + jobLabel: collectd + selector: + matchLabels: + app: collectd +{{- end }} diff --git a/kud/tests/vnfs/comp-app/collection/app2/helm/prometheus-operator/templates/prometheus/servicemonitors.yaml b/kud/tests/vnfs/comp-app/collection/app2/helm/prometheus-operator/templates/prometheus/servicemonitors.yaml deleted file mode 100755 index 4da752ff..00000000 --- a/kud/tests/vnfs/comp-app/collection/app2/helm/prometheus-operator/templates/prometheus/servicemonitors.yaml +++ /dev/null @@ -1,34 +0,0 @@ -{{- if and .Values.prometheus.enabled .Values.prometheus.additionalServiceMonitors }} -apiVersion: v1 -kind: List -items: -{{- range .Values.prometheus.additionalServiceMonitors }} - - apiVersion: monitoring.coreos.com/v1 - kind: ServiceMonitor - metadata: - name: {{ .name }} - namespace: {{ $.Release.Namespace | quote }} - labels: - app: {{ template "prometheus-operator.name" $ }}-prometheus -{{ include "prometheus-operator.labels" $ | indent 8 }} - {{- if .additionalLabels }} -{{ toYaml .additionalLabels | indent 8 }} - {{- end }} - spec: - endpoints: -{{ toYaml .endpoints | indent 8 }} - {{- if .jobLabel }} - jobLabel: {{ .jobLabel }} - {{- end }} - {{- if .namespaceSelector }} - namespaceSelector: -{{ toYaml .namespaceSelector | indent 8 }} - {{- end }} - selector: -{{ toYaml .selector | indent 8 }} - {{- if .targetLabels }} - targetLabels: -{{ toYaml .targetLabels | indent 8 }} - {{- end }} -{{- end }} -{{- end }} diff --git a/kud/tests/vnfs/comp-app/collection/app2/helm/prometheus-operator/values.yaml b/kud/tests/vnfs/comp-app/collection/app2/helm/prometheus-operator/values.yaml index d493e23e..f4332e7f 100755 --- a/kud/tests/vnfs/comp-app/collection/app2/helm/prometheus-operator/values.yaml +++ b/kud/tests/vnfs/comp-app/collection/app2/helm/prometheus-operator/values.yaml @@ -474,7 +474,7 @@ alertmanager: ## Using default values from https://github.com/helm/charts/blob/master/stable/grafana/values.yaml ## grafana: - enabled: true + enabled: false ## Deploy default dashboards. ## @@ -567,7 +567,7 @@ grafana: ## Scrape interval. If not set, the Prometheus default scrape interval is used. ## interval: "" - selfMonitor: true + selfMonitor: false ## metric relabel configs to apply to samples before ingestion. ## @@ -589,7 +589,7 @@ grafana: ## Component scraping the kube api server ## kubeApiServer: - enabled: true + enabled: false tlsConfig: serverName: kubernetes insecureSkipVerify: false @@ -626,7 +626,7 @@ kubeApiServer: ## Component scraping the kubelet and kubelet-hosted cAdvisor ## kubelet: - enabled: true + enabled: false namespace: kube-system serviceMonitor: @@ -698,7 +698,7 @@ kubelet: ## Component scraping the kube controller manager ## kubeControllerManager: - enabled: true + enabled: false ## If your kube controller manager is not deployed as a pod, specify IPs it can be found on ## @@ -751,7 +751,7 @@ kubeControllerManager: ## Component scraping coreDns. Use either this or kubeDns ## coreDns: - enabled: true + enabled: false service: port: 9153 targetPort: 9153 @@ -831,7 +831,7 @@ kubeDns: ## Component scraping etcd ## kubeEtcd: - enabled: true + enabled: false ## If your etcd is not deployed as a pod, specify IPs it can be found on ## @@ -891,7 +891,7 @@ kubeEtcd: ## Component scraping kube scheduler ## kubeScheduler: - enabled: true + enabled: false ## If your kube scheduler is not deployed as a pod, specify IPs it can be found on ## @@ -944,7 +944,7 @@ kubeScheduler: ## Component scraping kube proxy ## kubeProxy: - enabled: true + enabled: false ## If your kube proxy is not deployed as a pod, specify IPs it can be found on ## @@ -2030,4 +2030,4 @@ prometheus: ## Endpoints of the selected pods to be monitored ## https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#podmetricsendpoint ## - # podMetricsEndpoints: []
\ No newline at end of file + # podMetricsEndpoints: [] |