From: garciadeblas Date: Tue, 13 Apr 2021 16:26:55 +0000 (+0200) Subject: Fix bug 1151 to install openebs operator X-Git-Tag: branch-sol006v331-start~10 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F26%2F10626%2F3;p=osm%2Fdevops.git Fix bug 1151 to install openebs operator This change updates the method install_k8s_storageclass of full_install_osm.sh. The change creates a temporary folder for downloading the K8s manifest file for openebs. The download of the manifest file is decoupled from its application with kubectl (in the same way that it isdone for the CNI provider). After its application, an additional check is added to verify that the storage class openebs-hostpath has been defined. If it does not exist, the installation will fail and exit. Otherwise, it will proceed. Finally, the timeout for the openebs-hostpath storage class has been increased from 300s to 400s. Change-Id: Ic1da8b9606bd7b3265f38c1da7389e5b2cdc741b Signed-off-by: garciadeblas --- diff --git a/installers/full_install_osm.sh b/installers/full_install_osm.sh index b9330b31..04605da7 100755 --- a/installers/full_install_osm.sh +++ b/installers/full_install_osm.sh @@ -856,9 +856,13 @@ function kube_config_dir() { } function install_k8s_storageclass() { - kubectl apply -f https://openebs.github.io/charts/openebs-operator-1.6.0.yaml - local storageclass_timeout=300 + OPENEBS_DIR="$(mktemp -d -q --tmpdir "openebs.XXXXXX")" + trap 'rm -rf "${OPENEBS_DIR}"' EXIT + wget -q https://openebs.github.io/charts/openebs-operator-1.6.0.yaml -P $OPENEBS_DIR + kubectl apply -f $OPENEBS_DIR + local storageclass_timeout=400 local counter=0 + local storageclass_ready="" echo "Waiting for storageclass" while (( counter < storageclass_timeout )) do @@ -866,12 +870,14 @@ function install_k8s_storageclass() { if [ $? -eq 0 ] ; then echo "Storageclass available" + storageclass_ready="y" break else counter=$((counter + 15)) sleep 15 fi done + [ -n "$storageclass_ready" ] || FATAL "Storageclass not ready after $storageclass_timeout seconds. Cannot install openebs" kubectl patch storageclass openebs-hostpath -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}' }