X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=blobdiff_plain;f=deploy%2Fkud%2Fkud_bm_launch.sh;h=b7dc9b8fb44bd3a5f0f9da77d591d9d308316cdf;hb=8fcb874a6e5ec52b4a6ac80cb7f34c7baccd8c17;hp=2e5f9aabb55a519d5ff6c2f546a8a4f2b65941ea;hpb=802e1f9ef59d38f337ca291df6bf1fb140ef7404;p=icn.git diff --git a/deploy/kud/kud_bm_launch.sh b/deploy/kud/kud_bm_launch.sh index 2e5f9aa..b7dc9b8 100755 --- a/deploy/kud/kud_bm_launch.sh +++ b/deploy/kud/kud_bm_launch.sh @@ -5,19 +5,13 @@ LIBDIR="$(dirname "$(dirname "$PWD")")" source $LIBDIR/env/lib/common.sh -function get_kud_repo { - if [ -d $DOWNLOAD_PATH/multicloud-k8s ]; then - rm -rf $DOWNLOAD_PATH/multicloud-k8s - fi +export KUBESPRAY_VERSION=2.16.0 - mkdir -p $DOWNLOAD_PATH - pushd $DOWNLOAD_PATH +function get_kud_repo { + clone_kud_repository if [ "$1" == "v1" ] ; then - git clone --branch v1.0-icn https://github.com/akraino-icn/multicloud-k8s.git - else - git clone https://github.com/onap/multicloud-k8s.git + export KUD_ADDONS=multus fi - popd } function set_ssh_key { @@ -34,12 +28,20 @@ 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)} + DOCKER_OPTIONS="" + if [[ ! -z "${DOCKER_REGISTRY_MIRRORS+x}" ]]; then + OPTIONS="" + for mirror in ${DOCKER_REGISTRY_MIRRORS}; do + OPTIONS="${OPTIONS} --registry-mirror=${mirror}" + done + DOCKER_OPTIONS="docker_options=\"${OPTIONS# }\"" + fi if [ "$1" == "minimal" ] ; then cat < hosts.ini [all] -$HOSTNAME ansible_ssh_host=${HOST_IP} ansible_ssh_port=22 +$HOSTNAME ansible_ssh_host=${HOST_IP} ansible_ssh_port=22 ${DOCKER_OPTIONS} [kube-master] $HOSTNAME @@ -57,7 +59,7 @@ EOL else cat < hosts.ini [all] -$HOSTNAME ansible_ssh_host=${HOST_IP} ansible_ssh_port=22 +$HOSTNAME ansible_ssh_host=${HOST_IP} ansible_ssh_port=22 ${DOCKER_OPTIONS} [kube-master] $HOSTNAME @@ -86,18 +88,15 @@ EOL } function kud_install { - pushd $DOWNLOAD_PATH/multicloud-k8s/kud/hosting_providers/vagrant/ - if [ "$1" == "all" -o "$1" == "vm" ]; then + 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 - if [ "$1" == "vm" ]; then - sed -i -e 's/^kube_pods_subnet.*/kube_pods_subnet: 172.21.64.0\/18/g' inventory/group_vars/k8s-cluster.yml - 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 $DOWNLOAD_PATH/multicloud-k8s/kud/tests/ + pushd ${KUDPATH}/kud/tests/ bash ${addon}.sh popd done @@ -106,13 +105,12 @@ function kud_install { } function kud_reset { - pushd $DOWNLOAD_PATH/multicloud-k8s/kud/hosting_providers/vagrant/ - ansible-playbook -i inventory/hosts.ini /opt/kubespray-2.10.4/reset.yml \ + 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 } - function verifier { APISERVER=$(kubectl config view --minify -o \ jsonpath='{.clusters[0].cluster.server}')