X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=installers%2Finstall_ngsa.sh;h=65c9f89f289e1549166cb969e46d24aebc2d8e55;hb=c9ea6ad7758f6d3517f58f8f9fac1f930781a70b;hp=30edc701dcd233a83280a8a962549ba1ba5cbb24;hpb=836354fe4faf5ec29acfabcaf1a79cefd86b5848;p=osm%2Fdevops.git diff --git a/installers/install_ngsa.sh b/installers/install_ngsa.sh index 30edc701..65c9f89f 100755 --- a/installers/install_ngsa.sh +++ b/installers/install_ngsa.sh @@ -28,55 +28,34 @@ function install_airflow() { sudo cp ${OSM_DEVOPS}/installers/helm/values/airflow-values.yaml ${OSM_HELM_WORK_DIR} # update airflow-values.yaml to use the right tag echo "Updating Helm values file helm/values/airflow-values.yaml to use defaultAirflowTag: ${OSM_DOCKER_TAG}" - sudo sed -i "s#defaultAirflowTag:.*#defaultAirflowTag: ${OSM_DOCKER_TAG}#g" ${OSM_HELM_WORK_DIR}/airflow-values.yaml + 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 - if ! helm -n osm status airflow 2> /dev/null ; then - # if it does not exist, create secrets and install - kubectl -n osm create secret generic airflow-webserver-secret --from-literal="webserver-secret-key=$(python3 -c 'import secrets; print(secrets.token_hex(16))')" - helm repo add apache-airflow https://airflow.apache.org - helm repo update - helm -n osm install airflow apache-airflow/airflow -f ${OSM_HELM_WORK_DIR}/airflow-values.yaml --version ${AIRFLOW_HELM_VERSION} - else - # if it exists, upgrade - helm repo update - helm -n osm upgrade airflow apache-airflow/airflow -f ${OSM_HELM_WORK_DIR}/airflow-values.yaml --version ${AIRFLOW_HELM_VERSION} - fi + + 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 end of function - if ! helm -n osm status pushgateway 2> /dev/null ; then - # if it does not exist, install - helm repo add prometheus-community https://prometheus-community.github.io/helm-charts - helm repo update - helm -n osm install pushgateway prometheus-community/prometheus-pushgateway --version ${PROMPUSHGW_HELM_VERSION} - else - # if it exists, upgrade - helm repo update - helm -n osm upgrade pushgateway prometheus-community/prometheus-pushgateway --version ${PROMPUSHGW_HELM_VERSION} - fi + [ -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 end of function + [ -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} - if ! helm -n osm status alertmanager 2> /dev/null ; then - # if it does not exist, install - helm repo add prometheus-community https://prometheus-community.github.io/helm-charts - helm repo update - helm -n osm install alertmanager prometheus-community/alertmanager -f ${OSM_HELM_WORK_DIR}/alertmanager-values.yaml --version ${ALERTMANAGER_HELM_VERSION} - else - # if it exists, upgrade - helm repo update - helm -n osm upgrade alertmanager prometheus-community/alertmanager -f ${OSM_HELM_WORK_DIR}/alertmanager-values.yaml --version ${ALERTMANAGER_HELM_VERSION} - fi + 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 } @@ -85,7 +64,7 @@ function install_prometheus_alertmanager() { DOCKER_REGISTRY_URL= DOCKER_USER="opensourcemano" OSM_DEVOPS="/usr/share/osm-devops" -OSM_DOCKER_TAG="13" +OSM_DOCKER_TAG="testing-daily" OSM_HELM_WORK_DIR="/etc/osm/helm" while getopts ":D:d:t:r:U:-: " o; do