aboutsummaryrefslogtreecommitdiffstats
path: root/kud/hosting_providers/vagrant/installer.sh
diff options
context:
space:
mode:
authorTodd Malsbary <todd.malsbary@intel.com>2020-10-27 14:46:29 -0700
committerTodd Malsbary <todd.malsbary@intel.com>2020-10-30 16:48:04 -0700
commite3c7d3d4153d3a9383d4ebcaa004e54b1b0b64c2 (patch)
treefb3e4e85dc51e7a05dc8756413d490caf638a093 /kud/hosting_providers/vagrant/installer.sh
parent0c352ef0d74d4b51a0fce5123b34a6753e8ab6a4 (diff)
Upgrade kubespray from 2.12.6 to 2.14.1
- Replace move of ansible.cfg from kubespray distribution to /etc/ansible with ANSIBLE_CONFIG environment variable. Ansible modifies ansible.cfg during installation, and the paths in it are relative. - kubespray 2.14.1 requires a kubernetes version > 1.16. Use the default versions of kubernetes and helm provided by kubespray 2.14.1. - kubespray 2.14.1 replaces helm 2 with helm 3. This removes support for helm init and helm serve. It is no longer necessary to call helm init, and the helm serve repository is replaced with file relative URLs. This also triggered a subsequent update of the kubernetes-helm ansible module to include the newer helm versions. - Add "storageType: hostPath" to etcd/values.yaml. Helm deploy of etcd will fail without this due to nil PersistentVolume.metadata.labels.type. - The mitogen module used by kubespray/ansible requires python2 on the hosts. Use the linear strategy to bypass mitogen and install python2 on the cluster hosts. Issue-ID: MULTICLOUD-1230 Signed-off-by: Todd Malsbary <todd.malsbary@intel.com> Change-Id: I9f50bb4e123fdcacab6b6a97e79cd09fb5c96634
Diffstat (limited to 'kud/hosting_providers/vagrant/installer.sh')
-rwxr-xr-xkud/hosting_providers/vagrant/installer.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/kud/hosting_providers/vagrant/installer.sh b/kud/hosting_providers/vagrant/installer.sh
index 71e4d8b7..94f3c58c 100755
--- a/kud/hosting_providers/vagrant/installer.sh
+++ b/kud/hosting_providers/vagrant/installer.sh
@@ -102,6 +102,7 @@ function _set_environment_file {
echo "export OVN_CENTRAL_ADDRESS=$(get_ovn_central_address)" | sudo tee --append /etc/environment
echo "export KUBE_CONFIG_DIR=/opt/kubeconfig" | sudo tee --append /etc/environment
echo "export CSAR_DIR=/opt/csar" | sudo tee --append /etc/environment
+ echo "export ANSIBLE_CONFIG=${ANSIBLE_CONFIG}" | sudo tee --append /etc/environment
}
# install_k8s() - Install Kubernetes using kubespray tool
@@ -117,7 +118,6 @@ function install_k8s {
_install_ansible
wget https://github.com/kubernetes-incubator/kubespray/archive/$tarball
sudo tar -C $dest_folder -xzf $tarball
- sudo mv $dest_folder/kubespray-$version/ansible.cfg /etc/ansible/ansible.cfg
sudo chown -R $USER $dest_folder/kubespray-$version
sudo mkdir -p ${local_release_dir}/containers
rm $tarball
@@ -139,6 +139,8 @@ function install_k8s {
if [[ -n "${https_proxy:-}" ]]; then
echo "https_proxy: \"$https_proxy\"" | tee --append $kud_inventory_folder/group_vars/all.yml
fi
+ export ANSIBLE_CONFIG=$dest_folder/kubespray-$version/ansible.cfg
+ ansible-playbook $verbose -i $kud_inventory $kud_playbooks/preconfigure-kubespray.yml --become --become-user=root | sudo tee $log_folder/setup-kubernetes.log
ansible-playbook $verbose -i $kud_inventory $dest_folder/kubespray-$version/cluster.yml --become --become-user=root | sudo tee $log_folder/setup-kubernetes.log
# Configure environment