aboutsummaryrefslogtreecommitdiffstats
path: root/kud/hosting_providers/containerized/installer.sh
diff options
context:
space:
mode:
Diffstat (limited to 'kud/hosting_providers/containerized/installer.sh')
-rwxr-xr-xkud/hosting_providers/containerized/installer.sh33
1 files changed, 22 insertions, 11 deletions
diff --git a/kud/hosting_providers/containerized/installer.sh b/kud/hosting_providers/containerized/installer.sh
index ae16b1dd..b2ec52af 100755
--- a/kud/hosting_providers/containerized/installer.sh
+++ b/kud/hosting_providers/containerized/installer.sh
@@ -36,7 +36,6 @@ function _install_ansible {
pip install --no-cache-dir ansible==$version
}
-# install_k8s() - Install Kubernetes using kubespray tool
function install_kubespray {
echo "Deploying kubernetes"
version=$(grep "kubespray_version" ${kud_playbooks}/kud-vars.yml | \
@@ -50,7 +49,6 @@ function install_kubespray {
_install_ansible
wget https://github.com/kubernetes-incubator/kubespray/archive/$tarball
tar -C $dest_folder -xzf $tarball
- mv $dest_folder/kubespray-$version/ansible.cfg /etc/ansible/ansible.cfg
chown -R root:root $dest_folder/kubespray-$version
mkdir -p ${local_release_dir}/containers
rm $tarball
@@ -79,11 +77,14 @@ function install_kubespray {
fi
}
+# install_k8s() - Install Kubernetes using kubespray tool
function install_k8s {
- version=$(grep "kubespray_version" ${kud_playbooks}/kud-vars.yml | \
- awk -F ': ' '{print $2}')
local cluster_name=$1
ansible-playbook $verbose -i \
+ $kud_inventory $kud_playbooks/preconfigure-kubespray.yml \
+ --become --become-user=root | \
+ tee $cluster_log/setup-kubernetes.log
+ ansible-playbook $verbose -i \
$kud_inventory $dest_folder/kubespray-$version/cluster.yml \
-e cluster_name=$cluster_name --become --become-user=root | \
tee $cluster_log/setup-kubernetes.log
@@ -117,36 +118,43 @@ function install_addons {
$kud_infra_folder/galaxy-requirements.yml --ignore-errors
ansible-playbook $verbose -i \
- $kud_inventory $kud_playbooks/configure-kud.yml | \
+ $kud_inventory -e "base_dest=$HOME" $kud_playbooks/configure-kud.yml | \
tee $cluster_log/setup-kud.log
- for addon in ${KUD_ADDONS:-virtlet ovn4nfv nfd sriov cmk $plugins_name}; do
+ # The order of KUD_ADDONS is important: some plugins (sriov, qat)
+ # require nfd to be enabled.
+ for addon in ${KUD_ADDONS:-virtlet ovn4nfv nfd sriov qat cmk $plugins_name}; do
echo "Deploying $addon using configure-$addon.yml playbook.."
ansible-playbook $verbose -i \
- $kud_inventory $kud_playbooks/configure-${addon}.yml | \
+ $kud_inventory -e "base_dest=$HOME" $kud_playbooks/configure-${addon}.yml | \
tee $cluster_log/setup-${addon}.log
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 cmk $plugins_name}; do
+ failed_kud_tests=""
+ for addon in ${KUD_ADDONS:-virtlet ovn4nfv nfd sriov qat cmk $plugins_name}; do
pushd $kud_tests
- bash ${addon}.sh
+ bash ${addon}.sh || failed_kud_tests="${failed_kud_tests} ${addon}"
case $addon in
"onap4k8s" )
echo "Test the onap4k8s plugin installation"
for functional_test in plugin_edgex plugin_fw plugin_eaa; do
- bash ${functional_test}.sh --external
+ bash ${functional_test}.sh --external || failed_kud_tests="${failed_kud_tests} ${functional_test}"
done
;;
"emco" )
echo "Test the emco plugin installation"
for functional_test in plugin_fw_v2; do
- bash ${functional_test}.sh --external
+ bash ${functional_test}.sh --external || failed_kud_tests="${failed_kud_tests} ${functional_test}"
done
;;
esac
popd
done
+ if [[ ! -z "$failed_kud_tests" ]]; then
+ echo "Test cases failed:${failed_kud_tests}"
+ return 1
+ fi
fi
echo "Add-ons deployment complete..."
}
@@ -199,6 +207,9 @@ function install_pkg {
}
function install_cluster {
+ version=$(grep "kubespray_version" ${kud_playbooks}/kud-vars.yml | \
+ awk -F ': ' '{print $2}')
+ export ANSIBLE_CONFIG=$dest_folder/kubespray-$version/ansible.cfg
install_k8s $1
if [ ${2:+1} ]; then
echo "install default addons and $2"