Merge "Update quick start guide with current limitations"
authorAlexis de Talhouët <alexis.de_talhouet@bell.ca>
Mon, 26 Mar 2018 20:38:59 +0000 (20:38 +0000)
committerGerrit Code Review <gerrit@onap.org>
Mon, 26 Mar 2018 20:38:59 +0000 (20:38 +0000)
35 files changed:
kubernetes/Makefile
kubernetes/README.md
kubernetes/README_HELM [deleted file]
kubernetes/common/Makefile
kubernetes/common/dgbuilder/.helmignore [moved from kubernetes/dgbuilder/.helmignore with 100% similarity]
kubernetes/common/dgbuilder/Chart.yaml [moved from kubernetes/dgbuilder/Chart.yaml with 100% similarity]
kubernetes/common/dgbuilder/requirements.yaml [moved from kubernetes/dgbuilder/requirements.yaml with 100% similarity]
kubernetes/common/dgbuilder/resources/config/svclogic.properties [moved from kubernetes/dgbuilder/resources/config/svclogic.properties with 100% similarity]
kubernetes/common/dgbuilder/resources/scripts/createReleaseDir.sh [moved from kubernetes/dgbuilder/resources/scripts/createReleaseDir.sh with 100% similarity]
kubernetes/common/dgbuilder/resources/scripts/customSettings.js [moved from kubernetes/dgbuilder/resources/scripts/customSettings.js with 100% similarity]
kubernetes/common/dgbuilder/templates/NOTES.txt [moved from kubernetes/dgbuilder/templates/NOTES.txt with 100% similarity]
kubernetes/common/dgbuilder/templates/configmap.yaml [moved from kubernetes/dgbuilder/templates/configmap.yaml with 100% similarity]
kubernetes/common/dgbuilder/templates/deployment.yaml [moved from kubernetes/dgbuilder/templates/deployment.yaml with 100% similarity]
kubernetes/common/dgbuilder/templates/secrets.yaml [moved from kubernetes/dgbuilder/templates/secrets.yaml with 100% similarity]
kubernetes/common/dgbuilder/templates/service.yaml [moved from kubernetes/dgbuilder/templates/service.yaml with 100% similarity]
kubernetes/common/dgbuilder/values.yaml [moved from kubernetes/dgbuilder/values.yaml with 100% similarity]
kubernetes/common/mysql/.helmignore [moved from kubernetes/mysql/.helmignore with 100% similarity]
kubernetes/common/mysql/Chart.yaml [moved from kubernetes/mysql/Chart.yaml with 100% similarity]
kubernetes/common/mysql/requirements.yaml [moved from kubernetes/mysql/requirements.yaml with 100% similarity]
kubernetes/common/mysql/templates/configmap.yaml [moved from kubernetes/mysql/templates/configmap.yaml with 100% similarity]
kubernetes/common/mysql/templates/nfs-provisoner.yaml [moved from kubernetes/mysql/templates/nfs-provisoner.yaml with 100% similarity]
kubernetes/common/mysql/templates/pv.yaml [moved from kubernetes/mysql/templates/pv.yaml with 100% similarity]
kubernetes/common/mysql/templates/pvc.yaml [moved from kubernetes/mysql/templates/pvc.yaml with 100% similarity]
kubernetes/common/mysql/templates/secrets.yaml [moved from kubernetes/mysql/templates/secrets.yaml with 100% similarity]
kubernetes/common/mysql/templates/service.yaml [moved from kubernetes/mysql/templates/service.yaml with 100% similarity]
kubernetes/common/mysql/templates/statefulset.yaml [moved from kubernetes/mysql/templates/statefulset.yaml with 100% similarity]
kubernetes/common/mysql/templates/storageclass.yaml [moved from kubernetes/mysql/templates/storageclass.yaml with 100% similarity]
kubernetes/common/mysql/values.yaml [moved from kubernetes/mysql/values.yaml with 100% similarity]
kubernetes/multicloud/templates/multicloud-windriver-deployment.yaml
kubernetes/oneclick/createAll.bash [deleted file]
kubernetes/oneclick/deleteAll.bash [deleted file]
kubernetes/oneclick/setenv.bash [deleted file]
kubernetes/oneclick/tools/autoCleanConfig.bash [deleted file]
kubernetes/oneclick/tools/autoCreateConfig.bash [deleted file]
kubernetes/oneclick/tools/collectInfo.bash [deleted file]

index 9cbf90f..7ba5ba9 100644 (file)
@@ -1,26 +1,33 @@
+# Copyright © 2017 Amdocs, Bell Canada
+#
+# 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.
+
 PARENT_CHART := onap
 COMMON_CHARTS_DIR := common
-SETUP_CHARTS_DIR := setup
-#Order is important
-SHARED_CHARTS := common setup mysql dgbuilder
 # FIXME OOM-765
 ROOT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
 OUTPUT_DIR := $(ROOT_DIR)/dist
 PACKAGE_DIR := $(OUTPUT_DIR)/packages
 SECRET_DIR := $(OUTPUT_DIR)/secrets
 
-EXCLUDES := $(COMMON_CHARTS_DIR) config oneclick readiness test dist helm $(PARENT_CHART) dcae
-EXCLUDES := $(SHARED_CHARTS) config oneclick readiness test dist $(PARENT_CHART) dcae
+EXCLUDES := config oneclick readiness test dist helm $(PARENT_CHART) dcae
 HELM_CHARTS := $(filter-out $(EXCLUDES), $(patsubst %/.,%,$(wildcard */.))) $(PARENT_CHART)
 
 .PHONY: $(EXCLUDES) $(HELM_CHARTS)
 
 all: $(COMMON_CHARTS_DIR) $(HELM_CHARTS)
 
-common:
-all: $(SHARED_CHARTS) $(HELM_CHARTS)
-
-$(SHARED_CHARTS):
+$(COMMON_CHARTS):
        @echo "\n[$@]"
        @make package-$@
 
@@ -45,5 +52,12 @@ clean:
        @rm -f */requirements.lock
        @rm -f *tgz */charts/*tgz
        @rm -rf $(PACKAGE_DIR)
+
+# start up a local helm repo to serve up
+repo:
+       @mkdir -p $(PACKAGE_DIR)
+       @helm serve --repo-path $(PACKAGE_DIR) &
+       @helm repo index $(PACKAGE_DIR)
+       @helm repo add local http://127.0.0.1:8879
 %:
        @:
index dc49e54..9c315cb 100644 (file)
@@ -1,78 +1,87 @@
-## **Quick Start Guide - ONAP on Kubernetes**
+## **Quick Start Guide**
 
 
-This is a quick start guide to help you get started on ONAP installation. Creating an ONAP deployment instance requires creating base configuration on the host node and then deploying the runtime containers.
+This is a quick start guide describing how to deploy ONAP on Kubernetes using Helm.
 
 Pre-requisites:
 
 -  Your Kubernetes environment must be available. For more information see, [ONAP on Kubernetes](https://wiki.onap.org/display/DW/ONAP+on+Kubernetes).
 -  Deployment artifacts are customized for your location.
 
-Step 1
 
-Review and optionally change configuration parameters:
-
-Setup the [/oom/kubernetes/config/onap-parameters.yaml](https://gerrit.onap.org/r/gitweb?p=oom.git;a=blob;f=kubernetes/config/onap-parameters.yaml;h=7ddaf4d4c3dccf2fad515265f0da9c31ec0e64b1;hb=refs/heads/master) file with key-value pairs specific to your OpenStack environment.
-
-OR
-
-There is a [sample](https://gerrit.onap.org/r/gitweb?p=oom.git;a=blob;f=kubernetes/config/onap-parameters-sample.yaml;h=3a74beddbbf7f9f9ec8e5a6abaecb7cb238bd519;hb=refs/heads/master) that may help you out or even be usable directly if you don't intend to actually use OpenStack resources.
-
-
-Step 2
-
-In-order to be able to support multiple ONAP instances within a single kubernetes environment, a configuration set is required. To do this, execute the [createConfig.sh](https://gerrit.onap.org/r/gitweb?p=oom.git;a=blob;f=kubernetes/config/createConfig.sh;h=f226ccae47ca6de15c1da49be4b8b6de974895ed;hb=refs/heads/master) script:
-
-> oom/kubernetes/config/createConfig.sh -n onap
-
-Where:
-'onap' refers to the name of the instance. This serves as the Namespace prefix for each deployed ONAP component (for example, onap-mso).
-
-Step 3
-
-The bash script [createAll.bash](https://gerrit.onap.org/r/gitweb?p=oom.git;a=blob;f=kubernetes/oneclick/createAll.bash;h=5e5f2dc76ea7739452e757282e750638b4e3e1de;hb=refs/heads/master) is used to create an ONAP deployment with kubernetes. It has two primary functions:
-
--  Creating the namespaces used to encapsulate the ONAP components, and
--  Creating the services, pods and containers within each of these namespaces that provide the core functionality of ONAP.
-
-Before you execute the createAll.bash. script, pod config-init ([pod-config-init.yaml](https://gerrit.onap.org/r/gitweb?p=oom.git;a=blob;f=kubernetes/config/pod-config-init.yaml;h=b1285ce21d61815c082f6d6aa3c43d00561811c7;hb=refs/heads/master)) may need editing to match your environment and deployment into the default namespace.
-
-To deploy the containers and create your ONAP system, execute the following command:
-
-> oom/kubernetes/oneclick/createAll.bash -n onap
-
-#### **Additional information on usage of createAll.bash**
-
-Namespaces provide isolation between ONAP components as ONAP release 1.0 contains duplicate application (for example, mariadb) and port usage.
-
-As such createAll.bash requires the user to enter a namespace prefix string that can be used to separate multiple deployments of onap. The result will be set of 10 namespaces (for example, onap-sdc, onap-aai, onap-mso, onap-message-router, onap-robot, onap-vid, onap-sdnc, onap-portal, onap-policy, onap-appc) being created within the kubernetes environment.
-
-
-#### **Deploying multiple ONAP instances within the same Kubernetes cluster**
-
-To deploy multiple ONAP instances, you must specify the number of Instances you would like to create in a Kubernetes cluster using createAllbash.
-
-This is currently required due to the use of NodePort ranges. NodePorts allow external IP:Port access to containers that are running inside a Kubernetes cluster.
-
-To create multiple instances of an ONAP deployment in the cluster, use the following commands:
-
-> oom/kubernetes/config/createConfig.sh -n onap
-
-> oom/kubernetes/oneclick/createAll.bash -n onap -i 2
-
-Where:
-
--  'onap' refers to the name of the instance.
-
--  \91i 2\92 refers to the number of instances of an ONAP deployment in the cluster.
-
-#### **To delete a deployed instance**
+### **Deploy ONAP Instance**
+
+Step 1. Clone the OOM repository from ONAP gerrit:
+
+```
+> git clone http://gerrit.onap.org/r/oom
+> cd oom/kubernetes
+```
+
+Step 2. Customize the oom/kubernetes/onap parent chart, like the values.yaml file, to suit your deployment. You may want to selectively enable or disable ONAP components by changing the subchart **enabled** flags to *true* or *false*.
+```
+Example:
+...
+robot: # Robot Health Check
+  enabled: true
+sdc:
+  enabled: false
+sdnc:
+  enabled: false
+so: # Service Orchestrator
+  enabled: true
+...
+```
+
+Step 3. To setup a local Helm repository to serve up the local ONAP charts:
+```
+> helm serve &
+```
+Note the port number that is listed and use it in the Helm repo add as follows:
+```
+> helm repo add local http://127.0.0.1:8879
+```
+
+Step 4. Build a local Helm repository (from the kubernetes directory):
+```
+> make all
+```
+
+Step 5. Display the charts that are available to be deployed:
+```
+> helm search -l
+NAME                    VERSION    DESCRIPTION
+local/appc              2.0.0      Application Controller
+local/clamp             2.0.0      ONAP Clamp
+local/onap              2.0.0      Open Network Automation Platform (ONAP)
+local/robot             2.0.0      A helm Chart for kubernetes-ONAP Robot
+local/so                2.0.0      ONAP Service Orchestrator
+...
+```
+
+**Note:**
+Setup of this Helm repository is a one time activity. If you make changes to your deployment charts or values be sure to use **make** to update your local Helm repository.
+
+Step 6. Once the repo is setup, installation of ONAP can be done with a single command:
+```
+> helm install local/onap -name dev --namespace onap
+```
+**Note:** the **--namespace onap** is currently required while all onap helm charts are migrated to version 2.0. After this activity is complete, namespaces will be optional.
+
+Use the following to monitor your deployment and determine when ONAP is ready for use:
+```
+> kubectl get pods --all-namespaces -o=wide
+```
+
+
+#### **Cleanup deployed ONAP instance**
 
 To delete a deployed instance, use the following command:
+```
+> helm del dev --purge
+```
 
-> oom/kubernetes/oneclick/deleteAll.bash -n onap
 
-**Note:** Deleting the runtime containers does not remove the configuration created in step 2.
 
 For more information on OOM project documentation, refer to:
 
diff --git a/kubernetes/README_HELM b/kubernetes/README_HELM
deleted file mode 100644 (file)
index 0f65120..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-Prerequisites:
-- K8s
-- Helm
-
-In order to use Helm with Rancher, check the tiller version installed
-by running "helm version" on the rancher CLI
-and install the appropriate Helm.
-Notice both tiller and helm are installed,
-but you will need to install on your VM.
-
-charts were tested with the following setup:
-  Rancher Release v1.6.7
-  k8s version 1.7.2
-  Helm/Tiller version v2.3.0
-also tested on:
-  k8s version v1.5.2
-  Helm/Tiller v2.6.0
-
-Download Helm:
-https://github.com/kubernetes/helm
index b9cc125..a78cc88 100644 (file)
@@ -19,7 +19,7 @@ PACKAGE_DIR := $(OUTPUT_DIR)/packages
 SECRET_DIR := $(OUTPUT_DIR)/secrets
 
 EXCLUDES :=
-HELM_CHARTS := $(filter-out $(EXCLUDES), $(patsubst %/.,%,$(wildcard */.))) $(PARENT_CHART)
+HELM_CHARTS := $(filter-out $(EXCLUDES), $(patsubst %/.,%,$(wildcard */.)))
 
 .PHONY: $(EXCLUDES) $(HELM_CHARTS)
 
index 8d9ec35..c1b3858 100644 (file)
@@ -66,7 +66,7 @@ spec:
          timeoutSeconds: 10
          successThreshold: 1
          failureThreshold: 5
-    - image: {{ .Values.image.filebeat }}
+     - image: {{ .Values.image.filebeat }}
        imagePullPolicy: {{ .Values.pullPolicy }}
        name: filebeat-onap
        volumeMounts:
diff --git a/kubernetes/oneclick/createAll.bash b/kubernetes/oneclick/createAll.bash
deleted file mode 100755 (executable)
index ded7c39..0000000
+++ /dev/null
@@ -1,189 +0,0 @@
-#!/bin/bash
-
-. $(dirname "$0")/setenv.bash
-
-
-usage() {
-  cat <<EOF
-Usage: $0 [PARAMs]
--u                  : Display usage
--n [NAMESPACE]      : Kubernetes namespace (required)
--v [VALUES]         : HELM values filepath (usefull when deploying one component at a time)
--l [LOCATION]       : Location of oom project
--i [INSTANCE]       : ONAP deployment instance # (default: 1)
--a [APP]            : Specify a specific ONAP component (default: all)
-                      from the following choices:
-                      sdc, aai ,mso, message-router, robot, vid, aaf, uui
-                      sdnc, portal, policy, appc, multicloud, clamp, consul, vnfsdk
-EOF
-}
-
-check_return_code(){
-  ret=$?
-  if [ $ret -ne 0 ]; then
-    printf "The command $1 returned with error code $ret \n" 1>&2
-    exit $ret
-  fi
-}
-
-create_service_account() {
-  cmd=`echo kubectl create clusterrolebinding $1-admin-binding --clusterrole=cluster-admin --serviceaccount=$1:default`
-  eval ${cmd}
-  check_return_code $cmd
-}
-
-create_namespace() {
-  cmd=`echo kubectl create namespace $1`
-  eval ${cmd}
-}
-
-create_registry_key() {
-cmd=`echo kubectl --namespace $1 create secret docker-registry $2 --docker-server=$3 --docker-username=$4 --docker-password=$5 --docker-email=$6`
-  eval ${cmd}
-  check_return_code $cmd
-}
-
-configure_dcaegen2() {
-  if [ ! -s "$OPENSTACK_PRIVATE_KEY_PATH" ]
-  then
-    echo "ERROR: $OPENSTACK_PRIVATE_KEY_PATH does not exist or is empty.  Cannot launch dcae gen2."
-    return 1
-  fi
-
-  cmd=`echo kubectl --namespace $1-$2 create secret generic $2-openstack-ssh-private-key --from-file=key=${OPENSTACK_PRIVATE_KEY_PATH}`
-  eval ${cmd}
-  check_return_code $cmd
-
-  if [ ! -s "$DCAEGEN2_CONFIG_INPUT_FILE_PATH" ]
-  then
-    echo "ERROR: $DCAEGEN2_CONFIG_INPUT_FILE_PATH does not exist or is empty.  Cannot launch dcae gen2."
-    return 1
-  fi
-
-  cmd=`echo kubectl --namespace $1-$2 create configmap $2-config-inputs --from-file=inputs.yaml=${DCAEGEN2_CONFIG_INPUT_FILE_PATH}`
-  eval ${cmd}
-  check_return_code $cmd
-}
-
-create_onap_helm() {
-  HELM_VALUES_ADDITION=""
-  if [[ ! -z $HELM_VALUES_FILEPATH ]]; then
-    HELM_VALUES_ADDITION="--values=$HELM_VALUES_FILEPATH"
-  fi
-  # Have to put a check for dcaegen2 because it requires external files to helm
-  # which should not be part of the Chart.
-  if [ "$2" = "dcaegen2" ];
-  then
-    configure_dcaegen2 $1 $2
-    local result=$?
-    if [ $result -ne 0 ]
-    then
-      echo "ERROR: dcaegen2 failed to configure: Pre-requisites not met.  Skipping deploying it and continue"
-      return
-    fi
-  fi
-
-  cmd=`echo helm install $LOCATION/$2/ --name $1-$2 --namespace $1 --set nsPrefix=$1,nodePortPrefix=$3 ${HELM_VALUES_ADDITION}`
-  eval ${cmd}
-  check_return_code $cmd
-}
-
-#MAINs
-NS=
-HELM_VALUES_FILEPATH=""
-LOCATION="../"
-INCL_SVC=true
-APP=
-INSTANCE=1
-MAX_INSTANCE=5
-DU=$ONAP_DOCKER_USER
-DP=$ONAP_DOCKER_PASS
-
-SINGLE_COMPONENT=false
-
-while getopts ":n:u:s:i:a:du:dp:l:v:" PARAM; do
-  case $PARAM in
-    u)
-      usage
-      exit 1
-      ;;
-    n)
-      NS=${OPTARG}
-      ;;
-    v)
-      HELM_VALUES_FILEPATH=${OPTARG}
-      ;;
-    i)
-      INSTANCE=${OPTARG}
-      ;;
-    l)
-      LOCATION=${OPTARG}
-      ;;
-    a)
-      SINGLE_COMPONENT=true
-      APP=${OPTARG}
-      if [[ -z $APP ]]; then
-        usage
-        exit 1
-      fi
-      ;;
-    du)
-      DU=${OPTARG}
-      ;;
-    dp)
-      DP=${OPTARG}
-      ;;
-    ?)
-      usage
-      exit
-      ;;
-  esac
-done
-
-if [[ -z $NS ]]; then
-  usage
-  exit 1
-fi
-
-if [[ ! -z "$APP" ]]; then
-  HELM_APPS=($APP)
-fi
-
-
-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"
-
-
-printf "\n********** Creating ONAP: ${ONAP_APPS[*]}\n"
-
-if [ "$SINGLE_COMPONENT" == "false" ]
-then
-    printf "\nCreating namespace **********\n"
-    create_namespace $NS
-
-    printf "\nCreating registry secret **********\n"
-    create_registry_key $NS ${NS}-docker-registry-key $ONAP_DOCKER_REGISTRY $DU $DP $ONAP_DOCKER_MAIL
-
-    printf "\nCreating service account **********\n"
-    create_service_account $NS
-fi
-
-printf "\n\n********** Creating deployments for ${HELM_APPS[*]} ********** \n"
-
-for i in ${HELM_APPS[@]}; do
-
-  printf "\nCreating deployments and services **********\n"
-  create_onap_helm $NS $i $start
-
-  printf "\n"
-done
-
-printf "\n**** Done ****\n"
diff --git a/kubernetes/oneclick/deleteAll.bash b/kubernetes/oneclick/deleteAll.bash
deleted file mode 100755 (executable)
index 9833af7..0000000
+++ /dev/null
@@ -1,150 +0,0 @@
-#!/bin/bash
-
-. $(dirname "$0")/setenv.bash
-
-delete_namespace() {
-  kubectl delete namespace $1
-}
-
-delete_service_account() {
-    kubectl delete clusterrolebinding $1-admin-binding
-}
-
-delete_registry_key() {
-  kubectl --namespace $1 delete secret ${1}-docker-registry-key
-}
-
-delete_app_helm() {
-  helm delete $1-$2 --purge
-}
-
-wait_terminate() {
-  printf "Waiting for namespaces termination...\n"
-  while true; do
-    declare -i _STATUS=0
-    for i in ${HELM_APPS[@]}; do
-      kubectl get pods --namespace $1 | grep -w " $i" > /dev/null 2>&1
-      if [ "$?" -ne "0" ]; then
-        _STATUS=1
-        break
-      fi
-    done
-
-    if [ "$SINGLE_COMPONENT" == "false" ]; then
-      kubectl get namespaces $1 > /dev/null 2>&1
-      _STATUS=$?
-    fi
-    if [ "$_STATUS" -ne "0" ]; then
-      break
-    fi
-    sleep 2
-  done
-}
-
-usage() {
-  cat <<EOF
-Usage: $0 [PARAMs]
--u                  : Display usage
--n [NAMESPACE]      : Kubernetes namespace (required)
--c                  : kubectl context (default: current context)
--y                  : Skip interactive confirmation (default: no)
--a [APP]            : Specify a specific ONAP component (default: all)
-                      from the following choices:
-                      sdc, aai ,mso, message-router, robot, vid, aaf, uui
-                      sdnc, portal, policy, appc, multicloud, clamp, consul, vnfsdk
--N                  : Do not wait for deletion of namespace and its objects
-EOF
-}
-
-#MAINs
-NS=
-INCL_SVC=false
-APP=
-WAIT_TERMINATE=true
-SKIP_INTERACTIVE_CONFIRMATION=no
-KUBECTL_CONTEXT=
-SINGLE_COMPONENT=false
-while getopts ":c:n:u:s:a:yN" PARAM; do
-  case $PARAM in
-    u)
-      usage
-      exit 1
-      ;;
-    n)
-      NS=${OPTARG}
-      ;;
-    a)
-      APP=${OPTARG}
-      if [[ -z $APP ]]; then
-        usage
-        exit 1
-      fi
-      SINGLE_COMPONENT=true
-      ;;
-    N)
-      WAIT_TERMINATE=false
-      ;;
-    y)
-      SKIP_INTERACTIVE_CONFIRMATION=yes
-      ;;
-    c)
-      KUBECTL_CONTEXT=${OPTARG}
-      ;;
-    ?)
-      usage
-      exit
-      ;;
-  esac
-done
-
-if [[ -z $NS ]]; then
-  usage
-  exit 1
-fi
-
-if [[ "$SKIP_INTERACTIVE_CONFIRMATION" != yes ]]; then
-  current_kubectl_context=$(kubectl config get-contexts |grep "*" |awk '{print $2}')
-  if test "$KUBECTL_CONTEXT" != "$current_kubectl_context"; then
-    printf "Current kubectl context does not match context specified:\x1b[31m $current_kubectl_context\x1b[0m\n"
-    if [ ! -z "$KUBECTL_CONTEXT" -a "$KUBECTL_CONTEXT" != " " ]; then
-      read -p "Do you wish to switch context to $KUBECTL_CONTEXT and continue?" yn
-      case $yn in
-        [Yy]* ) kubectl config use-context $KUBECTL_CONTEXT;;
-        * ) printf "Skipping delete...\n"; exit;;
-      esac
-    else
-      printf "You are about to delete deployment from:\x1b[31m $current_kubectl_context\x1b[0m\n"
-      read -p "To continue enter context name: " response
-
-      if test "$response" != "$current_kubectl_context"
-      then
-        printf "Your response does not match current context! Skipping delete ...\n"
-        exit 1
-      fi
-    fi
-  fi
-fi
-
-if [[ ! -z "$APP" ]]; then
-  HELM_APPS=($APP)
-fi
-
-printf "\n********** Cleaning up ONAP: ${ONAP_APPS[*]}\n"
-
-for i in ${HELM_APPS[@]}; do
-  delete_app_helm $NS $i
-done
-
-if [ "$SINGLE_COMPONENT" == "false" ]
-then
-    delete_app_helm $NS "config"
-    delete_namespace $NS
-    delete_registry_key $NS
-    delete_service_account $NS
-fi
-
-if $WAIT_TERMINATE; then
-  wait_terminate $NS
-fi
-
-printf "\n********** Gone **********\n"
diff --git a/kubernetes/oneclick/setenv.bash b/kubernetes/oneclick/setenv.bash
deleted file mode 100644 (file)
index 716b76c..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/bash
-
-# Deploying MSB first so the started ONAP services can be registered to MSB
-HELM_APPS=('consul' 'msb' 'mso' 'message-router' 'sdnc' 'vid' 'robot' 'portal' 'policy' 'aai' 'sdc' 'dcaegen2' 'log' 'cli' 'multicloud' 'clamp' 'vnfsdk' 'uui' 'aaf' 'vfc' 'esr')
-ONAP_DOCKER_REGISTRY=${ONAP_DOCKER_REGISTRY:-nexus3.onap.org:10001}
-ONAP_DOCKER_USER=${ONAP_DOCKER_USER:-docker}
-ONAP_DOCKER_PASS=${ONAP_DOCKER_PASS:-docker}
-ONAP_DOCKER_MAIL=${ONAP_DOCKER_MAIL:-$USERNAME@$USERDOMAIN}
-# Openstack key pair private key file location required to enable dcaegen2 installer CRUD operations in your Openstack
-# Ensure you set the name of your keypair in the dcae-parameters.yaml entry "keypair: "dcae-g2"
-# example: export OPENSTACK_PRIVATE_KEY_PATH=/home/user/Downloads/dcae-g2.pem
-OPENSTACK_PRIVATE_KEY_PATH=${OPENSTACK_PRIVATE_KEY_PATH:-~/.ssh/onap_rsa}
-# dcaegen2 bootstrap configuration input yaml file.  Start from the sample, and set your environments real values:
-# example: export DCAEGEN2_CONFIG_INPUT_FILE_PATH=/tmp/dcae-parameters.yaml
-DCAEGEN2_CONFIG_INPUT_FILE_PATH=${DCAEGEN2_CONFIG_INPUT_FILE_PATH:-../dcaegen2/dcae-parameters-sample.yaml}
diff --git a/kubernetes/oneclick/tools/autoCleanConfig.bash b/kubernetes/oneclick/tools/autoCleanConfig.bash
deleted file mode 100644 (file)
index e274e0d..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-########################################################################################
-# This script wraps {$OOM}/kubernetes/oneclick/deleteAll.sh script along with          #
-# the following steps to clean up ONAP configure for specified namespace:              #
-#     - remove namespace                                                               #
-#     - remove release                                                                 #
-#     - remove shared directory                                                        #
-#                                                                                      #
-# To run it, just enter the following command:                                         #
-#    ./autoCleanConfig.bash <namespace, default is "onap">                             #
-########################################################################################
-#!/bin/bash
-
-
-NS=$1
-if [[ -z $NS ]]
-then
-  echo "Namespace is not specified, use onap namespace."
-  NS="onap"
-fi
-
-echo "Clean up $NS configuration"
-cd ..
-./deleteAll.bash -n $NS -y
-cd -
-
-echo "----------------------------------------------
-Force remove namespace..."
-kubectl delete namespace $NS
-echo "...done : kubectl get namespace
------------------------------------------------
->>>>>>>>>>>>>> k8s namespace"
-kubectl get namespace
-while [[ ! -z `kubectl get namespace|grep $NS` ]]
-do
-  echo "Wait for namespace $NS to be deleted
------------------------------------------------
->>>>>>>>>>>>>> k8s namespace"
-  kubectl get namespace
-  sleep 2
-done
-
-echo "Force delete helm process ..."
-helm delete $NS-config --purge --debug
-echo "...done : helm ls --all
- -----------------------------------------------
->>>>>>>>>>>>>> helm"
-helm ls --all
-
-echo "Remove $NS dockerdata..."
-sudo rm -rf /dockerdata-nfs/onap
-echo "...done : ls -altr /dockerdata-nfs
- -----------------------------------------------
->>>>>>>>>>>>>> /dockerdata-nfs directory"
-ls -altr /dockerdata-nfs
diff --git a/kubernetes/oneclick/tools/autoCreateConfig.bash b/kubernetes/oneclick/tools/autoCreateConfig.bash
deleted file mode 100644 (file)
index 99ea03e..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-########################################################################################
-# This script wraps {$OOM}/kubernetes/config/createConfig.sh script                    #
-# and will only terminated when the configuration is Completed or failed               #
-#                                                                                      #
-# To run it, just enter the following command:                                         #
-#    ./autoCreateConfig.bash <namespace, default is "onap">                            #
-########################################################################################
-#!/bin/bash
-
-
-NS=$1
-if [[ -z $NS ]]
-then
-  echo "Namespace is not specified, use onap namespace."
-  NS="onap"
-fi
-
-echo "Create $NS config under config directory..."
-cd ../../config
-./createConfig.sh -n $NS
-cd -
-
-
-echo "...done : kubectl get namespace
------------------------------------------------
->>>>>>>>>>>>>> k8s namespace"
-kubectl get namespace
-
-
-echo "
------------------------------------------------
->>>>>>>>>>>>>> helm : helm ls --all"
-helm ls --all
-
-
-echo "
------------------------------------------------
->>>>>>>>>>>>>> pod : kubectl get pods -n $NS -a"
-kubectl get pods -n $NS -a
-
-
-while true
-do
-  echo "wait for $NS config pod reach to Completed STATUS"
-  sleep 5
-  echo "-----------------------------------------------"
-  kubectl get pods -n $NS -a
-
-  status=`kubectl get pods -n $NS -a |grep config |xargs echo | cut -d' ' -f3`
-
-  if [ "$status" = "Completed" ]
-  then
-    echo "$NS config is Completed!!!"
-    break
-  fi
-
-  if [ "$status" = "Error" ]
-  then
-    echo "
-$NS config is failed with Error!!!
-Logs are:"
-    kubectl logs config -n $NS -f
-    break
-  fi
-done
diff --git a/kubernetes/oneclick/tools/collectInfo.bash b/kubernetes/oneclick/tools/collectInfo.bash
deleted file mode 100644 (file)
index 734c5a6..0000000
+++ /dev/null
@@ -1,171 +0,0 @@
-#!/bin/bash
-
-NS=
-OUT_NAME=onap_info_$(date +%y.%m.%d_%H.%M.%S.%N)
-OUT_FILE=
-OUT_DIR=$(dirname "$0")
-TMP_DIR=$(dirname $(mktemp -u))
-CONTAINER_LOGS_PATH=/var/log/onap
-CP_CONTAINER_LOGS=false
-
-if [ ! -z "$DEBUG" ]; then
-  set -x
-fi
-
-usage() {
-  cat <<EOF
-Utility script collecting various information about ONAP deployment on kubernetes.
-
-Usage: $0 [PARAMs]
--u                  : Display usage
--n [NAMESPACE]      : Kubernetes namespace (required)
--a [APP]            : Specify a specific ONAP component (default: all)
--d [OUT_DIR]        : Specify output folder for the collected info pack file
-                      (default: current dir)
--f [OUT_FILE]       : Specify output file for the collected info
-                      (default: file name with timestamp)
--c                  : Collect log files from containers, from path ${CONTAINER_LOGS_PATH}
-EOF
-}
-
-call_with_log() {
-  local _cmd=$1
-  local _log=$2
-  # Make sure otput dir exists
-  mkdir -p "$(dirname "$_log")"
-  printf "Command: ${_cmd}\n" >> ${_log}
-  printf "================================================================================\n" >> ${_log}
-  eval "${_cmd}" >> ${_log} 2>&1
-  printf "================================================================================\n" >> ${_log}
-}
-
-collect_pod_info() {
-  local _ns=$1
-  local _id=$2
-  local _log_dir=$3
-  local _cp_logs=$4
-  declare -i _i=0
-  kubectl -n $_ns get pods $_id -o=jsonpath='{range .spec.containers[*]}{.name}{"\n"}{end}' | while read c; do
-    call_with_log "kubectl -n $_ns logs $_id -c $c" "$_log_dir/$_id-$c.log"
-    if [ "$_i" -eq "0" ] && [ "$_cp_logs" == "true" ]; then
-      # copy logs from 1st container only as logs dir is shared between the containers
-      local _cmd="kubectl cp $_ns/$_id:${CONTAINER_LOGS_PATH} $_log_dir/$_id-$c -c $c"
-      if [ -z "$DEBUG" ]; then
-        _cmd+=" > /dev/null 2>&1"
-      fi
-      eval "${_cmd}"
-    fi
-    ((_i++))
-  done
-}
-
-collect_ns_info() {
-  local _ns=$1
-  local _log_dir=$2/$_ns
-  call_with_log "kubectl -n $NS-$i get services -o=wide" "$_log_dir/list_services.log"
-  kubectl -n "$_ns" get services | while read i; do
-    local _id=`echo -n $i | tr -s ' ' | cut -d' ' -n -f1`
-    if [ "$_id" == "NAME" ]; then
-      continue
-    fi
-    call_with_log "kubectl -n $_ns describe services $_id" "$_log_dir/describe_services/$_id.log"
-  done
-  call_with_log "kubectl -n $NS-$i get pods -o=wide" "$_log_dir/list_pods.log"
-  kubectl -n "$_ns" get pods | while read i; do
-    local _id=`echo -n $i | tr -s ' ' | cut -d' ' -n -f1`
-    if [ "$_id" == "NAME" ]; then
-      continue
-    fi
-    call_with_log "kubectl -n $_ns describe pods $_id" "$_log_dir/describe_pods/$_id.log"
-    collect_pod_info "$_ns" "$_id" "$_log_dir/logs" "${CP_CONTAINER_LOGS}"
-  done
-}
-
-while getopts ":un:a:d:f:c" PARAM; do
-  case $PARAM in
-    u)
-      usage
-      exit 1
-      ;;
-    n)
-      NS=${OPTARG}
-      ;;
-    a)
-      APP=${OPTARG}
-      if [[ -z $APP ]]; then
-        usage
-        exit 1
-      fi
-      ;;
-    d)
-      OUT_DIR=${OPTARG}
-      if [[ -z $OUT_DIR ]]; then
-        usage
-        exit 1
-      fi
-      ;;
-    f)
-      OUT_FILE=${OPTARG}
-      if [[ -z $OUT_FILE ]]; then
-        usage
-        exit 1
-      fi
-      ;;
-    c)
-      CP_CONTAINER_LOGS=true
-      ;;
-    ?)
-      usage
-      exit
-      ;;
-  esac
-done
-
-if [ -z "$NS" ]; then
-  usage
-  exit 1
-fi
-
-if [[ -z $OUT_FILE ]]; then
-  OUT_FILE=$OUT_NAME.tgz
-fi
-
-if [ ! -z "$APP" ]; then
-  _APPS=($APP)
-else
-  _APPS=(`kubectl get namespaces | grep "^$NS-" | tr -s ' ' | cut -d' ' -n -f1 | sed -e "s/^$NS-//"`)
-fi
-
-printf "Collecting information about ONAP deployment...\n"
-printf "Components: %s\n" "${_APPS[*]}"
-
-# Collect common info
-mkdir -p ${TMP_DIR}/${OUT_NAME}/
-echo "${_APPS[*]}" > ${TMP_DIR}/${OUT_NAME}/component-list.log
-printf "Collecting Helm info\n"
-call_with_log "helm version" "${TMP_DIR}/${OUT_NAME}/helm-version.log"
-call_with_log "helm list" "${TMP_DIR}/${OUT_NAME}/helm-list.log"
-
-printf "Collecting Kubernetes info\n"
-call_with_log "kubectl version" "${TMP_DIR}/${OUT_NAME}/k8s-version.log"
-call_with_log "kubectl get nodes -o=wide" "${TMP_DIR}/${OUT_NAME}/k8s-nodes.log"
-call_with_log "kubectl cluster-info" "${TMP_DIR}/${OUT_NAME}/k8s-cluster-info.log"
-call_with_log "kubectl cluster-info dump" "${TMP_DIR}/${OUT_NAME}/k8s-cluster-info-dump.log"
-call_with_log "kubectl top node" "${TMP_DIR}/${OUT_NAME}/k8s-top-node.log"
-
-# Collect per-component info
-for i in ${_APPS[@]}; do
-  printf "Writing Kubernetes info of component $i\n"
-  collect_ns_info "$NS-$i" "${TMP_DIR}/${OUT_NAME}"
-done
-
-# Pack and cleanup
-mkdir -p ${OUT_DIR}
-_OUT_DIR=`readlink -e ${OUT_DIR}`
-printf "Packing output to ${_OUT_DIR}/${OUT_FILE}...\n"
-cd ${TMP_DIR}
-tar cfz ${_OUT_DIR}/${OUT_FILE} ${OUT_NAME}
-cd -
-printf "Cleaning up...\n"
-rm -rf ${TMP_DIR}/${OUT_NAME}
-printf "Done\n"