X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=installers%2Finstall_ngsa.sh;h=8f18f03aa58c4b1d5763fb5545d258885e52f032;hb=bc5422cf9fd9d21d7028d445fe1982080101611a;hp=b90c3dc07f63e7e7f7855346db4d0564ba64fdf7;hpb=bae51f695443abcd0e410a92161af05b497ddc7a;p=osm%2Fdevops.git diff --git a/installers/install_ngsa.sh b/installers/install_ngsa.sh index b90c3dc0..8f18f03a 100755 --- a/installers/install_ngsa.sh +++ b/installers/install_ngsa.sh @@ -16,7 +16,7 @@ set +eux # Helm chart 1.6.0 correspondes to Airflow 2.3.0 -AIRFLOW_HELM_VERSION=1.6.0 +AIRFLOW_HELM_VERSION=1.9.0 PROMPUSHGW_HELM_VERSION=1.18.2 ALERTMANAGER_HELM_VERSION=0.22.0 @@ -29,9 +29,11 @@ function install_airflow() { # 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 + 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} @@ -62,6 +64,9 @@ function install_prometheus_pushgateway() { # Install Prometheus AlertManager helm chart function install_prometheus_alertmanager() { [ -z "${DEBUG_INSTALL}" ] || DEBUG end 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 @@ -77,11 +82,13 @@ function install_prometheus_alertmanager() { # main +DOCKER_REGISTRY_URL= +DOCKER_USER="opensourcemano" OSM_DEVOPS="/usr/share/osm-devops" -OSM_HELM_WORK_DIR="/etc/osm/helm" OSM_DOCKER_TAG="13" +OSM_HELM_WORK_DIR="/etc/osm/helm" -while getopts ":D:d:t:-: " o; do +while getopts ":D:d:t:r:U:-: " o; do case "${o}" in D) OSM_DEVOPS="${OPTARG}" @@ -92,6 +99,12 @@ while getopts ":D:d:t:-: " o; do t) OSM_DOCKER_TAG="${OPTARG}" ;; + r) + DOCKER_REGISTRY_URL="${OPTARG}" + ;; + U) + DOCKER_USER="${OPTARG}" + ;; -) [ "${OPTARG}" == "debug" ] && DEBUG_INSTALL="y" && continue echo -e "Invalid option: '--$OPTARG'\n" >&2