From 2e1c9f81d3cfc11f238156ad176471991eab3d90 Mon Sep 17 00:00:00 2001 From: garciadeblas Date: Thu, 1 Jun 2023 14:20:03 +0200 Subject: [PATCH] Clean installer references to OSM_DOCKER_WORK_DIR Change-Id: I54cdbb8c2ebb75d1dc1c939bd1c8682b2e9980b8 Signed-off-by: garciadeblas --- installers/full_install_osm.sh | 20 ++++--------------- installers/install_kubeadm_cluster.sh | 12 +++++------ ...luster-config.yaml => kubeadm-config.yaml} | 0 3 files changed, 10 insertions(+), 22 deletions(-) rename installers/{docker/cluster-config.yaml => kubeadm-config.yaml} (100%) diff --git a/installers/full_install_osm.sh b/installers/full_install_osm.sh index 23d8f078..f3d89230 100755 --- a/installers/full_install_osm.sh +++ b/installers/full_install_osm.sh @@ -357,13 +357,6 @@ function deploy_charmed_services() { [ -z "${DEBUG_INSTALL}" ] || DEBUG end of function } -function deploy_osm_pla_service() { - [ -z "${DEBUG_INSTALL}" ] || DEBUG beginning of function - # corresponding to deploy_osm_services - kubectl apply -n $OSM_NAMESPACE -f $OSM_DOCKER_WORK_DIR/osm_pla - [ -z "${DEBUG_INSTALL}" ] || DEBUG end of function -} - function install_osm_ngsa_service() { [ -z "${DEBUG_INSTALL}" ] || DEBUG beginning of function NGSA_OPTS="-d ${OSM_HELM_WORK_DIR} -D ${OSM_DEVOPS} -t ${OSM_DOCKER_TAG} -U ${DOCKER_USER} ${DEBUG_INSTALL}" @@ -538,11 +531,10 @@ function install_osm() { track docker_ce docker_ce_ok echo "Creating folders for installation" - [ ! -d "$OSM_DOCKER_WORK_DIR" ] && sudo mkdir -p $OSM_DOCKER_WORK_DIR - [ ! -d "$OSM_DOCKER_WORK_DIR/osm_pla" -a -n "$INSTALL_PLA" ] && sudo mkdir -p $OSM_DOCKER_WORK_DIR/osm_pla - sudo cp -b $OSM_DEVOPS/installers/docker/cluster-config.yaml $OSM_DOCKER_WORK_DIR/cluster-config.yaml + [ ! -d "$OSM_WORK_DIR" ] && sudo mkdir -p $OSM_WORK_DIR + sudo cp -b $OSM_DEVOPS/installers/kubeadm-config.yaml $OSM_WORK_DIR/kubeadm-config.yaml - $OSM_DEVOPS/installers/install_kubeadm_cluster.sh -i ${OSM_DEFAULT_IP} -d ${OSM_DOCKER_WORK_DIR} -D ${OSM_DEVOPS} ${DEBUG_INSTALL} || \ + $OSM_DEVOPS/installers/install_kubeadm_cluster.sh -i ${OSM_DEFAULT_IP} -d ${OSM_WORK_DIR} -D ${OSM_DEVOPS} ${DEBUG_INSTALL} || \ FATAL_TRACK k8scluster "install_kubeadm_cluster.sh failed" track k8scluster k8scluster_ok @@ -698,9 +690,7 @@ function dump_vars(){ echo "OPENSTACK_VM_NAME"="$OPENSTACK_VM_NAME" echo "OSM_DEVOPS=$OSM_DEVOPS" echo "OSM_DOCKER_TAG=$OSM_DOCKER_TAG" - echo "OSM_DOCKER_WORK_DIR=$OSM_DOCKER_WORK_DIR" echo "OSM_HELM_WORK_DIR=$OSM_HELM_WORK_DIR" - echo "OSM_K8S_WORK_DIR=$OSM_K8S_WORK_DIR" echo "OSM_NAMESPACE=$OSM_NAMESPACE" echo "OSM_VCA_HOST=$OSM_VCA_HOST" echo "OSM_VCA_PUBKEY=$OSM_VCA_PUBKEY" @@ -784,8 +774,6 @@ DOCKER_NOBUILD="" REPOSITORY_KEY="OSM%20ETSI%20Release%20Key.gpg" REPOSITORY_BASE="https://osm-download.etsi.org/repository/osm/debian" OSM_WORK_DIR="/etc/osm" -OSM_DOCKER_WORK_DIR="${OSM_WORK_DIR}/docker" -OSM_K8S_WORK_DIR="${OSM_DOCKER_WORK_DIR}/osm_pods" OSM_HELM_WORK_DIR="${OSM_WORK_DIR}/helm" OSM_HOST_VOL="/var/lib/osm" OSM_NAMESPACE_VOL="${OSM_HOST_VOL}/${OSM_NAMESPACE}" @@ -1023,7 +1011,7 @@ fi [ -n "$TO_REBUILD" ] && [ "$TO_REBUILD" == " PLA" ] && [ -z "$INSTALL_PLA" ] && FATAL "Incompatible option: -m PLA cannot be used without --pla option" # if develop, we force master [ -z "$COMMIT_ID" ] && [ -n "$DEVELOP" ] && COMMIT_ID="master" -OSM_K8S_WORK_DIR="$OSM_DOCKER_WORK_DIR/osm_pods" && OSM_NAMESPACE_VOL="${OSM_HOST_VOL}/${OSM_NAMESPACE}" +OSM_NAMESPACE_VOL="${OSM_HOST_VOL}/${OSM_NAMESPACE}" [ -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 diff --git a/installers/install_kubeadm_cluster.sh b/installers/install_kubeadm_cluster.sh index 0ec2a313..0459bed5 100755 --- a/installers/install_kubeadm_cluster.sh +++ b/installers/install_kubeadm_cluster.sh @@ -55,7 +55,7 @@ function init_kubeadm() { [ -z "${DEBUG_INSTALL}" ] || DEBUG beginning of function sudo swapoff -a sudo sed -i.bak '/.*none.*swap/s/^\(.*\)$/#\1/g' /etc/fstab - sudo kubeadm init --dry-run || FATAL_TRACK k8scluster "kubeadm init dry-run failed" + sudo kubeadm init --config $1 --dry-run || FATAL_TRACK k8scluster "kubeadm init dry-run failed" sudo kubeadm init --config $1 sleep 5 [ -z "${DEBUG_INSTALL}" ] || DEBUG end of function @@ -177,10 +177,10 @@ function install_helm_metallb() { - name: default protocol: layer2 addresses: - - $METALLB_IP_RANGE" | sudo tee -a ${OSM_DOCKER_WORK_DIR}/metallb-config.yaml + - $METALLB_IP_RANGE" | sudo tee -a ${OSM_CLUSTER_WORK_DIR}/metallb-config.yaml helm repo add metallb https://metallb.github.io/metallb helm repo update - helm install --create-namespace --namespace metallb-system metallb metallb/metallb --version ${METALLB_VERSION} -f ${OSM_DOCKER_WORK_DIR}/metallb-config.yaml + helm install --create-namespace --namespace metallb-system metallb metallb/metallb --version ${METALLB_VERSION} -f ${OSM_CLUSTER_WORK_DIR}/metallb-config.yaml [ -z "${DEBUG_INSTALL}" ] || DEBUG end of function } @@ -311,7 +311,7 @@ while getopts ":D:d:i:-: " o; do DEFAULT_IP="${OPTARG}" ;; d) - OSM_DOCKER_WORK_DIR="${OPTARG}" + OSM_CLUSTER_WORK_DIR="${OPTARG}" ;; D) OSM_DEVOPS="${OPTARG}" @@ -341,7 +341,7 @@ source $OSM_DEVOPS/common/track echo "DEBUG_INSTALL=$DEBUG_INSTALL" echo "DEFAULT_IP=$DEFAULT_IP" echo "OSM_DEVOPS=$OSM_DEVOPS" -echo "OSM_DOCKER_WORK_DIR=$OSM_DOCKER_WORK_DIR" +echo "OSM_CLUSTER_WORK_DIR=$OSM_CLUSTER_WORK_DIR" echo "INSTALL_K8S_MONITOR=$INSTALL_K8S_MONITOR" echo "HOME=$HOME" @@ -349,7 +349,7 @@ echo "HOME=$HOME" install_kube check_and_track_kube_install -init_kubeadm $OSM_DOCKER_WORK_DIR/cluster-config.yaml +init_kubeadm $OSM_CLUSTER_WORK_DIR/kubeadm-config.yaml kube_config_dir check_and_track_init_k8s diff --git a/installers/docker/cluster-config.yaml b/installers/kubeadm-config.yaml similarity index 100% rename from installers/docker/cluster-config.yaml rename to installers/kubeadm-config.yaml -- 2.25.1