aboutsummaryrefslogtreecommitdiffstats
path: root/tools/performance
diff options
context:
space:
mode:
authorkjaniak <kornel.janiak@nokia.com>2019-10-11 07:23:59 +0200
committerkjaniak <kornel.janiak@nokia.com>2019-10-11 08:24:39 +0200
commit26bc22297811ba2d0e37b512516a86474689d879 (patch)
treebcd09b2e77ce0f70b7bc39820ebaf6b79adc0e74 /tools/performance
parent2e334500fba9893f1f2d2ab3b9528c638d993a03 (diff)
Add SSL support to cloud performance tests
Change-Id: Ie0a6341592efe3bfe3e386c01026600d16110cef Signed-off-by: kjaniak <kornel.janiak@nokia.com> Issue-ID: DCAEGEN2-1827
Diffstat (limited to 'tools/performance')
-rwxr-xr-xtools/performance/cloud/cloud-based-performance-test.sh38
-rw-r--r--tools/performance/cloud/grafana/dashboards/performance-tests.yaml4
-rwxr-xr-xtools/performance/cloud/producer-pod.yaml22
-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.properties5
5 files changed, 63 insertions, 6 deletions
diff --git a/tools/performance/cloud/cloud-based-performance-test.sh b/tools/performance/cloud/cloud-based-performance-test.sh
index 937dcf3e..31299cc0 100755
--- a/tools/performance/cloud/cloud-based-performance-test.sh
+++ b/tools/performance/cloud/cloud-based-performance-test.sh
@@ -33,6 +33,8 @@ 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"
@@ -64,9 +66,23 @@ 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() {
set -e
for i in $(seq 1 ${CONTAINERS_COUNT});
@@ -78,10 +94,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 +113,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,6 +124,13 @@ 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}
@@ -107,7 +138,7 @@ function setup_environment() {
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 +209,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