X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=installers%2Ffull_install_osm.sh;h=38e50c6218a9b67adfdf9c6ba553d6cdeeb32335;hb=a7b27dcb3cd9f4b79e14684957b1cd3914cda2fd;hp=4725287c6c19120ac98c3774a62ca835f9ab1072;hpb=6ad812eafdd40741b596a8aee93dd88e9232a162;p=osm%2Fdevops.git diff --git a/installers/full_install_osm.sh b/installers/full_install_osm.sh index 4725287c..38e50c62 100755 --- a/installers/full_install_osm.sh +++ b/installers/full_install_osm.sh @@ -53,6 +53,7 @@ function usage(){ echo -e " --soui: install classic build of OSM (Rel THREE v3.1, based on LXD containers, with SO and UI)" echo -e " --lxdimages: (only for Rel THREE with --soui) download lxd images from OSM repository instead of creating them from scratch" echo -e " --pullimages: pull/run osm images from docker.io/opensourcemano" + echo -e " --k8s_monitor: install the OSM kubernetes moitoring with prometheus and grafana" echo -e " -l : (only for Rel THREE with --soui) use specified repository url for lxd images" echo -e " -p : (only for Rel THREE with --soui) use specified repository path for lxd images" # echo -e " --reconfigure: reconfigure the modules (DO NOT change NAT rules)" @@ -185,10 +186,15 @@ function uninstall_lightweight() { else echo -e "\nUninstalling OSM" if [ -n "$KUBERNETES" ]; then + if [ -n "$K8S_MONITOR" ]; then + # uninstall OSM MONITORING + uninstall_k8s_monitoring + fi remove_k8s_namespace $OSM_STACK_NAME else remove_stack $OSM_STACK_NAME remove_stack osm_elk + uninstall_prometheus_nodeexporter fi echo "Now osm docker images and volumes will be deleted" newgrp docker << EONG @@ -610,6 +616,16 @@ function install_prometheus_nodeexporter(){ return 0 } +function uninstall_prometheus_nodeexporter(){ + sudo systemctl stop node_exporter + sudo systemctl disable node_exporter + sudo rm /etc/systemd/system/node_exporter.service + sudo systemctl daemon-reload + sudo userdel node_exporter + sudo rm /usr/local/bin/node_exporter + return 0 +} + function install_from_lxdimages(){ LXD_RELEASE=${RELEASE#"-R "} if [ -n "$LXD_REPOSITORY_PATH" ]; then @@ -1039,6 +1055,7 @@ function deploy_lightweight() { OSM_UI_PORT=80 OSM_MON_PORT=8662 OSM_PROM_PORT=9090 + OSM_PROM_CADVISOR_PORT=8080 OSM_PROM_HOSTPORT=9091 OSM_GRAFANA_PORT=3000 [ -n "$INSTALL_ELK" ] && OSM_ELK_PORT=5601 @@ -1051,6 +1068,7 @@ function deploy_lightweight() { OSM_PORTS+=(OSM_UI_PORTS=$OSM_UI_PORT) OSM_PORTS+=(OSM_MON_PORTS=$OSM_MON_PORT) OSM_PORTS+=(OSM_PROM_PORTS=$OSM_PROM_PORT) + OSM_PORTS+=(OSM_PROM_CADVISOR_PORTS=$OSM_PROM_CADVISOR_PORT) OSM_PORTS+=(OSM_GRAFANA_PORTS=$OSM_GRAFANA_PORT) #[ -n "$INSTALL_PERFMON" ] && OSM_PORTS+=(OSM_PM_PORTS=$OSM_PM_PORT) [ -n "$INSTALL_ELK" ] && OSM_PORTS+=(OSM_ELK_PORTS=$OSM_ELK_PORT) @@ -1061,6 +1079,7 @@ function deploy_lightweight() { OSM_PORTS+=(OSM_UI_PORTS=$OSM_UI_PORT:$OSM_UI_PORT) OSM_PORTS+=(OSM_MON_PORTS=$OSM_MON_PORT:$OSM_MON_PORT) OSM_PORTS+=(OSM_PROM_PORTS=$OSM_PROM_HOSTPORT:$OSM_PROM_PORT) + OSM_PORTS+=(OSM_PROM_CADVISOR_PORTS=$OSM_PROM_CADVISOR_PORT:$OSM_PROM_CADVISOR_PORT) OSM_PORTS+=(OSM_GRAFANA_PORTS=$OSM_GRAFANA_PORT:$OSM_GRAFANA_PORT) #[ -n "$INSTALL_PERFMON" ] && OSM_PORTS+=(OSM_PM_PORTS=$OSM_PM_PORT:$OSM_PM_PORT) [ -n "$INSTALL_ELK" ] && OSM_PORTS+=(OSM_ELK_PORTS=$OSM_ELK_PORT:$OSM_ELK_PORT) @@ -1237,6 +1256,10 @@ function install_lightweight() { generate_docker_env_files if [ -n "$KUBERNETES" ]; then + if [ -n "$K8S_MONITOR" ]; then + # uninstall OSM MONITORING + uninstall_k8s_monitoring + fi #remove old namespace remove_k8s_namespace $OSM_STACK_NAME deploy_cni_provider @@ -1257,6 +1280,12 @@ function install_lightweight() { [ -n "$INSTALL_ELK" ] && deploy_elk && track elk fi + if [ -n "$KUBERNETES" ] && [ -n "$K8S_MONITOR" ]; then + # install OSM MONITORING + install_k8s_monitoring + track install_k8s_monitoring + fi + [ -z "$INSTALL_NOHOSTCLIENT" ] && install_osmclient track osmclient @@ -1296,6 +1325,18 @@ function install_vimemu() { echo " osm vim-create --name emu-vim1 --user username --password password --auth_url http://${VIMEMU_HOSTNAME}:6001/v2.0 --tenant tenantName --account_type openstack" } +function install_k8s_monitoring() { + # install OSM monitoring + chmod +x $WORKDIR_SUDO $OSM_DEVOPS/installers/k8s/*.sh + $WORKDIR_SUDO $OSM_DEVOPS/installers/k8s/install_osm_k8s_monitoring.sh +} + +function uninstall_k8s_monitoring() { + # install OSM monitoring + chmod +x $WORKDIR_SUDO $OSM_DEVOPS/installers/k8s/*.sh + $WORKDIR_SUDO $OSM_DEVOPS/installers/k8s/uninstall_osm_k8s_monitoring.sh +} + function dump_vars(){ echo "DEVELOP=$DEVELOP" echo "INSTALL_FROM_SOURCE=$INSTALL_FROM_SOURCE" @@ -1379,6 +1420,7 @@ INSTALL_NOLXD="" INSTALL_NODOCKER="" INSTALL_NOJUJU="" KUBERNETES="" +K8S_MONITOR="" INSTALL_NOHOSTCLIENT="" NOCONFIGURE="" RELEASE_DAILY="" @@ -1526,6 +1568,7 @@ while getopts ":hy-:b:r:c:k:u:R:l:p:D:o:m:H:S:s:w:t:U:P:A:" o; do [ "${OPTARG}" == "nodockerbuild" ] && DOCKER_NOBUILD="y" && continue [ "${OPTARG}" == "nohostclient" ] && INSTALL_NOHOSTCLIENT="y" && continue [ "${OPTARG}" == "pullimages" ] && continue + [ "${OPTARG}" == "k8s_monitor" ] && K8S_MONITOR="y" && continue echo -e "Invalid option: '--$OPTARG'\n" >&2 usage && exit 1 ;;