sdc K8S-Helm Parameterization
[oom.git] / kubernetes / oneclick / createAll.bash
index 7e29697..95dd809 100755 (executable)
@@ -8,7 +8,6 @@ usage() {
 Usage: $0 [PARAMs]
 -u                  : Display usage
 -n [NAMESPACE]      : Kubernetes namespace (required)
--s false            : Exclude services (default: true)
 -i [INSTANCE]       : ONAP deployment instance # (default: 1)
 -a [APP]            : Specify a specific ONAP component (default: all)
                       from the following choices:
@@ -25,14 +24,6 @@ create_registry_key() {
   kubectl --namespace $1-$2 create secret docker-registry $3 --docker-server=$4 --docker-username=$5 --docker-password=$6 --docker-email=$7
 }
 
-create_service() {
-  sed -i-- 's/nodePort: [0-9]\{2\}[02468]\{1\}/nodePort: '"$3"'/g' ../$2/all-services.yaml
-  sed -i-- 's/nodePort: [0-9]\{2\}[13579]\{1\}/nodePort: '"$4"'/g' ../$2/all-services.yaml
-  kubectl --namespace $1-$2 create -f ../$2/all-services.yaml
-  mv ../$2/all-services.yaml-- ../$2/all-services.yaml
-}
-
-
 create_onap_helm() {
   helm install ../$2/ --name $2
 }
@@ -84,9 +75,6 @@ while getopts ":n:u:s:i:a:du:dp:" PARAM; do
     n)
       NS=${OPTARG}
       ;;
-    s)
-      INCL_SVC=${OPTARG}
-      ;;
     i)
       INSTANCE=${OPTARG}
       ;;
@@ -116,46 +104,26 @@ if [[ -z $NS ]]; then
 fi
 
 if [[ ! -z "$APP" ]]; then
-  ONAP_APPS=($APP)
+  HELM_APPS=($APP)
 fi
 
-if [[ "$INCL_SVC" == true ]]; then
-
-  if [ "$INSTANCE" -gt "$MAX_INSTANCE" ];then
-    printf "\n********** You choose to create ${INSTANCE}th instance of ONAP \n"
-    printf "\n********** Due to port allocation only ${MAX_INSTANCE} instances of ONAP is allowed per kubernetes deployment\n"
-    exit 1
-  fi
-
-  start=$((300+2*INSTANCE))
-  end=$((start+1))
-  printf "\n********** Creating instance ${INSTANCE} of ONAP with port range ${start}00 and ${end}99\n"
 
+if [ "$INSTANCE" -gt "$MAX_INSTANCE" ];then
+  printf "\n********** You choose to create ${INSTANCE}th instance of ONAP \n"
+  printf "\n********** Due to port allocation only ${MAX_INSTANCE} instances of ONAP is allowed per kubernetes deployment\n"
+  exit 1
 fi
 
-printf "\n********** Creating ONAP: ${ONAP_APPS[*]}\n"
+start=$((300+2*INSTANCE))
+end=$((start+1))
 
-for i in ${ONAP_APPS[@]}; do
-  printf "\nCreating namespace **********\n"
-  create_namespace $NS $i
+printf "\n********** Creating instance ${INSTANCE} of ONAP with port range ${start}00 and ${end}99\n"
 
-  printf "\nCreating registry secret **********\n"
-  create_registry_key $NS $i $ONAP_DOCKER_REGISTRY_KEY $ONAP_DOCKER_REGISTRY $DU $DP $ONAP_DOCKER_MAIL
 
-  if [[ "$INCL_SVC" == true ]]; then
-    printf "\nCreating service **********\n"
-    create_service $NS $i $start $end
-  fi
+printf "\n********** Creating ONAP: ${ONAP_APPS[*]}\n"
 
-  printf "\n"
-done
 
-printf "\n\n********** Creating deployments for ${ONAP_APPS[*]} ********** \n"
-for i in ${ONAP_APPS[@]}; do
-  _FILES_PATH=$(echo ../$i)
-  configure_app $NS $i $_FILES_PATH $start $end
-  /bin/bash $i.sh $NS $i 'create'
-done
+printf "\n\n********** Creating deployments for ${HELM_APPS[*]} ********** \n"
 
 for i in ${HELM_APPS[@]}; do
   printf "\nCreating namespace **********\n"