Vagrant: Add support for nfs synced folders

nfs synced folders do not require guest additions and are faster than
vmware and virtualbox's shared folders.  This change configures the
default /vagrant synced folder to use nfs if the
KUBERNETES_VAGRANT_USE_NFS environment variable is set to 'true'.
This commit is contained in:
Maru Newby
2015-07-01 12:30:22 -07:00
parent 3094c1624b
commit 5ab9d2cc94
2 changed files with 17 additions and 1 deletions

8
Vagrantfile vendored
View File

@@ -28,6 +28,9 @@ $minion_ips = $num_minion.times.collect { |n| $minion_ip_base + "#{n+3}" }
# Determine the OS platform to use
$kube_os = ENV['KUBERNETES_OS'] || "fedora"
# Determine whether vagrant should use nfs to sync folders
$use_nfs = ENV['KUBERNETES_VAGRANT_USE_NFS'] == 'true'
# To override the vagrant provider, use (e.g.):
# KUBERNETES_PROVIDER=vagrant VAGRANT_DEFAULT_PROVIDER=... .../cluster/kube-up.sh
# To override the box, use (e.g.):
@@ -130,6 +133,11 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
end
def customize_vm(config, vm_mem)
if $use_nfs then
config.vm.synced_folder ".", "/vagrant", nfs: true
end
# Try VMWare Fusion first (see
# https://docs.vagrantup.com/v2/providers/basic_usage.html)
config.vm.provider :vmware_fusion do |v, override|