From 5ef8e951103f7084c94d1db0628e46cf82c5d06b Mon Sep 17 00:00:00 2001 From: garciadeblas Date: Fri, 19 May 2023 11:42:13 +0200 Subject: [PATCH] Clarify messages and minor refactors in full_install_osm Change-Id: I33182aa1f7c53117ae0b645a4f02b3cbde7bfb1c Signed-off-by: garciadeblas --- installers/full_install_osm.sh | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/installers/full_install_osm.sh b/installers/full_install_osm.sh index 7413bd66..a7f46a28 100755 --- a/installers/full_install_osm.sh +++ b/installers/full_install_osm.sh @@ -248,12 +248,18 @@ function pull_docker_images() { sg docker -c "docker pull mysql:5" || FATAL "cannot get mysql docker image" fi - echo "Pulling OSM docker images" - for module in MON POL NBI KEYSTONE RO LCM NG-UI PLA osmclient Airflow; do + list_of_modules="MON NBI KEYSTONE RO LCM NG-UI osmclient" + if [ -n "$INSTALL_NGSA" ]; then + list_of_modules="${list_of_modules} Airflow Webhook" + else + list_of_modules="${list_of_modules} POL" + fi + if [ -n "$INSTALL_PLA" ]; then + list_of_modules="${list_of_modules} PLA" + fi + echo "Pulling OSM docker images for the following modules: ${list_of_modules}" + for module in ${list_of_modules}; do module_lower=${module,,} - if [ $module == "PLA" -a ! -n "$INSTALL_PLA" ]; then - continue - fi module_tag="${OSM_DOCKER_TAG}" if [ -n "${MODULE_DOCKER_TAG}" ] && echo $TO_REBUILD | grep -q $module ; then module_tag="${MODULE_DOCKER_TAG}" @@ -501,10 +507,11 @@ function kube_secrets(){ kubectl create secret generic ro-db-secret -n $OSM_NAMESPACE --from-env-file=$OSM_DOCKER_WORK_DIR/ro-db.env kubectl create secret generic ro-secret -n $OSM_NAMESPACE --from-env-file=$OSM_DOCKER_WORK_DIR/ro.env kubectl create secret generic keystone-secret -n $OSM_NAMESPACE --from-env-file=$OSM_DOCKER_WORK_DIR/keystone.env - kubectl create secret generic pol-secret -n $OSM_NAMESPACE --from-env-file=$OSM_DOCKER_WORK_DIR/pol.env if [ -n "${INSTALL_NGSA}" ]; then kubectl create secret generic ngsa-secret -n $OSM_NAMESPACE --from-env-file=$OSM_DOCKER_WORK_DIR/ngsa.env kubectl create secret generic webhook-translator-secret -n $OSM_NAMESPACE --from-env-file=$OSM_DOCKER_WORK_DIR/webhook-translator.env + else + kubectl create secret generic pol-secret -n $OSM_NAMESPACE --from-env-file=$OSM_DOCKER_WORK_DIR/pol.env fi [ -z "${DEBUG_INSTALL}" ] || DEBUG end of function } @@ -512,6 +519,8 @@ function kube_secrets(){ #deploys osm pods and services function deploy_osm_services() { [ -z "${DEBUG_INSTALL}" ] || DEBUG beginning of function + echo "The following manifests under $OSM_K8S_WORK_DIR will be deployed:" + ls $OSM_K8S_WORK_DIR kubectl apply -n $OSM_NAMESPACE -f $OSM_K8S_WORK_DIR [ -z "${DEBUG_INSTALL}" ] || DEBUG end of function } @@ -548,7 +557,7 @@ function parse_yaml() { for module in $services; do if [ "$module" == "pla" ]; then if [ -n "$INSTALL_PLA" ]; then - echo "Updating K8s manifest file from opensourcemano\/pla:.* to ${DOCKER_REGISTRY_URL}${DOCKER_USER}\/pla:${TAG}" + echo "Updating K8s manifest file for ${module} from opensourcemano\/pla:.* to ${DOCKER_REGISTRY_URL}${DOCKER_USER}\/pla:${TAG}" sudo sed -i "s#opensourcemano/pla:.*#${DOCKER_REGISTRY_URL}${DOCKER_USER}/pla:${TAG}#g" ${OSM_DOCKER_WORK_DIR}/osm_pla/pla.yaml fi else @@ -558,7 +567,7 @@ function parse_yaml() { elif [ "$module" == "ng-mon" ]; then image="mon" fi - echo "Updating K8s manifest file from opensourcemano\/${image}:.* to ${DOCKER_REGISTRY_URL}${DOCKER_USER}\/${image}:${TAG}" + echo "Updating K8s manifest file for ${module} from opensourcemano\/${image}:.* to ${DOCKER_REGISTRY_URL}${DOCKER_USER}\/${image}:${TAG}" sudo sed -i "s#opensourcemano/${image}:.*#${DOCKER_REGISTRY_URL}${DOCKER_USER}/${image}:${TAG}#g" ${OSM_K8S_WORK_DIR}/${module}.yaml fi done @@ -566,6 +575,7 @@ function parse_yaml() { } function update_manifest_files() { + [ -z "${DEBUG_INSTALL}" ] || DEBUG beginning of function osm_services="nbi lcm ro pol mon ng-mon ng-ui keystone pla prometheus ng-prometheus" list_of_services="" for module in $osm_services; do -- 2.25.1