Clean installer references to OSM_DOCKER_WORK_DIR 90/13490/2
authorgarciadeblas <gerardo.garciadeblas@telefonica.com>
Thu, 1 Jun 2023 12:20:03 +0000 (14:20 +0200)
committergarciadeblas <gerardo.garciadeblas@telefonica.com>
Thu, 1 Jun 2023 16:14:10 +0000 (18:14 +0200)
Change-Id: I54cdbb8c2ebb75d1dc1c939bd1c8682b2e9980b8
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
installers/docker/cluster-config.yaml [deleted file]
installers/full_install_osm.sh
installers/install_kubeadm_cluster.sh
installers/kubeadm-config.yaml [new file with mode: 0644]

diff --git a/installers/docker/cluster-config.yaml b/installers/docker/cluster-config.yaml
deleted file mode 100644 (file)
index 3abec44..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-# Copyright 2019 TATA ELXSI
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#    http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-# implied.
-# See the License for the specific language governing permissions and
-# limitations under the License
-# Author: Vijay Nag B S (vijaynag.bs@tataelxsi.co.in)
-
-apiVersion: kubeadm.k8s.io/v1beta3
-kind: ClusterConfiguration
-networking:
-  podSubnet: 10.244.0.0/16
-apiServer:
-  extraArgs:
-    service-node-port-range: "80-32767"
index 23d8f07..f3d8923 100755 (executable)
@@ -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
index 0ec2a31..0459bed 100755 (executable)
@@ -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/kubeadm-config.yaml b/installers/kubeadm-config.yaml
new file mode 100644 (file)
index 0000000..3abec44
--- /dev/null
@@ -0,0 +1,23 @@
+# Copyright 2019 TATA ELXSI
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied.
+# See the License for the specific language governing permissions and
+# limitations under the License
+# Author: Vijay Nag B S (vijaynag.bs@tataelxsi.co.in)
+
+apiVersion: kubeadm.k8s.io/v1beta3
+kind: ClusterConfiguration
+networking:
+  podSubnet: 10.244.0.0/16
+apiServer:
+  extraArgs:
+    service-node-port-range: "80-32767"