31 lines
841 B
Bash
Executable File
31 lines
841 B
Bash
Executable File
#!/bin/sh
|
|
|
|
# use virtualenv to install all python requirements
|
|
VENVDIR=venv
|
|
virtualenv --python=/usr/bin/python3.7 $VENVDIR
|
|
source $VENVDIR/bin/activate
|
|
pip install -r kubespray/requirements.txt
|
|
|
|
# prepare an inventory to test with
|
|
INV=dev
|
|
mv kubespray/${INV} kubespray/${INV}.bak &> /dev/null
|
|
cp -a kubespray/inventory/sample kubespray/${INV}
|
|
|
|
# customize the vagrant environment
|
|
mkdir -p kubespray/vagrant
|
|
cat << EOF > kubespray/vagrant/config.rb
|
|
\$instance_name_prefix = "k9s"
|
|
\$vm_cpus = 4
|
|
\$num_instances = 1
|
|
\$os = "centos"
|
|
\$subnet = "10.0.20"
|
|
\$network_plugin = "flannel"
|
|
\$inventory = "$INV"
|
|
\$shared_folders = { 'temp/docker_rpms' => "/var/cache/yum/x86_64/7/docker-ce/packages" }
|
|
\$kube_node_instances_with_disks_number = 0
|
|
EOF
|
|
|
|
# make the rpm cache
|
|
mkdir -p kubespray/temp/docker_rpms
|
|
|
|
echo "Now cd to kubespray and 'vagrant up'" |