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
function install_juju() {
echo "Installing juju"
- sudo snap install juju --classic --channel=2.7/stable
+ sudo snap install juju --classic --channel=2.8/stable
[[ ":$PATH": != *":/snap/bin:"* ]] && PATH="/snap/bin:${PATH}"
echo "Finished installation of juju"
return 0
sg lxd -c "juju bootstrap --bootstrap-series=xenial $OSM_VCA_CLOUDNAME $OSM_STACK_NAME"
fi
[ $(juju controllers | awk "/^${OSM_STACK_NAME}[\*| ]/{print $1}"|wc -l) -eq 1 ] || FATAL "Juju installation failed"
+
+ if [ -n "$KUBERNETES" ]; then
+ cat .kube/config | juju add-k8s $OSM_VCA_K8S_CLOUDNAME --controller $OSM_STACK_NAME
+ fi
+ juju controller-config features=[k8s-operators]
}
function juju_createproxy() {
$WORKDIR_SUDO sed -i "s|OSMLCM_VCA_CLOUD.*|OSMLCM_VCA_CLOUD=${OSM_VCA_CLOUDNAME}|g" $OSM_DOCKER_WORK_DIR/lcm.env
fi
+ if ! grep -Fq "OSMLCM_VCA_K8S_CLOUD" $OSM_DOCKER_WORK_DIR/lcm.env; then
+ echo "OSMLCM_VCA_K8S_CLOUD=${OSM_VCA_K8S_CLOUDNAME}" | $WORKDIR_SUDO tee -a $OSM_DOCKER_WORK_DIR/lcm.env
+ else
+ $WORKDIR_SUDO sed -i "s|OSMLCM_VCA_K8S_CLOUD.*|OSMLCM_VCA_K8S_CLOUD=${OSM_VCA_K8S_CLOUDNAME}|g" $OSM_DOCKER_WORK_DIR/lcm.env
+ fi
+
# RO
MYSQL_ROOT_PASSWORD=$(generate_secret)
if [ ! -f $OSM_DOCKER_WORK_DIR/ro-db.env ]; then
sudo chown $(id -u):$(id -g) $HOME/.kube/config
}
+function install_k8s_storageclass() {
+ kubectl apply -f https://openebs.github.io/charts/openebs-operator-1.6.0.yaml
+ kubectl patch storageclass openebs-hostpath -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'
+}
+
#deploys flannel as daemonsets
function deploy_cni_provider() {
CNI_DIR="$(mktemp -d -q --tmpdir "flannel.XXXXXX")"
function namespace_vol() {
osm_services="nbi lcm ro pol mon kafka mongo mysql"
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
}
track install_k8s
init_kubeadm $OSM_DOCKER_WORK_DIR/cluster-config.yaml
kube_config_dir
+ install_k8s_storage_class
track init_k8s
else
#install_docker_compose
[ -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
- 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
}
COMMIT_ID=""
ASSUME_YES=""
INSTALL_FROM_SOURCE=""
-RELEASE="ReleaseSEVEN"
+RELEASE="ReleaseEIGHT"
REPOSITORY="stable"
INSTALL_VIMEMU=""
INSTALL_PLA=""
OSM_VCA_SECRET=
OSM_VCA_PUBKEY=
OSM_VCA_CLOUDNAME="localhost"
+OSM_VCA_K8S_CLOUDNAME="k8scloud"
OSM_STACK_NAME=osm
NO_HOST_PORTS=""
DOCKER_NOBUILD=""
[ -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
#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"