Commit 95573131 authored by Andrea Sgambelluri's avatar Andrea Sgambelluri
Browse files

Merge branch...

Merge branch 'feat/349-new-monitoring-updates-for-optical-controller-integration' of https://labs.etsi.org/rep/tfs/controller into cnit_ofc26
parents 9ad39336 a1260aac
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
# Avoid including these folders when building the components
.git/
.gitlab/
.github/
.vscode/
coverage/
data/
+1 −0
Original line number Diff line number Diff line
@@ -172,6 +172,7 @@ cython_debug/

# Other
/tmp
.github

# Sqlite
*.db
+1 −0
Original line number Diff line number Diff line
@@ -58,6 +58,7 @@ include:
  - local: '/src/ztp_server/.gitlab-ci.yml'
  - local: '/src/osm_client/.gitlab-ci.yml'
  - local: '/src/simap_connector/.gitlab-ci.yml'
  - local: '/src/pluggables/.gitlab-ci.yml'

  # This should be last one: end-to-end integration tests
  - local: '/src/tests/.gitlab-ci.yml'
+20 −0
Original line number Diff line number Diff line
@@ -69,6 +69,9 @@ export TFS_COMPONENTS=${TFS_COMPONENTS:-"context device pathcomp service slice n
# Uncomment to activate E2E Orchestrator
#export TFS_COMPONENTS="${TFS_COMPONENTS} e2e_orchestrator"

# Uncomment to activate Pluggables Component
#export TFS_COMPONENTS="${TFS_COMPONENTS} pluggables"

# If not already set, set the tag you want to use for your images.
export TFS_IMAGE_TAG=${TFS_IMAGE_TAG:-"dev"}

@@ -210,6 +213,23 @@ export QDB_DROP_TABLES_IF_EXIST=${QDB_DROP_TABLES_IF_EXIST:-""}
export QDB_REDEPLOY=${QDB_REDEPLOY:-""}


# ----- Time Series Storage - Prometheus / Grafana Mimir -----------------------

# If not already set, set Time Series Storage installation mode. Accepted values are:
# 'single' and 'cluster'.
# - If TSDB_DEPLOY_MODE is "single", Time Series Storage is deployed in single node
#   mode and features a basic Prometheus instance. It is convenient for development and
#   testing purposes and should fit in a VM.
#   IT SHOULD NOT BE USED IN PRODUCTION ENVIRONMENTS.
# - If TSDB_DEPLOY_MODE is "cluster", Time Series Storage is deployed in cluster mode
#   and a Grafana Mimir database in cluster mode will be deployed. It is convenient for
#   production and provides scalability features. If you are deploying for production,
#   also read the following link providing details on deploying Grafana Mimir for
#   production environments:
#   Ref: https://grafana.com/docs/mimir/latest/manage/run-production-environment/
export TSDB_DEPLOY_MODE=${TSDB_DEPLOY_MODE:-"single"}


# ----- K8s Observability ------------------------------------------------------

# If not already set, set the external port Prometheus Mgmt HTTP GUI interface will be exposed to.
+36 −15
Original line number Diff line number Diff line
@@ -15,6 +15,24 @@

set -euo pipefail


# ----- Time Series Storage - Prometheus / Grafana Mimir -----------------------

# If not already set, set Time Series Storage installation mode. Accepted values are:
# 'single' and 'cluster'.
# - If TSDB_DEPLOY_MODE is "single", Time Series Storage is deployed in single node
#   mode and features a basic Prometheus instance. It is convenient for development and
#   testing purposes and should fit in a VM.
#   IT SHOULD NOT BE USED IN PRODUCTION ENVIRONMENTS.
# - If TSDB_DEPLOY_MODE is "cluster", Time Series Storage is deployed in cluster mode
#   and a Grafana Mimir database in cluster mode will be deployed. It is convenient for
#   production and provides scalability features. If you are deploying for production,
#   also read the following link providing details on deploying Grafana Mimir for
#   production environments:
#   Ref: https://grafana.com/docs/mimir/latest/manage/run-production-environment/
export TSDB_DEPLOY_MODE=${TSDB_DEPLOY_MODE:-"single"}


# -----------------------------------------------------------
# Global namespace for all deployments
# -----------------------------------------------------------
@@ -33,11 +51,11 @@ VALUES_FILE_PROM="$VALUES_FILE_PATH/prometheus_values.yaml"
# -----------------------------------------------------------
# Mimir Configuration
# -----------------------------------------------------------
# RELEASE_NAME_MIMIR="mon-mimir"
# CHART_REPO_NAME_MIMIR="grafana"
# CHART_REPO_URL_MIMIR="https://grafana.github.io/helm-charts"
# CHART_NAME_MIMIR="mimir-distributed"
# VALUES_FILE_MIMIR="$VALUES_FILE_PATH/mimir_values.yaml"
RELEASE_NAME_MIMIR="mon-mimir"
CHART_REPO_NAME_MIMIR="grafana"
CHART_REPO_URL_MIMIR="https://grafana.github.io/helm-charts"
CHART_NAME_MIMIR="mimir-distributed"
VALUES_FILE_MIMIR="$VALUES_FILE_PATH/mimir_values.yaml"

# -----------------------------------------------------------
# Grafana Configuration
@@ -105,16 +123,19 @@ kubectl rollout status deployment/"$RELEASE_NAME_PROM-server" -n "$NAMESPACE" ||


# 2) Deploy Mimir
# deploy_chart "$RELEASE_NAME_MIMIR" \
#              "$CHART_REPO_NAME_MIMIR" \
#              "$CHART_REPO_URL_MIMIR" \
#              "$CHART_NAME_MIMIR" \
#              "$VALUES_FILE_MIMIR" \
#              "$NAMESPACE"
if [ "$TSDB_DEPLOY_MODE" == "cluster" ]; then
    echo "Deploying Mimir in production mode."
    # You can add any production-specific configurations here if needed
    deploy_chart "$RELEASE_NAME_MIMIR" \
                "$CHART_REPO_NAME_MIMIR" \
                "$CHART_REPO_URL_MIMIR" \
                "$CHART_NAME_MIMIR" \
                "$VALUES_FILE_MIMIR" \
                "$NAMESPACE"

# Depending on how Mimir runs (StatefulSets, Deployments), you can wait for
# the correct resource to be ready. For example:
# kubectl rollout status statefulset/"$RELEASE_NAME_MIMIR-distributor" -n "$NAMESPACE" || true
    # you can wait for the resource to be ready.
    kubectl rollout status statefulset/"$RELEASE_NAME_MIMIR-distributor" -n "$NAMESPACE" || true
fi


# 3) Deploy Grafana
Loading