2022-08-05 16:16:10 +00:00
|
|
|
#!/bin/sh
|
|
|
|
# Script to install pre-requisites on vsphere node to run e2e test
|
|
|
|
|
|
|
|
export PATH=$PATH:/usr/local/go/bin/:/usr/local/bin
|
|
|
|
echo 'Installing Kubectl'
|
|
|
|
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" && \
|
|
|
|
sudo mv kubectl /usr/local/bin/ && \
|
|
|
|
chmod a+x /usr/local/bin/kubectl
|
|
|
|
|
|
|
|
echo 'Installing jq'
|
|
|
|
sudo apt-get -y install jq
|
|
|
|
|
|
|
|
echo 'Installing Go'
|
2022-09-08 18:13:37 +00:00
|
|
|
GO_VERSION=1.19.1
|
|
|
|
wget --quiet https://dl.google.com/go/go$GO_VERSION.linux-amd64.tar.gz
|
|
|
|
sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go$GO_VERSION.linux-amd64.tar.gz
|
|
|
|
rm go$GO_VERSION.linux-amd64.tar.gz
|
|
|
|
echo
|
2022-08-05 16:16:10 +00:00
|
|
|
go version
|
|
|
|
|
|
|
|
echo 'Installing Virtualbox'
|
|
|
|
sudo apt-get -y update && sudo apt-get -y upgrade
|
|
|
|
sudo apt-get -y install virtualbox
|
|
|
|
vboxmanage --version
|
|
|
|
|
|
|
|
# Virtualbox >= 6.1.28 require `/etc/vbox/network.conf
|
|
|
|
ls /etc/vbox 2>/dev/null || sudo mkdir -p /etc/vbox
|
|
|
|
echo "* 10.0.0.0/8 192.168.0.0/16">>/etc/vbox/networks.conf
|
|
|
|
|
|
|
|
echo 'Installing vagrant'
|
|
|
|
sudo apt-get -y install -f unzip
|
|
|
|
curl -O https://releases.hashicorp.com/vagrant/2.2.19/vagrant_2.2.19_linux_amd64.zip
|
|
|
|
unzip vagrant_2.2.19_linux_amd64.zip
|
2022-09-08 18:13:37 +00:00
|
|
|
sudo mv vagrant /usr/local/bin/
|
|
|
|
rm vagrant_2.2.19_linux_amd64.zip
|
2022-08-05 16:16:10 +00:00
|
|
|
vagrant --version
|
|
|
|
sudo apt-get -y install libarchive-tools
|
2022-09-12 23:10:22 +00:00
|
|
|
vagrant plugin install vagrant-k3s vagrant-reload vagrant-scp
|
2022-08-05 16:16:10 +00:00
|
|
|
|
|
|
|
echo 'Cloning repo'
|
|
|
|
ls k3s 2>/dev/null || git clone https://github.com/k3s-io/k3s.git
|