X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=blobdiff_plain;f=deploy%2Fkud%2Fkud_bm_launch.sh;h=963e528be190dd96669ce17a3d4d5f24eb6dbe19;hb=8d37977a52baafada063ce4bc1170274e8049e11;hp=562142e3aca9f96d8ee6ca684e3bbb97a80065c7;hpb=999c2adc3d38570cac79e63a396e8f4340492961;p=icn.git diff --git a/deploy/kud/kud_bm_launch.sh b/deploy/kud/kud_bm_launch.sh index 562142e..963e528 100755 --- a/deploy/kud/kud_bm_launch.sh +++ b/deploy/kud/kud_bm_launch.sh @@ -1,19 +1,17 @@ -#!/bin/bash -set +x +#!/usr/bin/env bash +set -eu -o pipefail LIBDIR="$(dirname "$(dirname "$PWD")")" source $LIBDIR/env/lib/common.sh +export KUBESPRAY_VERSION=2.16.0 + function get_kud_repo { - if [ -d $DOWNLOAD_PATH/multicloud-k8s ]; then - rm -rf $DOWNLOAD_PATH/multicloud-k8s + clone_kud_repository + if [ "$1" == "v1" ] ; then + export KUD_ADDONS=multus fi - - mkdir -p $DOWNLOAD_PATH - pushd $DOWNLOAD_PATH - git clone https://github.com/onap/multicloud-k8s.git - popd } function set_ssh_key { @@ -30,10 +28,10 @@ function set_ssh_key { } function set_bm_kud { - pushd $DOWNLOAD_PATH/multicloud-k8s/kud/hosting_providers/vagrant/inventory + pushd ${KUDPATH}/kud/hosting_providers/vagrant/inventory HOST_IP=${HOST_IP:-$(hostname -I | cut -d ' ' -f 1)} - if [ "$1" == "virtlet" ] ; then - cat < hosts.ini + if [ "$1" == "minimal" ] ; then + cat < hosts.ini [all] $HOSTNAME ansible_ssh_host=${HOST_IP} ansible_ssh_port=22 @@ -46,15 +44,12 @@ $HOSTNAME [etcd] $HOSTNAME -[virtlet] -$HOSTNAME - [k8s-cluster:children] kube-node kube-master EOL else - cat < hosts.ini + cat < hosts.ini [all] $HOSTNAME ansible_ssh_host=${HOST_IP} ansible_ssh_port=22 @@ -67,6 +62,15 @@ $HOSTNAME [etcd] $HOSTNAME +[ovn-central] +$HOSTNAME + +[ovn-controller] +$HOSTNAME + +[virtlet] +$HOSTNAME + [k8s-cluster:children] kube-node kube-master @@ -76,8 +80,26 @@ EOL } function kud_install { - pushd $DOWNLOAD_PATH/multicloud-k8s/kud/hosting_providers/vagrant/ - ./installer.sh | tee kud_minial_deploy.log + pushd ${KUDPATH}/kud/hosting_providers/vagrant/ + if [ "$1" == "all" ]; then + sed -i -e 's/testing_enabled=${KUD_ENABLE_TESTS:-false}/testing_enabled=${KUD_ENABLE_TESTS:-true}/g' installer.sh + fi + ./installer.sh | tee kud_deploy.log + + if [ "$1" == "bm" ]; then + for addon in ${KUD_ADDONS:-multus ovn4nfv nfd sriov qat cmk optane}; do + pushd ${KUDPATH}/kud/tests/ + bash ${addon}.sh + popd + done + fi + popd +} + +function kud_reset { + pushd ${KUDPATH}/kud/hosting_providers/vagrant/ + ansible-playbook -i inventory/hosts.ini /opt/kubespray-${KUBESPRAY_VERSION}/reset.yml \ + --become --become-user=root -e reset_confirmation=yes popd } @@ -91,10 +113,15 @@ function verifier { call_api $APISERVER/api --header "Authorization: Bearer $TOKEN" --insecure } -get_kud_repo +if [ "$1" == "reset" ] ; then + kud_reset + exit 0 +fi + +get_kud_repo $2 set_ssh_key set_bm_kud $1 -kud_install +kud_install $1 verifier exit 0