45 lines
1.4 KiB
Ruby
45 lines
1.4 KiB
Ruby
|
# -*- mode: ruby -*-
|
||
|
# vi: set ft=ruby :
|
||
|
|
||
|
#NUM_MASTER_NODE = ENV['MASTERS'].to_i
|
||
|
#NUM_WORKER_NODE = ENV['WORKERS'].to_i
|
||
|
|
||
|
NUM_MASTER_NODE = 1
|
||
|
NUM_WORKER_NODE = 0
|
||
|
|
||
|
Vagrant.configure("2") do |config|
|
||
|
# The most common configuration options are documented and commented below.
|
||
|
# For a complete reference, please see the online documentation at
|
||
|
# https://docs.vagrantup.com.
|
||
|
|
||
|
# Every Vagrant development environment requires a box. You can search for
|
||
|
# boxes at https://vagrantcloud.com/search.
|
||
|
#config.vm.box = "generic/ubuntu2004"
|
||
|
config.vm.box = "generic/ubuntu2004" # "generic/debian12"
|
||
|
config.vm.provider :libvirt do |libvirt|
|
||
|
libvirt.default_prefix = ""
|
||
|
libvirt.memory = 3096
|
||
|
libvirt.cpus = 2
|
||
|
end
|
||
|
config.vm.provider "virtualbox" do |vbox|
|
||
|
vbox.memory = 3096
|
||
|
vbox.cpus = 2
|
||
|
end
|
||
|
|
||
|
(1..NUM_MASTER_NODE).each do |i|
|
||
|
config.vm.define "master#{i}" do |node|
|
||
|
node.vm.hostname = "master#{i}"
|
||
|
node.vm.provision "shell", path: "disable-swap.sh"
|
||
|
node.vm.provision "shell", path: "setup-k8s-node.sh"
|
||
|
node.vm.provision "shell", path: "setup-master.sh"
|
||
|
#node.vm.network "private_network", ip: IP_NW + "#{1+ i}"
|
||
|
end
|
||
|
end
|
||
|
(1..NUM_WORKER_NODE).each do |i|
|
||
|
config.vm.define "worker#{i}" do |node|
|
||
|
node.vm.hostname = "worker#{i}"
|
||
|
node.vm.provision "shell", path: "disable-swap.sh"
|
||
|
end
|
||
|
end
|
||
|
end
|