From 2cabee9fd1443514279d76390ef439d8cdad5e6f Mon Sep 17 00:00:00 2001 From: Vijay Venkatesh Kumar Date: Mon, 13 Jan 2020 20:50:28 +0000 Subject: remove consul lookup for cbs Change-Id: I3bc1aeac314bd0bbd6679182917c3c2c0176d498 Signed-off-by: Vijay Venkatesh Kumar Issue-ID: DCAEGEN2-2021 --- tca-cdap-container/restart.sh | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) (limited to 'tca-cdap-container/restart.sh') diff --git a/tca-cdap-container/restart.sh b/tca-cdap-container/restart.sh index c61c300..e062d7d 100755 --- a/tca-cdap-container/restart.sh +++ b/tca-cdap-container/restart.sh @@ -1,6 +1,6 @@ #!/bin/bash # ================================================================================ -# Copyright (c) 2018-2019 AT&T Intellectual Property. All rights reserved. +# Copyright (c) 2018-2020 AT&T Intellectual Property. All rights reserved. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -41,11 +41,15 @@ MR_WATCHDOG_PATH="${TCA_FILE_PATH}/mr-watchdog.sh" WORKER_COUNT='0' -CONSUL_HOST=${CONSUL_HOST:-consul} -CONSUL_PORT=${CONSUL_PORT:-8500} -CONFIG_BINDING_SERVICE=${CONFIG_BINDING_SERVICE:-config_binding_service} +# Remove consul dependency for CBS lookup (DCAEGEN2-2021) +# CBS Host and port are set to CBS K8S service name and port identified on CBS deployment via Helm +CBS_HOST=${CBS_HOST:-config-binding-service} +CBS_PORT=${CBS_PORT:-10000} -CBS_SERVICE_NAME=${CONFIG_BINDING_SERVICE} +#CONSUL_HOST=${CONSUL_HOST:-consul} +#CONSUL_PORT=${CONSUL_PORT:-8500} +#CONFIG_BINDING_SERVICE=${CONFIG_BINDING_SERVICE:-config_binding_service} +CBS_SERVICE_NAME=${CBS_SERVICE_NAME:-config_binding_service} #Changing to HOSTNAME parameter for consistency with k8s deploy MY_NAME=${HOSTNAME:-tca} @@ -317,9 +321,7 @@ echo "TCA-CDAP standalone mode initialization completed, with $WORKER_COUNT / 3 #Changing to HOSTNAME parameter for consistency with k8s deploy MY_NAME=${HOSTNAME:-tca} -unset CBS_HOST -unset CBS_PORT -echo "TCA environment: I am ${MY_NAME}, consul at ${CONSUL_HOST}:${CONSUL_PORT}, CBS service name ${CBS_SERVICE_NAME}" +echo "TCA environment: I am ${MY_NAME}, CBS K8S Service Name and port is ${CBS_HOST}:${CBS_PORT}" while echo do @@ -335,13 +337,14 @@ do done - if [[ -z "$CBS_HOST" || -z "$CBS_PORT" ]]; then - echo "Retrieving host and port for ${CBS_SERVICE_NAME} from ${CONSUL_HOST}:${CONSUL_PORT}" - sleep 2 - CBS_HOST=$(curl -s "${CONSUL_HOST}:${CONSUL_PORT}/v1/catalog/service/${CBS_SERVICE_NAME}" |jq .[0].ServiceAddress |sed -e 's/\"//g') - CBS_PORT=$(curl -s "${CONSUL_HOST}:${CONSUL_PORT}/v1/catalog/service/${CBS_SERVICE_NAME}" |jq .[0].ServicePort |sed -e 's/\"//g') - echo "CBS discovered to be at ${CBS_HOST}:${CBS_PORT}" - fi +#Below commented to remove consul lookup and use k8s servicename for CBS (DCAEGEN2-2021) +# if [[ -z "$CBS_HOST" || -z "$CBS_PORT" ]]; then +# echo "Retrieving host and port for ${CBS_SERVICE_NAME} from ${CONSUL_HOST}:${CONSUL_PORT}" +# sleep 2 +# CBS_HOST=$(curl -s "${CONSUL_HOST}:${CONSUL_PORT}/v1/catalog/service/${CBS_SERVICE_NAME}" |jq .[0].ServiceAddress |sed -e 's/\"//g') +# CBS_PORT=$(curl -s "${CONSUL_HOST}:${CONSUL_PORT}/v1/catalog/service/${CBS_SERVICE_NAME}" |jq .[0].ServicePort |sed -e 's/\"//g') +# echo "CBS discovered to be at ${CBS_HOST}:${CBS_PORT}" +# fi if [ ! -z "$CBS_HOST" ] && [ ! -z "$CBS_PORT" ]; then tca_poll_policy -- cgit 1.2.3-korg