}
#deploys osm pods and services
-function deploy_osm_services() {
+function deploy_osm_helm_chart() {
[ -z "${DEBUG_INSTALL}" ] || DEBUG beginning of function
# Generate helm values to be passed with -f osm-values.yaml
sudo mkdir -p ${OSM_HELM_WORK_DIR}
}
function find_devops_folder() {
+ [ -z "${DEBUG_INSTALL}" ] || DEBUG beginning of function
if [ -z "$OSM_DEVOPS" ]; then
if [ -n "$TEST_INSTALLER" ]; then
echo -e "\nUsing local devops repo for OSM installation"
git clone https://osm.etsi.org/gerrit/osm/devops.git $OSM_DEVOPS
fi
fi
+ [ -z "${DEBUG_INSTALL}" ] || DEBUG end of function
+}
+
+function install_lxd() {
+ [ -z "${DEBUG_INSTALL}" ] || DEBUG beginning of function
+ LXD_INSTALL_OPTS="-D ${OSM_DEVOPS} -i ${OSM_DEFAULT_IF} ${DEBUG_INSTALL}"
+ [ -n "${OSM_BEHIND_PROXY}" ] && LXD_INSTALL_OPTS="${LXD_INSTALL_OPTS} -P"
+ $OSM_DEVOPS/installers/install_lxd.sh ${LXD_INSTALL_OPTS} || FATAL_TRACK lxd "install_lxd.sh failed"
+ [ -z "${DEBUG_INSTALL}" ] || DEBUG end of function
+}
+
+function install_docker_ce() {
+ [ -z "${DEBUG_INSTALL}" ] || DEBUG beginning of function
+ DOCKER_CE_OPTS="-D ${OSM_DEVOPS} ${DEBUG_INSTALL}"
+ [ -n "${DOCKER_PROXY_URL}" ] && DOCKER_CE_OPTS="${DOCKER_CE_OPTS} -p ${DOCKER_PROXY_URL}"
+ [ -n "${OSM_BEHIND_PROXY}" ] && DOCKER_CE_OPTS="${DOCKER_CE_OPTS} -P"
+ $OSM_DEVOPS/installers/install_docker_ce.sh ${DOCKER_CE_OPTS} || FATAL_TRACK docker_ce "install_docker_ce.sh failed"
+ [ -z "${DEBUG_INSTALL}" ] || DEBUG end of function
+}
+
+function install_k8s_cluster() {
+ [ -z "${DEBUG_INSTALL}" ] || DEBUG beginning of function
+ if [ "${K8S_CLUSTER_ENGINE}" == "kubeadm" ]; then
+ KUBEADM_INSTALL_OPTS="-d ${OSM_WORK_DIR} -D ${OSM_DEVOPS} ${DEBUG_INSTALL}"
+ $OSM_DEVOPS/installers/install_kubeadm_cluster.sh ${KUBEADM_INSTALL_OPTS} || \
+ FATAL_TRACK k8scluster "install_kubeadm_cluster.sh failed"
+ K8SCLUSTER_ADDONS_INSTALL_OPTS="-i ${OSM_DEFAULT_IP} -d ${OSM_WORK_DIR} -D ${OSM_DEVOPS} ${DEBUG_INSTALL}"
+ $OSM_DEVOPS/installers/install_cluster_addons.sh ${K8SCLUSTER_ADDONS_INSTALL_OPTS} || \
+ FATAL_TRACK k8scluster "install_cluster_addons.sh failed"
+ fi
+ [ -z "${DEBUG_INSTALL}" ] || DEBUG end of function
+}
+
+function deploy_osm() {
+ deploy_mongodb
+ track deploy_osm deploy_mongodb_ok
+ deploy_osm_helm_chart
+ track deploy_osm deploy_osm_services_k8s_ok
+ if [ -n "$INSTALL_NGSA" ]; then
+ # optional NGSA install
+ install_osm_ngsa_service
+ track deploy_osm install_osm_ngsa_ok
+ fi
}
function install_osm() {
[ -n "$APT_PROXY_URL" ] && configure_apt_proxy $APT_PROXY_URL
# if lxd is requested, we will install it
- if [ -n "$INSTALL_LXD" ]; then
- LXD_INSTALL_OPTS="-D ${OSM_DEVOPS} -i ${OSM_DEFAULT_IF} ${DEBUG_INSTALL}"
- [ -n "${OSM_BEHIND_PROXY}" ] && LXD_INSTALL_OPTS="${LXD_INSTALL_OPTS} -P"
- $OSM_DEVOPS/installers/install_lxd.sh ${LXD_INSTALL_OPTS} || FATAL_TRACK lxd "install_lxd.sh failed"
- fi
+ [ -n "$INSTALL_LXD" ] && install_lxd
track prereq prereqok_ok
if [ "${K8S_CLUSTER_ENGINE}" == "kubeadm" ]; then
echo "Kubeadm requires docker, so docker will be installed."
fi
- DOCKER_CE_OPTS="-D ${OSM_DEVOPS} ${DEBUG_INSTALL}"
- [ -n "${DOCKER_PROXY_URL}" ] && DOCKER_CE_OPTS="${DOCKER_CE_OPTS} -p ${DOCKER_PROXY_URL}"
- [ -n "${OSM_BEHIND_PROXY}" ] && DOCKER_CE_OPTS="${DOCKER_CE_OPTS} -P"
- $OSM_DEVOPS/installers/install_docker_ce.sh ${DOCKER_CE_OPTS} || FATAL_TRACK docker_ce "install_docker_ce.sh failed"
+ install_docker_ce
fi
track docker_ce docker_ce_ok
FATAL_TRACK k8scluster "install_helm_client.sh failed"
track helm_client install_helm_client_ok
- if [ "${K8S_CLUSTER_ENGINE}" == "kubeadm" ]; then
- KUBEADM_INSTALL_OPTS="-d ${OSM_WORK_DIR} -D ${OSM_DEVOPS} ${DEBUG_INSTALL}"
- $OSM_DEVOPS/installers/install_kubeadm_cluster.sh ${KUBEADM_INSTALL_OPTS} || \
- FATAL_TRACK k8scluster "install_kubeadm_cluster.sh failed"
- K8SCLUSTER_ADDONS_INSTALL_OPTS="-i ${OSM_DEFAULT_IP} -d ${OSM_WORK_DIR} -D ${OSM_DEVOPS} ${DEBUG_INSTALL}"
- $OSM_DEVOPS/installers/install_cluster_addons.sh ${K8SCLUSTER_ADDONS_INSTALL_OPTS} || \
- FATAL_TRACK k8scluster "install_cluster_addons.sh failed"
- fi
+ install_k8s_cluster
track k8scluster k8scluster_ok
if [ -n "${INSTALL_JUJU}" ]; then
fi
track juju juju_ok
- # Deploy OSM services
+ # This track is maintained for backwards compatibility
track docker_images docker_images_ok
- deploy_mongodb
- track deploy_osm deploy_mongodb_ok
- deploy_osm_services
- track deploy_osm deploy_osm_services_k8s_ok
+ # Deploy OSM (mongodb, OSM helm chart, NGSA)
+ deploy_osm
+
if [ -n "$INSTALL_K8S_MONITOR" ]; then
# install OSM MONITORING
install_k8s_monitoring
track deploy_osm install_k8s_monitoring_ok
fi
- if [ -n "$INSTALL_NGSA" ]; then
- # optional NGSA install
- install_osm_ngsa_service
- track deploy_osm install_osm_ngsa_ok
- fi
[ -z "$INSTALL_NOHOSTCLIENT" ] && install_osmclient
track osmclient osmclient_ok
else
# Community_installer
# Special cases go first
- [ -n "$INSTALL_ONLY" ] && [ -n "$INSTALL_K8S_MONITOR" ] && install_k8s_monitoring
- [ -n "$INSTALL_ONLY" ] && [ -n "$INSTALL_NGSA" ] && install_osm_ngsa_service
- [ -n "$INSTALL_ONLY" ] && echo -e "\nDONE" && exit 0
+ if [ -n "$INSTALL_ONLY" ]; then
+ [ -n "$INSTALL_K8S_MONITOR" ] && install_k8s_monitoring
+ [ -n "$INSTALL_NGSA" ] && install_osm_ngsa_service
+ echo -e "\nDONE" && exit 0
+ fi
# This is where installation starts
install_osm
echo -e "\nDONE"