Commit ab2eb457 authored by Carlos Manso's avatar Carlos Manso
Browse files

Merge branch 'develop' into feat/compute-etsi_mec_015

parents 1f0b8016 3b994c95
Loading
Loading
Loading
Loading

.dockerignore

0 → 100644
+16 −0
Original line number Diff line number Diff line
# Avoid including these folders when building the components
.git/
.gitlab/
.vscode/
coverage/
data/
deploy/
ecoc22/
hackfest/
manifests/
nfvsdn22/
oeccpsc22/
ofc22/
ofc23/
scripts/
tmp/
+3 −0
Original line number Diff line number Diff line
@@ -168,5 +168,8 @@ delete_local_deployment.sh
local_docker_deployment.sh
local_k8s_deployment.sh

# asdf configuration
.tool-versions

# Other logs
**/logs/*.log.*
+1 −1
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@ include:
  - local: '/src/dbscanserving/.gitlab-ci.yml'
  - local: '/src/opticalattackmitigator/.gitlab-ci.yml'
  - local: '/src/opticalattackdetector/.gitlab-ci.yml'
  - local: '/src/opticalattackmanager/.gitlab-ci.yml'
  # - local: '/src/opticalattackmanager/.gitlab-ci.yml'
  - local: '/src/automation/.gitlab-ci.yml'
  - local: '/src/policy/.gitlab-ci.yml'
  #- local: '/src/webui/.gitlab-ci.yml'
+12 −5
Original line number Diff line number Diff line
@@ -29,11 +29,13 @@ export GRAF_EXT_PORT_HTTP=${GRAF_EXT_PORT_HTTP:-"3000"}
# Automated steps start here
########################################################################################################################

MONITORING_NAMESPACE="monitoring"

function expose_dashboard() {
    echo "Prometheus Port Mapping"
    echo ">>> Expose Prometheus HTTP Mgmt GUI port (9090->${PROM_EXT_PORT_HTTP})"
    PROM_PORT_HTTP=$(kubectl --namespace monitoring get service prometheus-k8s -o 'jsonpath={.spec.ports[?(@.name=="web")].port}')
    PATCH='{"data": {"'${PROM_EXT_PORT_HTTP}'": "monitoring/prometheus-k8s:'${PROM_PORT_HTTP}'"}}'
    PROM_PORT_HTTP=$(kubectl --namespace ${MONITORING_NAMESPACE} get service prometheus-k8s -o 'jsonpath={.spec.ports[?(@.name=="web")].port}')
    PATCH='{"data": {"'${PROM_EXT_PORT_HTTP}'": "'${MONITORING_NAMESPACE}'/prometheus-k8s:'${PROM_PORT_HTTP}'"}}'
    kubectl patch configmap nginx-ingress-tcp-microk8s-conf --namespace ingress --patch "${PATCH}"

    PORT_MAP='{"containerPort": '${PROM_EXT_PORT_HTTP}', "hostPort": '${PROM_EXT_PORT_HTTP}'}'
@@ -44,8 +46,8 @@ function expose_dashboard() {

    echo "Grafana Port Mapping"
    echo ">>> Expose Grafana HTTP Mgmt GUI port (3000->${GRAF_EXT_PORT_HTTP})"
    GRAF_PORT_HTTP=$(kubectl --namespace monitoring get service grafana -o 'jsonpath={.spec.ports[?(@.name=="http")].port}')
    PATCH='{"data": {"'${GRAF_EXT_PORT_HTTP}'": "monitoring/grafana:'${GRAF_PORT_HTTP}'"}}'
    GRAF_PORT_HTTP=$(kubectl --namespace ${MONITORING_NAMESPACE} get service grafana -o 'jsonpath={.spec.ports[?(@.name=="http")].port}')
    PATCH='{"data": {"'${GRAF_EXT_PORT_HTTP}'": "'${MONITORING_NAMESPACE}'/grafana:'${GRAF_PORT_HTTP}'"}}'
    kubectl patch configmap nginx-ingress-tcp-microk8s-conf --namespace ingress --patch "${PATCH}"

    PORT_MAP='{"containerPort": '${GRAF_EXT_PORT_HTTP}', "hostPort": '${GRAF_EXT_PORT_HTTP}'}'
@@ -55,4 +57,9 @@ function expose_dashboard() {
    echo
}

if kubectl get namespace ${MONITORING_NAMESPACE} &> /dev/null; then
    echo ">>> Namespace ${MONITORING_NAMESPACE} is present, exposing dashboard..."
    expose_dashboard
else
    echo ">>> Namespace ${MONITORING_NAMESPACE} is NOT present, skipping expose dashboard..."
fi
+7 −2
Original line number Diff line number Diff line
@@ -327,7 +327,12 @@ echo "Deploying extra manifests..."
for EXTRA_MANIFEST in $TFS_EXTRA_MANIFESTS; do
    echo "Processing manifest '$EXTRA_MANIFEST'..."
    if [[ "$EXTRA_MANIFEST" == *"servicemonitor"* ]]; then
        if kubectl get namespace monitoring &> /dev/null; then
            echo ">>> Namespace monitoring is present, applying service monitors..."
            kubectl apply -f $EXTRA_MANIFEST
        else
            echo ">>> Namespace monitoring is NOT present, skipping service monitors..."
        fi
    else
        kubectl --namespace $TFS_K8S_NAMESPACE apply -f $EXTRA_MANIFEST
    fi
@@ -343,7 +348,7 @@ for COMPONENT in $TFS_COMPONENTS; do
    printf "\n"
done

if [[ "$TFS_COMPONENTS" == *"webui"* ]]; then
if [[ "$TFS_COMPONENTS" == *"monitoring"* ]] && [[ "$TFS_COMPONENTS" == *"webui"* ]]; then
    echo "Configuring WebUI DataStores and Dashboards..."
    sleep 5

Loading