diff options
Diffstat (limited to 'tools/performance')
-rwxr-xr-x | tools/performance/cloud/cloud-based-performance-test.sh | 47 | ||||
-rw-r--r-- | tools/performance/cloud/grafana/dashboards/performance-tests.yaml | 4 | ||||
-rwxr-xr-x | tools/performance/cloud/producer-pod.yaml | 22 | ||||
-rw-r--r-- | tools/performance/cloud/prometheus/prometheus-config-map.yaml (renamed from tools/performance/cloud/prometheus-config-map.yaml) | 0 | ||||
-rw-r--r-- | tools/performance/cloud/test.properties | 5 |
5 files changed, 69 insertions, 9 deletions
diff --git a/tools/performance/cloud/cloud-based-performance-test.sh b/tools/performance/cloud/cloud-based-performance-test.sh index 937dcf3e..78ab7717 100755 --- a/tools/performance/cloud/cloud-based-performance-test.sh +++ b/tools/performance/cloud/cloud-based-performance-test.sh @@ -20,7 +20,6 @@ SCRIPT_DIRECTORY="$(pwd "$0")" CONTAINERS_COUNT=1 PROPERTIES_FILE=${SCRIPT_DIRECTORY}/test.properties -CONFIG_MAP_NAME=performance-test-config PRODUCER_APPS_LABEL=hv-collector-producer CONSUMER_APPS_LABEL=hv-collector-kafka-consumer PROMETHEUS_CONF_LABEL=prometheus-server-conf @@ -33,12 +32,14 @@ ONAP_NAMESPACE=onap MAXIMUM_BACK_OFF_CHECK_ITERATIONS=30 CHECK_NUMBER=0 NAME_REASON_PATTERN="custom-columns=NAME:.metadata.name,REASON:.status.containerStatuses[].state.waiting.reason" +HVVES_POD_NAME=$(kubectl -n ${ONAP_NAMESPACE} get pods --no-headers=true -o custom-columns=:metadata.name | grep hv-ves-collector) +HVVES_CERT_PATH=/etc/ves-hv/ssl/ function clean() { echo "Cleaning up environment" echo "Attempting to delete test parameters ConfigMap" - kubectl delete configmap ${CONFIG_MAP_NAME} -n ${ONAP_NAMESPACE} + kubectl delete configmap performance-test-config -n ${ONAP_NAMESPACE} echo "Attempting to delete prometheus ConfigMap" kubectl delete configmap -l name=${PROMETHEUS_CONF_LABEL} -n ${ONAP_NAMESPACE} @@ -64,10 +65,28 @@ function clean() { echo "Attempting to delete producer pods" kubectl delete pods -l app=${PRODUCER_APPS_LABEL} -n ${ONAP_NAMESPACE} + echo "Attempting to delete client certs secret" + kubectl delete secret cert -n ${ONAP_NAMESPACE} + echo "Environment clean up finished!" } +function copy_certs_to_hvves() { + cd ../../ssl + echo "Creating cert directory: ${HVVES_CERT_PATH}" + kubectl exec ${HVVES_POD_NAME} mkdir ${HVVES_CERT_PATH} -n ${ONAP_NAMESPACE} + for file in {trust.p12,trust.pass,server.p12,server.pass} + do + echo "Copying file: ${file}" + kubectl cp ${file} ${ONAP_NAMESPACE}/${HVVES_POD_NAME}:${HVVES_CERT_PATH} + done +} + function create_producers() { + echo "Recreating test properties ConfigMap from: $PROPERTIES_FILE" + kubectl delete configmap performance-test-config -n ${ONAP_NAMESPACE} + kubectl create configmap performance-test-config --from-env-file=${PROPERTIES_FILE} -n ${ONAP_NAMESPACE} + set -e for i in $(seq 1 ${CONTAINERS_COUNT}); do @@ -78,10 +97,17 @@ function create_producers() { set +e } +function generate_certs() { + echo "Generation of certs" + cd ../../ssl + ./gen-certs.sh +} + function usage() { echo "" echo "Run cloud based HV-VES performance test" - echo "Usage $0 setup|start|clean|help" + echo "Usage $0 gen_certs|setup|start|clean|help" + echo " gen_certs: generate certs in ../../ssl directory" echo " setup : set up ConfigMap and consumers" echo " start : create producers - start the performance test" echo " Optional parameters:" @@ -90,6 +116,7 @@ function usage() { echo " clean : remove ConfigMap, HV-VES consumers and producers" echo " help : print usage" echo "Example invocations:" + echo "./cloud-based-performance-test.sh gen_certs" echo "./cloud-based-performance-test.sh setup" echo "./cloud-based-performance-test.sh start" echo "./cloud-based-performance-test.sh start --containers 10" @@ -100,14 +127,21 @@ function usage() { function setup_environment() { echo "Setting up environment" + echo "Copying certs to hv-ves pod" + copy_certs_to_hvves + + echo "Creating secrets with clients cert" + kubectl create secret generic cert --from-file=./client.p12 --from-file=./client.pass -n ${ONAP_NAMESPACE} + cd ${SCRIPT_DIRECTORY} + echo "Creating test properties ConfigMap from: $PROPERTIES_FILE" - kubectl create configmap ${CONFIG_MAP_NAME} --from-env-file=${PROPERTIES_FILE} -n ${ONAP_NAMESPACE} + kubectl create configmap performance-test-config --from-env-file=${PROPERTIES_FILE} -n ${ONAP_NAMESPACE} echo "Creating consumer deployment" kubectl apply -f consumer-deployment.yaml echo "Creating ConfigMap for prometheus deployment" - kubectl apply -f prometheus-config-map.yaml + kubectl apply -f prometheus/prometheus-config-map.yaml echo "Creating prometheus deployment" kubectl apply -f prometheus-deployment.yaml @@ -178,6 +212,9 @@ else for arg in ${@} do case ${arg} in + gen_certs) + generate_certs + ;; setup) setup_environment ;; diff --git a/tools/performance/cloud/grafana/dashboards/performance-tests.yaml b/tools/performance/cloud/grafana/dashboards/performance-tests.yaml index 24626b7a..9ee405e4 100644 --- a/tools/performance/cloud/grafana/dashboards/performance-tests.yaml +++ b/tools/performance/cloud/grafana/dashboards/performance-tests.yaml @@ -42,7 +42,7 @@ data: "editable": true, "gnetId": null, "graphTooltip": 0, - "iteration": 1570533687099, + "iteration": 1570772689346, "links": [], "panels": [ { @@ -484,7 +484,7 @@ data: }, "yaxes": [ { - "format": "s", + "format": "ns", "label": null, "logBase": 1, "max": null, diff --git a/tools/performance/cloud/producer-pod.yaml b/tools/performance/cloud/producer-pod.yaml index 9381b582..5b41c4e0 100755 --- a/tools/performance/cloud/producer-pod.yaml +++ b/tools/performance/cloud/producer-pod.yaml @@ -27,6 +27,10 @@ spec: containers: - name: hv-collector-producer image: the-a-team-registry-local.esisoj70.emea.nsn-net.net/onap/org.onap.dcaegen2.collectors.hv-ves.hv-collector-go-client:latest + volumeMounts: + - name: ssl-certs + mountPath: /ssl + readOnly: true env: - name: HV_VES_ADDRESS valueFrom: @@ -53,9 +57,25 @@ spec: configMapKeyRef: name: performance-test-config key: producer.client.count + - name: CERT_FILE + valueFrom: + configMapKeyRef: + name: performance-test-config + key: client.cert.path + - name: CERT_PASS_FILE + valueFrom: + configMapKeyRef: + name: performance-test-config + key: client.cert.pass.path args: ["--address", "$(HV_VES_ADDRESS)", "--clients", "$(CLIENTS_PER_CONTAINER)", "--msgsize", "$(MSG_SIZE)", "--msgcount", "$(MSG_COUNT)", - "--intervalms", "$(INTERVAL_MS)"] + "--intervalms", "$(INTERVAL_MS)", + "--certfile", "$(CERT_FILE)", + "--certpass", "$(CERT_PASS_FILE)"] + volumes: + - name: ssl-certs + secret: + secretName: cert restartPolicy: Never
\ No newline at end of file diff --git a/tools/performance/cloud/prometheus-config-map.yaml b/tools/performance/cloud/prometheus/prometheus-config-map.yaml index a07bc336..a07bc336 100644 --- a/tools/performance/cloud/prometheus-config-map.yaml +++ b/tools/performance/cloud/prometheus/prometheus-config-map.yaml diff --git a/tools/performance/cloud/test.properties b/tools/performance/cloud/test.properties index 092c51cf..53a38e23 100644 --- a/tools/performance/cloud/test.properties +++ b/tools/performance/cloud/test.properties @@ -10,7 +10,10 @@ producer.message.size=16384 producer.message.count=1000 # Interval between messages in milliseconds producer.message.interval=1 - +# Path to client cert file +client.cert.path=/ssl/client.p12 +# Path to cert pass file +client.cert.pass.path=/ssl/client.pass # CONSUMER CONFIGURATION # Addresses of Kafka services to consume from |