Commit 16abc1ba authored by Waleed Akbar's avatar Waleed Akbar
Browse files

Add production deployment support and Mimir configuration updates

- Introduced TFS_DEPLOY_PRODUCTION environment variable for production deployments in monitoring.sh and my_deploy.sh.
- Updated Mimir configuration in grafana_values.yaml to use the correct service URL.
- Added mimir_values.yaml configuration file for deployment.
parent 0ee4d415
Loading
Loading
Loading
Loading
+22 −15
Original line number Diff line number Diff line
@@ -15,6 +15,9 @@

set -euo pipefail

# Deploy TFS in production environment
export TFS_DEPLOY_PRODUCTION=${TFS_DEPLOY_PRODUCTION:-""}

# -----------------------------------------------------------
# Global namespace for all deployments
# -----------------------------------------------------------
@@ -33,11 +36,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 +108,20 @@ 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 [ "$TFS_DEPLOY_PRODUCTION" == "YES" ]; 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
    kubectl rollout status statefulset/"$RELEASE_NAME_MIMIR-distributor" -n "$NAMESPACE" || true
fi


# 3) Deploy Grafana
+1 −1
Original line number Diff line number Diff line
@@ -210,7 +210,7 @@ datasources:
     isDefault: true
   - name: Mimir
     type: prometheus
     url: http://mimir-nginx.mon-mimir.svc:80/prometheus
     url: http://mon-mimir-gateway.monitoring.svc.cluster.local/prometheus
     access: proxy
     isDefault: false

+132 −0
Original line number Diff line number Diff line
# Copyright 2022-2025 ETSI SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Minimal Mimir for lab/PoC using single-binary and in-cluster MinIO.
# Chart: grafana/mimir-distributed

global:
  # -- Definitions to set up nginx resolver
  dnsService: kube-dns
  dnsNamespace: kube-system
  clusterDomain: cluster.local.
  dnsConfig: {}

# Mimir structured configuration. Wires storage to the in-cluster MinIO.
mimir:
  structuredConfig:
    common:
      storage:
        backend: s3
        s3:
          endpoint: minio:9000
          access_key_id: grafana-mimir
          secret_access_key: supersecret   # change in real clusters
          insecure: true
    blocks_storage:
      s3:
        bucket_name: mimir-tsdb
    ruler_storage:
      s3:
        bucket_name: mimir-ruler
    alertmanager_storage:
      s3:
        bucket_name: mimir-alertmanager

minio:
  enabled: true
  mode: standalone
  rootUser: grafana-mimir
  rootPassword: supersecret             # change in real clusters
  buckets:
    - name: mimir-tsdb
      policy: none
      purge: false
    - name: mimir-ruler
      policy: none
      purge: false
    - name: mimir-alertmanager
      policy: none
      purge: false
  persistence:
    enabled: true
    size: 10Gi
  resources:
    requests:
      cpu: 100m
      memory: 128Mi

# Disable embedded Kafka. Not needed for this minimal setup.
kafka:
  enabled: false

# Keep the NGINX gateway internal to the cluster for simplicity.
gateway:
  enabled: true
  replicas: 1
  service:
    type: ClusterIP
    port: 80
  nginx:
    verboseLogging: true
  resources:
    requests:
      cpu: 100m
      memory: 128Mi
    limits:
      cpu: 500m
      memory: 512Mi

# Turn off sharded components. singleBinary runs the core services already.
distributor:
  replicas: 0
ingester:
  replicas: 0
querier:
  replicas: 0
query_frontend:
  replicas: 0
query_scheduler:
  replicas: 0
store_gateway:
  replicas: 0
compactor:
  replicas: 0

# Optional features disabled for minimum footprint.
ruler:
  enabled: false
alertmanager:
  enabled: false
overrides_exporter:
  enabled: false

# Caches off for minimal footprint. Enable later if you need performance.
memcached:
  enabled: false
memcached-queries:
  enabled: false
memcached-metadata:
  enabled: false
memcached-results:
  enabled: false

# Meta-monitoring off to keep footprint small. Turn on when you add Prometheus.
metaMonitoring:
  dashboards:
    enabled: false
  serviceMonitor:
    enabled: false
  prometheusRule:
    enabled: false
  grafanaAgent:
    enabled: false
+2 −0
Original line number Diff line number Diff line
@@ -117,6 +117,8 @@ export TFS_GRAFANA_PASSWORD="admin123+"
# Disable skip-build flag to rebuild the Docker images.
export TFS_SKIP_BUILD=""

# Deploy TFS in production environment
export TFS_DEPLOY_PRODUCTION=""

# ----- CockroachDB ------------------------------------------------------------