diff options
Diffstat (limited to 'kud/hosting_providers/containerized/installer.sh')
-rwxr-xr-x | kud/hosting_providers/containerized/installer.sh | 75 |
1 files changed, 55 insertions, 20 deletions
diff --git a/kud/hosting_providers/containerized/installer.sh b/kud/hosting_providers/containerized/installer.sh index 52fe6279..8739ca23 100755 --- a/kud/hosting_providers/containerized/installer.sh +++ b/kud/hosting_providers/containerized/installer.sh @@ -17,10 +17,13 @@ INSTALLER_DIR="$(readlink -f "$(dirname "${BASH_SOURCE[0]}")")" function install_prerequisites { #install package for docker images + echo "Removing ppa for jonathonf/python-3.6" + ls /etc/apt/sources.list.d/ || true + find /etc/apt/sources.list.d -maxdepth 1 -name '*jonathonf*' -delete || true apt-get update apt-get install -y curl vim wget git \ - software-properties-common python-pip - add-apt-repository ppa:longsleep/golang-backports + software-properties-common python-pip sudo + add-apt-repository -y ppa:longsleep/golang-backports apt-get update apt-get install -y golang-go rsync } @@ -100,7 +103,14 @@ function install_k8s { # install_addons() - Install Kubenertes AddOns function install_addons { - local plugins_name=$1 + if [ ${1:+1} ]; then + local plugins_name="$1" + echo "additional addons plugins $1" + else + local plugins_name="" + echo "no additional addons pluigns" + fi + source /etc/environment echo "Installing Kubernetes AddOns" ansible-galaxy install $verbose -r \ @@ -109,36 +119,52 @@ function install_addons { ansible-playbook $verbose -i \ $kud_inventory $kud_playbooks/configure-kud.yml | \ tee $cluster_log/setup-kud.log - for addon in ${KUD_ADDONS:-virtlet ovn4nfv nfd $plugins_name}; do + for addon in ${KUD_ADDONS:-virtlet ovn4nfv nfd sriov $plugins_name}; do echo "Deploying $addon using configure-$addon.yml playbook.." ansible-playbook $verbose -i \ $kud_inventory $kud_playbooks/configure-${addon}.yml | \ tee $cluster_log/setup-${addon}.log - if [[ "${testing_enabled}" == "true" ]]; then + done + + echo "Run the test cases if testing_enabled is set to true." + if [[ "${testing_enabled}" == "true" ]]; then + for addon in ${KUD_ADDONS:-virtlet ovn4nfv nfd sriov $plugins_name}; do pushd $kud_tests bash ${addon}.sh popd - fi - done + done + fi + echo "Add-ons deployment complete..." } # install_plugin() - Install ONAP Multicloud Kubernetes plugin function install_plugin { - echo "Installing multicloud/k8s plugin" - mkdir -p /opt/{kubeconfig,consul/config} - cp $HOME/.kube/config /opt/kubeconfig/kud - - pushd $kud_folder/../../../deployments - ./build.sh + echo "Installing multicloud/k8s onap4k8s plugin" if [[ "${testing_enabled}" == "true" ]]; then - ./start.sh pushd $kud_tests - for functional_test in plugin plugin_edgex plugin_fw; do - bash ${functional_test}.sh + echo "Test the onap4k8s installation" + bash onap4k8s.sh + echo "Test the onap4k8s plugin installation" + for functional_test in plugin_edgex plugin_fw; do + bash ${functional_test}.sh --external done popd fi - popd +} + +# install_controllers() - Install ONAP Multicloud Kubernetes controllers +function install_controllers { + echo "Installing multicloud/k8s onap4k8s controllers" + if [[ "${testing_enabled}" == "true" ]]; then + echo "Test controllers installation" + for controller_test in sdwan; do + pushd $kud_tests/$controller_test + ansible-playbook $verbose -i \ + $kud_inventory ${controller_test}.yml | \ + tee $cluster_log/test-${controller_test}.log + popd + done + fi } # _print_kubernetes_info() - Prints the login Kubernetes information @@ -179,6 +205,7 @@ k8s_info_file=$kud_folder/k8s_info.log testing_enabled=${KUD_ENABLE_TESTS:-false} mkdir -p /opt/csar +export CSAR_DIR=/opt/csar function install_pkg { # Install dependencies @@ -189,11 +216,19 @@ function install_pkg { function install_cluster { install_k8s $1 - install_addons $2 + if [ ${2:+1} ]; then + echo "install default addons and $2" + install_addons "$2" + else + install_addons + fi + echo "installed the addons" if ${KUD_PLUGIN_ENABLED:-false}; then install_plugin echo "installed the install_plugin" + install_controllers + echo "installed controllers" fi _print_kubernetes_info } @@ -254,7 +289,7 @@ if [ "$1" == "--cluster" ]; then cp $kud_multi_cluster_path/$cluster_name/hosts.ini $kud_inventory_folder/ cp -rf $kud_folder/inventory/group_vars $kud_inventory_folder/ - if [ -n "$3" ]; then + if [ ${3:+1} ]; then if [ "$3" == "--plugins" ]; then if [ -z "${4-}" ]; then echo "Error: plugins arguments is null; Refer the usage" @@ -262,7 +297,7 @@ if [ "$1" == "--cluster" ]; then exit 1 fi plugins_name=${@:4:$#} - install_cluster $cluster_name $plugins_name + install_cluster $cluster_name "$plugins_name" exit 0 else echo "Error: cluster argument should have plugins; \ |