X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=installers%2Ffull_install_osm.sh;h=72d90c208440bd341879ba11da0b52f4ca924564;hb=e1dbef47b2c8d3bd45c420c81b61c4240fc1bf12;hp=15cd1f38f41eb1c41f981e2055b8d9c6029eb858;hpb=4b57d46af8be1804faffa27a987e614c45056147;p=osm%2Fdevops.git diff --git a/installers/full_install_osm.sh b/installers/full_install_osm.sh index 15cd1f38..72d90c20 100755 --- a/installers/full_install_osm.sh +++ b/installers/full_install_osm.sh @@ -278,7 +278,7 @@ function FATAL(){ function install_lxd() { # Apply sysctl production values for optimal performance - sudo cp /usr/share/osm-devops/installers/60-lxd-production.conf /etc/sysctl.d/60-lxd-production.conf + sudo cp ${OSM_DEVOPS}/installers/60-lxd-production.conf /etc/sysctl.d/60-lxd-production.conf sudo sysctl --system # Install LXD snap @@ -288,7 +288,7 @@ function install_lxd() { # Configure LXD sudo usermod -a -G lxd `whoami` - cat /usr/share/osm-devops/installers/lxd-preseed.conf | sed 's/^config: {}/config:\n core.https_address: '$DEFAULT_IP':8443/' | sg lxd -c "lxd init --preseed" + cat ${OSM_DEVOPS}/installers/lxd-preseed.conf | sed 's/^config: {}/config:\n core.https_address: '$DEFAULT_IP':8443/' | sg lxd -c "lxd init --preseed" sg lxd -c "lxd waitready" DEFAULT_INTERFACE=$(ip route list|awk '$1=="default" {print $5; exit}') [ -z "$DEFAULT_INTERFACE" ] && DEFAULT_INTERFACE=$(route -n |awk '$1~/^0.0.0.0/ {print $8; exit}') @@ -363,7 +363,7 @@ function install_prometheus_nodeexporter(){ sudo cp /tmp/node_exporter-$PROMETHEUS_NODE_EXPORTER_TAG.linux-amd64/node_exporter /usr/local/bin sudo chown node_exporter:node_exporter /usr/local/bin/node_exporter sudo rm -rf /tmp/node_exporter-$PROMETHEUS_NODE_EXPORTER_TAG.linux-amd64* - sudo cp ${OSM_DEVOPS}/installers/docker/prometheus/node_exporter.service /etc/systemd/system/node_exporter.service + sudo cp ${OSM_DEVOPS}/installers/docker/prometheus_exporters/node_exporter.service /etc/systemd/system/node_exporter.service sudo systemctl daemon-reload sudo systemctl restart node_exporter sudo systemctl enable node_exporter @@ -846,9 +846,9 @@ 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 + $WORKDIR_SUDO sed -i "s#path: /var/lib/osm#path: $OSM_NAMESPACE_VOL#g" $OSM_K8S_WORK_DIR/$osm.yaml done } @@ -977,6 +977,23 @@ function deploy_elk() { return 0 } +function add_local_k8scluster() { + /usr/bin/osm --all-projects vim-create \ + --name _system-osm-vim \ + --account_type dummy \ + --auth_url http://dummy \ + --user osm --password osm --tenant osm \ + --description "dummy" \ + --config '{management_network_name: mgmt}' + /usr/bin/osm --all-projects k8scluster-add \ + --creds ${HOME}/.kube/config \ + --vim _system-osm-vim \ + --k8s-nets '{"net1": null}' \ + --version '1.15' \ + --description "OSM Internal Cluster" \ + _system-osm-k8s +} + function install_lightweight() { [ "${OSM_STACK_NAME}" == "osm" ] || OSM_DOCKER_WORK_DIR="$OSM_WORK_DIR/stack/$OSM_STACK_NAME" [ -n "$KUBERNETES" ] && OSM_K8S_WORK_DIR="$OSM_DOCKER_WORK_DIR/osm_pods" && OSM_NAMESPACE_VOL="${OSM_HOST_VOL}/${OSM_STACK_NAME}" @@ -1171,8 +1188,26 @@ EOF [ -z "$INSTALL_NOHOSTCLIENT" ] && install_osmclient track osmclient + + echo -e "Checking OSM health state..." + if [ -n "$KUBERNETES" ]; then + $OSM_DEVOPS/installers/osm_health.sh -s ${OSM_STACK_NAME} -k || \ + echo -e "OSM is not healthy, but will probably converge to a healthy state soon." && \ + echo -e "Check OSM status with: kubectl -n ${OSM_STACK_NAME} get all" && \ + track osm_unhealthy + else + $OSM_DEVOPS/installers/osm_health.sh -s ${OSM_STACK_NAME} || \ + echo -e "OSM is not healthy, but will probably converge to a healthy state soon." && \ + echo -e "Check OSM status with: docker service ls; docker stack ps ${OSM_STACK_NAME}" && \ + track osm_unhealthy + fi + track after_healthcheck + + [ -n "$KUBERNETES" ] && add_local_k8scluster + track add_local_k8scluster + - wget -q -O- https://osm-download.etsi.org/ftp/osm-7.0-seven/README2.txt &> /dev/null + wget -q -O- https://osm-download.etsi.org/ftp/osm-8.0-eight/README2.txt &> /dev/null track end return 0 } @@ -1320,7 +1355,7 @@ SHOWOPTS="" COMMIT_ID="" ASSUME_YES="" INSTALL_FROM_SOURCE="" -RELEASE="ReleaseSEVEN" +RELEASE="ReleaseEIGHT" REPOSITORY="stable" INSTALL_VIMEMU="" INSTALL_PLA="" @@ -1545,9 +1580,9 @@ fi if [ -n "$CHARMED" ]; then if [ -n "$UNINSTALL" ]; then - /usr/share/osm-devops/installers/charmed_uninstall.sh -R $RELEASE -r $REPOSITORY -u $REPOSITORY_BASE -D /usr/share/osm-devops -t $DOCKER_TAG "$@" + ${OSM_DEVOPS}/installers/charmed_uninstall.sh -R $RELEASE -r $REPOSITORY -u $REPOSITORY_BASE -D /usr/share/osm-devops -t $DOCKER_TAG "$@" else - /usr/share/osm-devops/installers/charmed_install.sh -R $RELEASE -r $REPOSITORY -u $REPOSITORY_BASE -D /usr/share/osm-devops -t $DOCKER_TAG "$@" + ${OSM_DEVOPS}/installers/charmed_install.sh -R $RELEASE -r $REPOSITORY -u $REPOSITORY_BASE -D /usr/share/osm-devops -t $DOCKER_TAG "$@" echo "Your installation is now complete, follow these steps for configuring the osmclient:" echo @@ -1621,7 +1656,7 @@ fi [ -n "$INSTALL_ONLY" ] && echo -e "\nDONE" && exit 0 #Installation starts here -wget -q -O- https://osm-download.etsi.org/ftp/osm-7.0-seven/README.txt &> /dev/null +wget -q -O- https://osm-download.etsi.org/ftp/osm-8.0-eight/README.txt &> /dev/null track start [ -n "$INSTALL_LIGHTWEIGHT" ] && install_lightweight && echo -e "\nDONE" && exit 0 @@ -1642,7 +1677,7 @@ export OSM_USE_LOCAL_DEVOPS=true #Install vim-emu (optional) [ -n "$INSTALL_VIMEMU" ] && install_docker_ce && install_vimemu -wget -q -O- https://osm-download.etsi.org/ftp/osm-7.0-seven/README2.txt &> /dev/null +wget -q -O- https://osm-download.etsi.org/ftp/osm-8.0-eight/README2.txt &> /dev/null track end echo -e "\nDONE"