X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=installers%2Ffull_install_osm.sh;h=941e51e5017ded71ab9cddfb98d473fb95bda4dc;hb=ccabbe39368ab73645caa6ab469be795cae66df5;hp=f5908ff103a812bb841b1daf773eaf393f013384;hpb=86756ecffaf8a262ea23fcddbef9d8841ae16d37;p=osm%2Fdevops.git diff --git a/installers/full_install_osm.sh b/installers/full_install_osm.sh index f5908ff1..941e51e5 100755 --- a/installers/full_install_osm.sh +++ b/installers/full_install_osm.sh @@ -182,8 +182,6 @@ function remove_k8s_namespace() { function remove_helm() { if [ "$(helm ls -q)" == "" ] ; then sudo helm reset --force - kubectl delete --namespace kube-system serviceaccount tiller - kubectl delete clusterrolebinding tiller-cluster-rule sudo rm /usr/local/bin/helm rm -rf $HOME/.helm fi @@ -295,7 +293,7 @@ function install_lxd() { # Install LXD snap sudo apt-get remove --purge -y liblxc1 lxc-common lxcfs lxd lxd-client - sudo snap install lxd + sudo snap install lxd --channel $LXD_VERSION/stable # Configure LXD sudo usermod -a -G lxd `whoami` @@ -339,6 +337,13 @@ function install_osmclient(){ sudo -H LC_ALL=C python3 -m pip install -U pip sudo -H LC_ALL=C python3 -m pip install -U python-magic pyangbind verboselogs sudo apt-get install -y python3-osm-im python3-osmclient + if [ -f /usr/lib/python3/dist-packages/osm_im/requirements.txt ]; then + python3 -m pip install -r /usr/lib/python3/dist-packages/osm_im/requirements.txt + fi + if [ -f /usr/lib/python3/dist-packages/osmclient/requirements.txt ]; then + sudo apt-get install -y libcurl4-openssl-dev libssl-dev + python3 -m pip install -r /usr/lib/python3/dist-packages/osmclient/requirements.txt + fi #sed 's,OSM_SOL005=[^$]*,OSM_SOL005=True,' -i ${HOME}/.bashrc #echo 'export OSM_HOSTNAME=localhost' >> ${HOME}/.bashrc #echo 'export OSM_SOL005=True' >> ${HOME}/.bashrc @@ -442,7 +447,7 @@ function install_docker_compose() { function install_juju() { echo "Installing juju" - sudo snap install juju --classic --channel=2.8/stable + sudo snap install juju --classic --channel=$JUJU_VERSION/stable [[ ":$PATH": != *":/snap/bin:"* ]] && PATH="/snap/bin:${PATH}" update_juju_images echo "Finished installation of juju" @@ -856,10 +861,12 @@ function kube_config_dir() { } function install_k8s_storageclass() { - 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 + echo "Installing OpenEBS" + kubectl create ns openebs + helm repo add openebs https://openebs.github.io/charts + helm repo update + helm install --namespace openebs openebs openebs/openebs --version 1.12.0 + helm ls -n openebs local storageclass_timeout=400 local counter=0 local storageclass_ready="" @@ -950,40 +957,19 @@ function deploy_osm_pla_service() { kubectl apply -n $OSM_STACK_NAME -f $OSM_DOCKER_WORK_DIR/osm_pla } -#Install helm and tiller +#Install Helm v3 function install_helm() { helm > /dev/null 2>&1 if [ $? != 0 ] ; then # Helm is not installed. Install helm echo "Helm is not installed, installing ..." - curl https://get.helm.sh/helm-v2.15.2-linux-amd64.tar.gz --output helm-v2.15.2.tar.gz - tar -zxvf helm-v2.15.2.tar.gz + curl https://get.helm.sh/helm-v3.6.3-linux-amd64.tar.gz --output helm-v3.6.3.tar.gz + tar -zxvf helm-v3.6.3.tar.gz sudo mv linux-amd64/helm /usr/local/bin/helm rm -r linux-amd64 - rm helm-v2.15.2.tar.gz - fi - - # Checking if tiller has being configured - kubectl --namespace kube-system get serviceaccount tiller > /dev/null 2>&1 - if [ $? == 1 ] ; then - # tiller account for kubernetes - kubectl --namespace kube-system create serviceaccount tiller - kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller - # HELM initialization - helm init --stable-repo-url https://charts.helm.sh/stable --service-account tiller - - # Wait for Tiller to be up and running. If timeout expires, continue installing - tiller_timeout=120; - counter=0; - tiller_status="" - while (( counter < tiller_timeout )) - do - tiller_status=`kubectl -n kube-system get deployment.apps/tiller-deploy --no-headers | awk '{print $2'}` - ( [ ! -z "$tiller_status" ] && [ $tiller_status == "1/1" ] ) && echo "Tiller ready" && break - counter=$((counter + 5)) - sleep 5 - done - [ "$tiller_status" != "1/1" ] && echo "Tiller is NOT READY YET. Installation will continue" + rm helm-v3.6.3.tar.gz + helm repo add stable https://charts.helm.sh/stable + helm repo update fi } @@ -1249,6 +1235,8 @@ function install_lightweight() { remove_k8s_namespace $OSM_STACK_NAME deploy_cni_provider taint_master_node + install_helm + track install_helm install_k8s_storageclass track k8s_storageclass install_k8s_metallb @@ -1378,8 +1366,6 @@ EOF track deploy_osm_pla fi track deploy_osm_services_k8s - install_helm - track install_helm if [ -n "$INSTALL_K8S_MONITOR" ]; then # install OSM MONITORING install_k8s_monitoring @@ -1589,6 +1575,8 @@ function parse_docker_registry_url() { DOCKER_REGISTRY_URL=$(echo "$DOCKER_REGISTRY_URL" | awk '{split($1,a,"@"); print a[2]}') } +LXD_VERSION=4.0 +JUJU_VERSION=2.8 JUJU_AGENT_VERSION=2.8.8 UNINSTALL="" DEVELOP=""