diff --git a/deploy/expose_perf_dashboards.sh b/deploy/expose_perf_dashboards.sh new file mode 100755 index 0000000000000000000000000000000000000000..6cabbae95a68fc58c17f9c0faa00d0c91923511d --- /dev/null +++ b/deploy/expose_perf_dashboards.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +EXT_GRAFANA_HTTP_PORT="31001" +EXT_PROMETHEUS_HTTP_PORT="31002" + +GRAFANA_HTTP_PORT=$(kubectl --namespace monitoring get service grafana -o 'jsonpath={.spec.ports[?(@.name=="http")].port}') +PATCH='{"data": {"'${EXT_GRAFANA_HTTP_PORT}'": "monitoring/grafana:'${GRAFANA_HTTP_PORT}'"}}' +kubectl patch configmap nginx-ingress-tcp-microk8s-conf --namespace ingress --patch "${PATCH}" +PORT_MAP='{"containerPort": '${EXT_GRAFANA_HTTP_PORT}', "hostPort": '${EXT_GRAFANA_HTTP_PORT}'}' +CONTAINER='{"name": "nginx-ingress-microk8s", "ports": ['${PORT_MAP}']}' +PATCH='{"spec": {"template": {"spec": {"containers": ['${CONTAINER}']}}}}' +kubectl patch daemonset nginx-ingress-microk8s-controller --namespace ingress --patch "${PATCH}" + +PROMETHEUS_HTTP_PORT=$(kubectl --namespace monitoring get service prometheus-k8s -o 'jsonpath={.spec.ports[?(@.name=="web")].port}') +PATCH='{"data": {"'${EXT_PROMETHEUS_HTTP_PORT}'": "monitoring/prometheus-k8s:'${PROMETHEUS_HTTP_PORT}'"}}' +kubectl patch configmap nginx-ingress-tcp-microk8s-conf --namespace ingress --patch "${PATCH}" +PORT_MAP='{"containerPort": '${EXT_PROMETHEUS_HTTP_PORT}', "hostPort": '${EXT_PROMETHEUS_HTTP_PORT}'}' +CONTAINER='{"name": "nginx-ingress-microk8s", "ports": ['${PORT_MAP}']}' +PATCH='{"spec": {"template": {"spec": {"containers": ['${CONTAINER}']}}}}' +kubectl patch daemonset nginx-ingress-microk8s-controller --namespace ingress --patch "${PATCH}" diff --git a/deploy/tfs.sh b/deploy/tfs.sh index 4c6dc95d2e20dd92c73692aefd46c6fe4b348601..6a0e7a2e6ef5174ecce492ad8930c0d783a5c1a4 100755 --- a/deploy/tfs.sh +++ b/deploy/tfs.sh @@ -242,6 +242,7 @@ for COMPONENT in $TFS_COMPONENTS; do echo " Adapting '$COMPONENT' manifest file..." MANIFEST="$TMP_MANIFESTS_FOLDER/${COMPONENT}service.yaml" cp ./manifests/"${COMPONENT}"service.yaml "$MANIFEST" + #cat ./manifests/"${COMPONENT}"service.yaml | linkerd inject - --proxy-cpu-request "10m" --proxy-cpu-limit "1" --proxy-memory-request "64Mi" --proxy-memory-limit "256Mi" > "$MANIFEST" if [ "$COMPONENT" == "pathcomp" ]; then IMAGE_URL=$(echo "$TFS_REGISTRY_IMAGES/$COMPONENT-frontend:$TFS_IMAGE_TAG" | sed 's,//,/,g' | sed 's,http:/,,g') diff --git a/manifests/pathcompservice.yaml b/manifests/pathcompservice.yaml index fd3599f429f48ebb3cf3f8d802f8f61f00e1b41d..28edf9aa5fa1c600aa56fe6a4255188223fa2e61 100644 --- a/manifests/pathcompservice.yaml +++ b/manifests/pathcompservice.yaml @@ -23,6 +23,8 @@ spec: replicas: 1 template: metadata: + #annotations: + # config.linkerd.io/opaque-ports: "8081" labels: app: pathcompservice spec: @@ -53,6 +55,8 @@ spec: - name: backend image: labs.etsi.org:5050/tfs/controller/pathcomp-backend:latest imagePullPolicy: Always + #ports: + #- containerPort: 8081 #readinessProbe: # httpGet: # path: /health diff --git a/my_deploy.sh b/my_deploy.sh index 22a7ae8155135f8d81f2fa12d71f80d8dd7c57e9..4f3cb25f67ef1a836d7e41ac14d5380eade00242 100755 --- a/my_deploy.sh +++ b/my_deploy.sh @@ -20,7 +20,8 @@ export TFS_REGISTRY_IMAGES="http://localhost:32000/tfs/" # Set the list of components, separated by spaces, you want to build images for, and deploy. -export TFS_COMPONENTS="context device automation monitoring pathcomp service slice compute webui load_generator" +#automation monitoring compute +export TFS_COMPONENTS="context device pathcomp service slice webui load_generator" # Set the tag you want to use for your images. export TFS_IMAGE_TAG="dev" @@ -29,7 +30,7 @@ export TFS_IMAGE_TAG="dev" export TFS_K8S_NAMESPACE="tfs" # Set additional manifest files to be applied after the deployment -export TFS_EXTRA_MANIFESTS="manifests/nginx_ingress_http.yaml" +export TFS_EXTRA_MANIFESTS="manifests/nginx_ingress_http.yaml manifests/servicemonitors.yaml" # Set the new Grafana admin password export TFS_GRAFANA_PASSWORD="admin123+" @@ -63,7 +64,7 @@ export CRDB_DATABASE="tfs" export CRDB_DEPLOY_MODE="single" # Disable flag for dropping database, if it exists. -export CRDB_DROP_DATABASE_IF_EXISTS="" +export CRDB_DROP_DATABASE_IF_EXISTS="YES" # Disable flag for re-deploying CockroachDB from scratch. export CRDB_REDEPLOY=""