X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=installers%2Ffull_install_osm.sh;h=e1c917562c49cd18703deb92da8a80860cee4ef2;hb=1a423a467dca38dab970ea9e0f7480be1f2dfc83;hp=2d164495a7b2a5b4a166161fe8af7cc33cb5b87f;hpb=d807e90e7f5c4125e9d5a799a862827e56cb8547;p=osm%2Fdevops.git diff --git a/installers/full_install_osm.sh b/installers/full_install_osm.sh index 2d164495..e1c91756 100755 --- a/installers/full_install_osm.sh +++ b/installers/full_install_osm.sh @@ -183,6 +183,10 @@ function remove_helm() { fi } +function remove_crontab_job() { + crontab -l | grep -v '${OSM_DEVOPS}/installers/update-juju-lxc-images' | crontab - +} + #Uninstall osmclient function uninstall_osmclient() { sudo apt-get remove --purge -y python-osmclient @@ -245,6 +249,7 @@ EONG $WORKDIR_SUDO rm -rf $OSM_DOCKER_WORK_DIR [ -z "$CONTROLLER_NAME" ] && sg lxd -c "juju destroy-controller --destroy-all-models --yes $OSM_STACK_NAME" fi + remove_crontab_job uninstall_osmclient echo "Some docker images will be kept in case they are used by other docker stacks" echo "To remove them, just run 'docker image prune' in a terminal" @@ -276,6 +281,11 @@ function FATAL(){ exit 1 } +function update_juju_images(){ + crontab -l | grep update-juju-lxc-images || (crontab -l 2>/dev/null; echo "0 4 * * 6 $USER ${OSM_DEVOPS}/installers/update-juju-lxc-images --xenial --bionic") | crontab - + ${OSM_DEVOPS}/installers/update-juju-lxc-images --xenial --bionic +} + function install_lxd() { # Apply sysctl production values for optimal performance sudo cp ${OSM_DEVOPS}/installers/60-lxd-production.conf /etc/sysctl.d/60-lxd-production.conf @@ -414,6 +424,7 @@ function install_juju() { echo "Installing juju" sudo snap install juju --classic --channel=2.7/stable [[ ":$PATH": != *":/snap/bin:"* ]] && PATH="/snap/bin:${PATH}" + update_juju_images echo "Finished installation of juju" return 0 } @@ -787,11 +798,15 @@ function kube_secrets(){ kubectl create secret generic pol-secret -n $OSM_STACK_NAME --from-env-file=$OSM_DOCKER_WORK_DIR/pol.env } -#deploys osm pods and services -function deploy_osm_services() { +#taints K8s master node +function taint_master_node() { K8S_MASTER=$(kubectl get nodes | awk '$3~/master/'| awk '{print $1}') kubectl taint node $K8S_MASTER node-role.kubernetes.io/master:NoSchedule- sleep 5 +} + +#deploys osm pods and services +function deploy_osm_services() { kubectl apply -n $OSM_STACK_NAME -f $OSM_K8S_WORK_DIR } @@ -846,7 +861,7 @@ function parse_yaml() { } function namespace_vol() { - osm_services="nbi lcm ro pol mon kafka mongo mysql" + osm_services="nbi lcm ro pol mon kafka mongo mysql prometheus" for osm in $osm_services; do $WORKDIR_SUDO sed -i "s#path: /var/lib/osm#path: $OSM_NAMESPACE_VOL#g" $OSM_K8S_WORK_DIR/$osm.yaml done @@ -1162,12 +1177,19 @@ EOF kube_secrets [ ! $OSM_DOCKER_TAG == "7" ] && parse_yaml $OSM_DOCKER_TAG namespace_vol + taint_master_node deploy_osm_services if [ -n "$INSTALL_PLA"]; then # optional PLA install deploy_osm_pla_service fi track deploy_osm_services_k8s + install_k8s_storageclass + track k8s_storageclass + juju_addk8s + track juju_addk8s + install_helm + track install_helm if [ -n "$INSTALL_K8S_MONITOR" ]; then # install OSM MONITORING install_k8s_monitoring