X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=installers%2Ffull_install_osm.sh;h=f5908ff103a812bb841b1daf773eaf393f013384;hb=86756ecffaf8a262ea23fcddbef9d8841ae16d37;hp=5eee02325cc94d0c442d3f19bcbe82da40da927c;hpb=cd00aada754a0ab3fc0a4839846d7ffaf559bea9;p=osm%2Fdevops.git diff --git a/installers/full_install_osm.sh b/installers/full_install_osm.sh index 5eee0232..f5908ff1 100755 --- a/installers/full_install_osm.sh +++ b/installers/full_install_osm.sh @@ -137,7 +137,7 @@ function remove_iptables() { if [ -z "$DEFAULT_IP" ]; then DEFAULT_IF=$(ip route list|awk '$1=="default" {print $5; exit}') - [ -z "$DEFAULT_IF" ] && DEFAULT_IF=$(route -n |awk '$1~/^0.0.0.0/ {print $8; exit}') + [ -z "$DEFAULT_IF" ] && DEFAULT_IF=$(ip route list|awk '$1=="default" {print $5; exit}') [ -z "$DEFAULT_IF" ] && FATAL "Not possible to determine the interface with the default route 0.0.0.0" DEFAULT_IP=`ip -o -4 a |grep ${DEFAULT_IF}|awk '{split($4,a,"/"); print a[1]}'` [ -z "$DEFAULT_IP" ] && FATAL "Not possible to determine the IP address of the interface with the default route" @@ -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"}}}' } @@ -1199,7 +1205,7 @@ function install_lightweight() { DEFAULT_IF=$(ip route list|awk '$1=="default" {print $5; exit}') [ -z "$DEFAULT_IF" ] && DEFAULT_IF=$(route -n |awk '$1~/^0.0.0.0/ {print $8; exit}') [ -z "$DEFAULT_IF" ] && FATAL "Not possible to determine the interface with the default route 0.0.0.0" - DEFAULT_IP=`ip -o -4 a |grep ${DEFAULT_IF} |awk '{split($4,a,"/"); print a[1]}'` + DEFAULT_IP=`ip -o -4 a s ${DEFAULT_IF} |awk '{split($4,a,"/"); print a[1]}'` [ -z "$DEFAULT_IP" ] && FATAL "Not possible to determine the IP address of the interface with the default route" DEFAULT_MTU=$(ip addr show ${DEFAULT_IF} | perl -ne 'if (/mtu\s(\d+)/) {print $1;}')