33require 'yaml'
44
55# Modify these in the variables.yaml file... they are described there in gory detail...
6- settings = YAML . load_file 'sync/shared/variables.yaml'
6+ settingsFile = ENV [ "VAGRANT_VARIABLES" ] || 'sync/shared/variables.yaml'
7+ settings = YAML . load_file settingsFile
78k8s_linux_registry = settings [ 'k8s_linux_registry' ]
89k8s_linux_kubelet_deb = settings [ 'k8s_linux_kubelet_deb' ]
910k8s_linux_apiserver = settings [ 'k8s_linux_apiserver' ]
@@ -12,6 +13,12 @@ kubernetes_version_windows=settings['kubernetes_version_windows']
1213overwrite_linux_bins = settings [ 'overwrite_linux_bins' ]
1314overwrite_windows_bins = settings [ 'overwrite_windows_bins' ] ? "-OverwriteBins" : ""
1415
16+ linux_ram = settings [ 'linux_ram' ]
17+ linux_cpus = settings [ 'linux_cpus' ]
18+ windows_ram = settings [ 'windows_ram' ]
19+ windows_cpus = settings [ 'windows_cpus' ]
20+
21+
1522Vagrant . configure ( 2 ) do |config |
1623
1724 # LINUX Control Plane
@@ -24,8 +31,8 @@ Vagrant.configure(2) do |config|
2431 controlplane . vm . provider :virtualbox do |vb |
2532 controlplane . vm . synced_folder "./sync/shared" , "/var/sync/shared"
2633 controlplane . vm . synced_folder "./sync/linux" , "/var/sync/linux"
27- vb . memory = 8192
28- vb . cpus = 4
34+ vb . memory = linux_ram
35+ vb . cpus = linux_cpus
2936 end
3037 controlplane . vm . provision :shell , privileged : false , path : "sync/linux/controlplane.sh" , args : "#{ overwrite_linux_bins } #{ k8s_linux_registry } #{ k8s_linux_kubelet_deb } #{ k8s_linux_apiserver } "
3138 end
@@ -39,8 +46,8 @@ Vagrant.configure(2) do |config|
3946 winw1 . vm . synced_folder "./sync/shared" , "C:\\ sync\\ shared"
4047 winw1 . vm . synced_folder "./sync/windows" , "C:\\ sync\\ windows"
4148 winw1 . vm . provider :virtualbox do |vb |
42- vb . memory = 8192
43- vb . cpus = 4
49+ vb . memory = windows_ram
50+ vb . cpus = windows_cpus
4451 vb . gui = false
4552 end
4653
0 commit comments