Feature 11010: remove unnecessary code and set prometheus side-container iamge 84/14384/2
authorgarciadeblas <gerardo.garciadeblas@telefonica.com>
Wed, 22 May 2024 13:03:00 +0000 (15:03 +0200)
committergarciadeblas <gerardo.garciadeblas@telefonica.com>
Wed, 22 May 2024 13:40:16 +0000 (15:40 +0200)
Change-Id: I988d2d1c5cafa40026f41acb29221d6c94eafeeb
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
installers/full_install_osm.sh
installers/helm/osm/templates/_helpers.tpl
installers/helm/osm/values.yaml
installers/helm/values/alertmanager-values.yaml [deleted file]
installers/install_ngsa.sh

index f463723..c70fc06 100755 (executable)
@@ -277,8 +277,12 @@ EOF"
     # Generate helm values to be passed with --set
     OSM_HELM_OPTS=""
     # OSM_HELM_OPTS="${OSM_HELM_OPTS} --set nbi.useOsmSecret=false"
-    OSM_HELM_OPTS="${OSM_HELM_OPTS} --set global.image.repositoryBase=${DOCKER_REGISTRY_URL}${DOCKER_USER}"
     # OSM_HELM_OPTS="${OSM_HELM_OPTS} --set mysql.dbHostPath=${OSM_NAMESPACE_VOL}" # not needed as mysql is now bitnami helm chart
+
+    OSM_HELM_OPTS="${OSM_HELM_OPTS} --set global.image.repositoryBase=${DOCKER_REGISTRY_URL}${DOCKER_USER}"
+    [ ! "$OSM_DOCKER_TAG" == "testing-daily" ] && OSM_HELM_OPTS="${OSM_HELM_OPTS} --set-string global.image.tag=${OSM_DOCKER_TAG}"
+    [ ! "$OSM_DOCKER_TAG" == "testing-daily" ] && OSM_HELM_OPTS="${OSM_HELM_OPTS} --set prometheus.server.sidecarContainers.prometheus-config-sidecar.image=${DOCKER_REGISTRY_URL}${DOCKER_USER}/prometheus:${OSM_DOCKER_TAG}"
+
     if [ -n "${INSTALL_JUJU}" ]; then
         OSM_HELM_OPTS="${OSM_HELM_OPTS} --set vca.enabled=true"
         OSM_HELM_OPTS="${OSM_HELM_OPTS} --set vca.host=${OSM_VCA_HOST}"
@@ -286,7 +290,6 @@ EOF"
         OSM_HELM_OPTS="${OSM_HELM_OPTS} --set vca.cacert=${OSM_VCA_CACERT}"
     fi
     [ -n "$OSM_VCA_APIPROXY" ] && OSM_HELM_OPTS="${OSM_HELM_OPTS} --set lcm.config.OSMLCM_VCA_APIPROXY=${OSM_VCA_APIPROXY}"
-    [ ! "$OSM_DOCKER_TAG" == "testing-daily" ] && OSM_HELM_OPTS="${OSM_HELM_OPTS} --set-string global.image.tag=${OSM_DOCKER_TAG}"
     [ -n "${INSTALL_NGSA}" ] || OSM_HELM_OPTS="${OSM_HELM_OPTS} --set global.oldServiceAssurance=true"
     if [ -n "${OSM_BEHIND_PROXY}" ]; then
         OSM_HELM_OPTS="${OSM_HELM_OPTS} --set global.behindHttpProxy=true"
@@ -306,8 +309,8 @@ EOF"
     if [ -n "${INSTALL_JUJU}" ]; then
         OSM_HELM_OPTS="-f ${OSM_HELM_WORK_DIR}/osm-values.yaml ${OSM_HELM_OPTS}"
     fi
-    echo "helm install -n $OSM_NAMESPACE --create-namespace $OSM_NAMESPACE $OSM_DEVOPS/installers/helm/osm ${OSM_HELM_OPTS}"
-    helm install -n $OSM_NAMESPACE --create-namespace $OSM_NAMESPACE $OSM_DEVOPS/installers/helm/osm ${OSM_HELM_OPTS}
+    echo "helm upgrade --install -n $OSM_NAMESPACE --create-namespace $OSM_NAMESPACE $OSM_DEVOPS/installers/helm/osm ${OSM_HELM_OPTS}"
+    helm upgrade --install -n $OSM_NAMESPACE --create-namespace $OSM_NAMESPACE $OSM_DEVOPS/installers/helm/osm ${OSM_HELM_OPTS}
     # Override existing values.yaml with the final values.yaml used to install OSM
     helm -n $OSM_NAMESPACE get values $OSM_NAMESPACE | sudo tee -a ${OSM_HELM_WORK_DIR}/osm-values.yaml
     [ -z "${DEBUG_INSTALL}" ] || DEBUG end of function
index cd8ca4f..337073f 100644 (file)
@@ -109,6 +109,3 @@ Create the name of the images to be used
 {{ define "osm.keystone.image" -}}
 {{ printf "%s:%s" (.Values.keystone.image.repository | default (printf "%s/keystone" (.Values.global.image.repositoryBase))) (.Values.keystone.image.tag | default .Values.global.image.tag) }}
 {{- end }}
-{{ define "osm.prometheus.image" -}}
-{{ printf "%s:%s" (.Values.prometheus.sidecarImage.repository | default (printf "%s/prometheus" (.Values.global.image.repositoryBase))) (.Values.prometheus.sidecarImage.tag | default .Values.global.image.tag) }}
-{{- end }}
index 3d0e1dc..5bfc94e 100644 (file)
@@ -139,7 +139,7 @@ grafana:
       folder: "/tmp/dashboards/"
       resource: both
       searchNamespace: osm
-      extraMounts: 
+      extraMounts:
         - name: sc-dashboard-volume-k8s
           mountPath: "/tmp/dashboards/Kubernetes Cluster"
         - name: sc-dashboard-volume-osm
@@ -287,7 +287,7 @@ prometheus:
           # readOnlyRootFilesystem: true
           allowPrivilegeEscalation: false
           # runAsNonRoot: true
-        image: opensourcemano/prometheus
+        image: opensourcemano/prometheus:testing-daily
         imagePullPolicy: IfNotPresent
         command: ["/bin/sh", "-c"]
         args: ["sleep 50; python -u ./app.py"]
diff --git a/installers/helm/values/alertmanager-values.yaml b/installers/helm/values/alertmanager-values.yaml
deleted file mode 100644 (file)
index fb01de0..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-#
-#   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.
-#
----
-extraArgs:
-  log.level: debug
-service:
-  type: NodePort
-  nodePort: 9093
-  port: 9093
-config:
-  receivers:
-    - name: default-receiver
-    - name: vdu-webhook
-      webhook_configs:
-       - url: http://webhook-translator:9998/vdu_down
-    - name: scaleout-webhook
-      webhook_configs:
-       - url: http://webhook-translator:9998/scaleout_vdu
-    - name: scalein-webhook
-      webhook_configs:
-       - url: http://webhook-translator:9998/scalein_vdu
-    - name: alarm-webhook
-      webhook_configs:
-       - url: http://webhook-translator:9998/vdu_alarm
-  route:
-    group_wait: 10s
-    group_interval: 2m
-    receiver: default-receiver
-    routes:
-    - receiver: vdu-webhook
-      repeat_interval: 15m
-      matchers:
-      - alertname = "vdu_down"
-    - receiver: 'scaleout-webhook'
-      repeat_interval: 5m
-      matchers:
-      - alertname =~ "^scaleout_.*"
-    - receiver: 'scalein-webhook'
-      repeat_interval: 5m
-      matchers:
-      - alertname =~ "^scalein_.*"
-    - receiver: 'alarm-webhook'
-      repeat_interval: 5m
-      matchers:
-      - alertname =~ "^vdu_alarm_.*"
index a1f7fa3..dbfbac5 100755 (executable)
@@ -17,8 +17,6 @@ set +eux
 
 # Helm chart 1.6.0 correspondes to Airflow 2.3.0
 AIRFLOW_HELM_VERSION=1.9.0
-PROMPUSHGW_HELM_VERSION=1.18.2
-ALERTMANAGER_HELM_VERSION=0.22.0
 
 # Install Airflow helm chart
 function install_airflow() {
@@ -38,27 +36,6 @@ function install_airflow() {
     [ -z "${DEBUG_INSTALL}" ] || DEBUG end of function
 }
 
-# Install Prometheus Pushgateway helm chart
-function install_prometheus_pushgateway() {
-    [ -z "${DEBUG_INSTALL}" ] || DEBUG beginning of function
-    helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
-    helm repo update
-    helm upgrade pushgateway prometheus-community/prometheus-pushgateway -n osm --create-namespace --install --version ${PROMPUSHGW_HELM_VERSION} || FATAL_TRACK ngsa "Failed installing pushgateway helm chart"
-    [ -z "${DEBUG_INSTALL}" ] || DEBUG end of function
-}
-
-# Install Prometheus AlertManager helm chart
-function install_prometheus_alertmanager() {
-    [ -z "${DEBUG_INSTALL}" ] || DEBUG beginning of function
-    # copy alertmanager-values.yaml to the destination folder
-    sudo mkdir -p ${OSM_HELM_WORK_DIR}
-    sudo cp ${OSM_DEVOPS}/installers/helm/values/alertmanager-values.yaml ${OSM_HELM_WORK_DIR}
-    helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
-    helm repo update
-    helm upgrade alertmanager prometheus-community/alertmanager -n osm --create-namespace --install -f ${OSM_HELM_WORK_DIR}/alertmanager-values.yaml --version ${ALERTMANAGER_HELM_VERSION} || FATAL_TRACK ngsa "Failed installing alertmanager helm chart"
-    [ -z "${DEBUG_INSTALL}" ] || DEBUG end of function
-}
-
 # main
 
 DOCKER_REGISTRY_URL=
@@ -113,8 +90,3 @@ echo "OSM_HELM_WORK_DIR=$OSM_HELM_WORK_DIR"
 
 install_airflow
 track deploy_osm airflow_ok
-#install_prometheus_pushgateway
-#track deploy_osm pushgateway_ok
-#install_prometheus_alertmanager
-#track deploy_osm alertmanager_ok
-