Switching to better vagrant initscript
This commit is contained in:
parent
fbbfba3a61
commit
ee88acc002
|
|
@ -1 +1,2 @@
|
|||
kubespray/**
|
||||
kubespray
|
||||
venv
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ vagrant up
|
|||
vagrant ssh k8s-1
|
||||
```
|
||||
|
||||
TODO 16.02.2020: Vagrant up works but no k8s is installed. Maybe due to wrong ansible playbook or because from here on kubespray should kick in
|
||||
|
||||
## Done steps
|
||||
|
||||
|
|
|
|||
|
|
@ -1,2 +0,0 @@
|
|||
$num_instances = 1
|
||||
$os = "centos"
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
# ## Configure 'ip' variable to bind kubernetes services on a
|
||||
# ## different ip than the default iface
|
||||
# ## We should set etcd_member_name for etcd cluster. The node that is not a etcd member do not need to set the value, or can set the empty string value.
|
||||
[all]
|
||||
# node1 ansible_host=95.54.0.12 # ip=10.3.0.1 etcd_member_name=etcd1
|
||||
# node2 ansible_host=95.54.0.13 # ip=10.3.0.2 etcd_member_name=etcd2
|
||||
# node3 ansible_host=95.54.0.14 # ip=10.3.0.3 etcd_member_name=etcd3
|
||||
# node4 ansible_host=95.54.0.15 # ip=10.3.0.4 etcd_member_name=etcd4
|
||||
# node5 ansible_host=95.54.0.16 # ip=10.3.0.5 etcd_member_name=etcd5
|
||||
# node6 ansible_host=95.54.0.17 # ip=10.3.0.6 etcd_member_name=etcd6
|
||||
|
||||
# ## configure a bastion host if your nodes are not directly reachable
|
||||
# bastion ansible_host=x.x.x.x ansible_user=some_user
|
||||
|
||||
[kube-master]
|
||||
# node1
|
||||
# node2
|
||||
|
||||
[etcd]
|
||||
# node1
|
||||
# node2
|
||||
# node3
|
||||
|
||||
[kube-node]
|
||||
# node2
|
||||
# node3
|
||||
# node4
|
||||
# node5
|
||||
# node6
|
||||
|
||||
[calico-rr]
|
||||
|
||||
[k8s-cluster:children]
|
||||
kube-master
|
||||
#kube-node
|
||||
#calico-rr
|
||||
|
|
@ -1,5 +1,32 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Idempotently initializes a fresh kubespray repo clone
|
||||
# use virtualenv to install all python requirements
|
||||
VENVDIR=venv
|
||||
virtualenv --python=/usr/local/bin/python3 $VENVDIR
|
||||
source $VENVDIR/bin/activate
|
||||
pip install -r kubespray/requirements.txt
|
||||
|
||||
# prepare an inventory to test with
|
||||
INV=dev.inventory
|
||||
rm -rf kubespray/${INV}.bak &> /dev/null
|
||||
mv kubespray/${INV} kubespray/${INV}.bak &> /dev/null
|
||||
cp -a kubespray/inventory/sample kubespray/${INV}
|
||||
rm -f kubespray/${INV}/hosts.ini
|
||||
|
||||
# customize the vagrant environment
|
||||
mkdir -p kubespray/vagrant
|
||||
cp config.rb kubespray/vagrant/config.rb
|
||||
cat << EOF > kubespray/vagrant/config.rb
|
||||
\$instance_name_prefix = "k8s"
|
||||
\$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" }
|
||||
EOF
|
||||
|
||||
# make the rpm cache
|
||||
mkdir -p kubespray/temp/docker_rpms
|
||||
|
||||
echo "Now cd to kubespray and 'vagrant up'"
|
||||
Loading…
Reference in New Issue