X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;ds=inline;f=ric-aux%2Fbin%2Finstall;h=7e4f03a0c1232f991f69be04dd8211bb5f241b06;hb=refs%2Fchanges%2F71%2F5671%2F1;hp=360b32be8eed670a1f1bb184c2bae993ec5871be;hpb=dc00cdf008775e2ac5dddb186d1eb81e80370b69;p=it%2Fdep.git diff --git a/ric-aux/bin/install b/ric-aux/bin/install index 360b32be..7e4f03a0 100755 --- a/ric-aux/bin/install +++ b/ric-aux/bin/install @@ -45,8 +45,16 @@ if [ -z "$OVERRIDEYAML" ];then exit 1 fi +#Check for helm3 +IS_HELM3=$(helm version -c --short|grep -e "^v3") +HELM_SEARCH_FLAG="" +if [ $IS_HELM3 ] +then + HELM_SEARCH_FLAG="repo" +fi + -HAS_RIC_COMMON_PACKAGE=$(helm search local/ric-common | grep ric-common) +HAS_RIC_COMMON_PACKAGE=$(helm search ${HELM_SEARCH_FLAG} local/ric-common | grep ric-common) if [ -z "$HAS_RIC_COMMON_PACKAGE" ];then echo "****************************************************************************************************************" @@ -57,7 +65,7 @@ if [ -z "$HAS_RIC_COMMON_PACKAGE" ];then exit 1 fi -HAS_AUX_COMMON_PACKAGE=$(helm search local/aux-common | grep aux-common) +HAS_AUX_COMMON_PACKAGE=$(helm search ${HELM_SEARCH_FLAG} local/aux-common | grep aux-common) if [ -z "$HAS_AUX_COMMON_PACKAGE" ];then echo "****************************************************************************************************************" @@ -86,10 +94,11 @@ for f in $NODENAME; do LABEL=$(kubectl describe node $f | grep "local-storage=enable") if [ ! -z "$LABEL" ]; then LABELFOUND=true + echo "Found lable \"local-storage=enable\" at node $f" fi done -FOUND_STORAGECLASS=$(grep storageclass $OVERRIDEYAML) +FOUND_STORAGECLASS=$(grep -w storageclass $OVERRIDEYAML) if ! $LABELFOUND && [ -z "$FOUND_STORAGECLASS" ]; then @@ -133,6 +142,29 @@ if [ -z "$FOUND_STORAGECLASS" ] && $LABELFOUND; then fi +LABELFOUND=false +for f in $NODENAME; do + LABEL=$(kubectl describe node $f | grep "portal-storage=enable") + if [ ! -z "$LABEL" ]; then + LABELFOUND=true + echo "Found lable \"portal-storage=enable\" at node $f" + fi +done + +if ! $LABELFOUND; then + echo "***********************************************************************************************" + echo "* ERROR!!!!!!!!!!!!! *" + echo "***********************************************************************************************" + echo "* Nodes label \"portal-storage=enable\" is not found in any of the cluster node. *" + echo "* Please pick a node and label it using the following command. i *" + echo "* kubectl label --overwrite nodes portal-storage=enable *" + echo "***********************************************************************************************" + + exit 1 +fi + + + if ! kubectl get ns ${AUXNAMESPACE:-ricaux}> /dev/null 2>&1; then kubectl create ns ${AUXNAMESPACE:-ricaux} fi @@ -143,15 +175,161 @@ if ! kubectl get ns onap > /dev/null 2>&1; then kubectl create ns onap fi + + + +echo Add cluster roles + cat >ricaux-role.yaml <1{print $1}') @@ -160,6 +338,7 @@ for component in $COMPONENTS; do LABEL=$(kubectl describe node $f | grep "aaf-storage=enable") if [ ! -z "$LABEL" ]; then LABELFOUND=true + echo "Found lable \"aaf-storage=enable\" at node $f" fi done @@ -172,12 +351,12 @@ for component in $COMPONENTS; do echo "* kubectl label --overwrite nodes aaf-storage=enable *" echo "***********************************************************************************************" else - helm install -f $OVERRIDEYAML --namespace "onap" --name "${RELEASE_PREFIX}-$component" $DIR/../helm/$component + helm install -f $OVERRIDEYAML --namespace "onap" ${NAME_ARG} "${RELEASE_PREFIX}-$component" $DIR/../helm/$component fi ;; *) - helm install -f $OVERRIDEYAML --namespace "${AUXNAMESPACE:-ricaux}" --name "${RELEASE_PREFIX}-$component" $DIR/../helm/$component - + helm install -f $OVERRIDEYAML --namespace "${AUXNAMESPACE:-ricaux}" ${NAME_ARG} "${RELEASE_PREFIX}-$component" $DIR/../helm/$component + sleep 8 esac done