X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=installers%2Finstall_ngsa.sh;h=347ab4895f23db5f8300639a815a7ce856b635ac;hb=b9a84e4d91b8e21a1e81e735f69d78c2dedf5f0d;hp=65c9f89f289e1549166cb969e46d24aebc2d8e55;hpb=34824fcfc823c7446ed5708a0a8e02950c369209;p=osm%2Fdevops.git diff --git a/installers/install_ngsa.sh b/installers/install_ngsa.sh index 65c9f89f..347ab489 100755 --- a/installers/install_ngsa.sh +++ b/installers/install_ngsa.sh @@ -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() { @@ -31,31 +29,12 @@ function install_airflow() { sudo sed -i "s#defaultAirflowTag:.*#defaultAirflowTag: \"${OSM_DOCKER_TAG}\"#g" ${OSM_HELM_WORK_DIR}/airflow-values.yaml echo "Updating Helm values file helm/values/airflow-values.yaml to use defaultAirflowRepository: ${DOCKER_REGISTRY_URL}${DOCKER_USER}/airflow" sudo sed -i "s#defaultAirflowRepository:.*#defaultAirflowRepository: ${DOCKER_REGISTRY_URL}${DOCKER_USER}/airflow#g" ${OSM_HELM_WORK_DIR}/airflow-values.yaml + echo "Updating Helm values file helm/values/airflow-values.yaml to set ingress.web.hosts with host \"airflow.${DEFAULT_IP}.nip.io\"" + sudo sed -i "s#name: \"localhost\"#name: \"airflow.${DEFAULT_IP}.nip.io\"#g" ${OSM_HELM_WORK_DIR}/airflow-values.yaml helm repo add apache-airflow https://airflow.apache.org helm repo update - helm upgrade airflow apache-airflow/airflow -n osm --create-namespace --install -f ${OSM_HELM_WORK_DIR}/airflow-values.yaml --version ${AIRFLOW_HELM_VERSION} --timeout 10m || FATAL_TRACK ngsa "Failed installing airflow helm chart" - [ -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" + helm upgrade airflow apache-airflow/airflow -n ${OSM_NAMESPACE} --create-namespace --install -f ${OSM_HELM_WORK_DIR}/airflow-values.yaml --version ${AIRFLOW_HELM_VERSION} --timeout 10m || FATAL_TRACK ngsa "Failed installing airflow helm chart" [ -z "${DEBUG_INSTALL}" ] || DEBUG end of function } @@ -66,15 +45,23 @@ DOCKER_USER="opensourcemano" OSM_DEVOPS="/usr/share/osm-devops" OSM_DOCKER_TAG="testing-daily" OSM_HELM_WORK_DIR="/etc/osm/helm" +OSM_NAMESPACE="osm" +DEFAULT_IP="127.0.0.1" -while getopts ":D:d:t:r:U:-: " o; do +while getopts ":D:d:i:s:t:r:U:-: " o; do case "${o}" in + i) + DEFAULT_IP="${OPTARG}" + ;; D) OSM_DEVOPS="${OPTARG}" ;; d) OSM_HELM_WORK_DIR="${OPTARG}" ;; + s) + OSM_NAMESPACE="${OPTARG}" + ;; t) OSM_DOCKER_TAG="${OPTARG}" ;; @@ -106,15 +93,12 @@ done source $OSM_DEVOPS/common/logging source $OSM_DEVOPS/common/track +echo "DEFAULT_IP=$DEFAULT_IP" echo "DEBUG_INSTALL=$DEBUG_INSTALL" echo "OSM_DEVOPS=$OSM_DEVOPS" echo "OSM_DOCKER_TAG=$OSM_DOCKER_TAG" echo "OSM_HELM_WORK_DIR=$OSM_HELM_WORK_DIR" +echo "OSM_NAMESPACE=$OSM_NAMESPACE" install_airflow track deploy_osm airflow_ok -install_prometheus_pushgateway -track deploy_osm pushgateway_ok -install_prometheus_alertmanager -track deploy_osm alertmanager_ok -