I have the vagrant file contains all configuration needed to install Four machine one kubemaster and 3 nodes , but when I run the command vagrant up give the error like that :
~/kubernetes/setup-k8s/vagrant-kubeadm$ vagrant up
Bringing machine ‘master01’ up with ‘libvirt’ provider…
Bringing machine ‘worker01’ up with ‘libvirt’ provider…
Bringing machine ‘worker02’ up with ‘libvirt’ provider…
Bringing machine ‘worker03’ up with ‘libvirt’ provider…
==> master01: An error occurred. The error will be shown after all tasks complete.
==> worker03: An error occurred. The error will be shown after all tasks complete.
==> worker02: An error occurred. The error will be shown after all tasks complete.
==> worker01: An error occurred. The error will be shown after all tasks complete.
An error occurred while executing multiple actions in parallel.
Any errors that occurred are shown below.
An error occurred while executing the action on the ‘master01’
machine. Please handle this error then try again:
There are errors in the configuration of this machine. Please fix
the following errors and try again:
vm:
- The host path of the shared folder is not supported from WSL. Host
path of the shared folder must be located on a file system with
DrvFs type. Host path: .
the Vagrant file like that :
NUM_MASTER_NODE = 1
NUM_WORKER_NODE = 3
IP_NW = "192.168.56."
MASTER_IP_START = 1
NODE_IP_START = 2
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/bionic64"
# Disable automatic box update checking.
config.vm.box_check_update = false
config.vm.provision "shell", path: "ubuntu/initialSetup.sh"
# Provision Master Nodes
(1..NUM_MASTER_NODE).each do |i|
config.vm.define "master0#{i}" do |node|
node.vm.provider "virtualbox" do |vb|
vb.name = "master0#{i}"
vb.memory = 2048
vb.cpus = 2
vb.name = "vagrant-docker-project-master"
vb.build_dir = "build/docker/centos"
vb.create_args = ['--tmpfs', '/tmp:exec', '--tmpfs', '/run', '-v', '/sys/fs/cgroup:/sys/fs/cgroup:ro']
end
node.vm.hostname = "master0#{i}"
node.vm.network :private_network, ip: IP_NW + "#{MASTER_IP_START + i}"
node.vm.network "forwarded_port", guest: 22, host: "#{2710 + i}"
node.vm.provision "setup-hosts", :type => "shell", :path => "ubuntu/setup-hosts.sh" do |s|
s.args = ["enp0s8"]
end
node.vm.provision "setup-dns", type: "shell", :path => "ubuntu/update-dns.sh"
node.vm.provision "shell", type: "shell", path: "ubuntu/setupmaster.sh"
end
end
# Provision Worker Nodes
(1..NUM_WORKER_NODE).each do |i|
config.vm.define "worker0#{i}" do |node|
node.vm.provider "virtualbox" do |vb|
vb.name = "worker0#{i}"
vb.memory = 1024
vb.cpus = 2
vb.name = "vagrant-docker-project-node"
vb.build_dir = "build/docker/centos"
vb.create_args = ['--tmpfs', '/tmp:exec', '--tmpfs', '/run', '-v', '/sys/fs/cgroup:/sys/fs/cgroup:ro']
end
node.vm.hostname = "worker0#{i}"
node.vm.network :private_network, ip: IP_NW + "#{NODE_IP_START + i}"
node.vm.network "forwarded_port", guest: 22, host: "#{2720 + i}"
node.vm.provision "setup-hosts", :type => "shell", :path => "ubuntu/setup-hosts.sh" do |s|
s.args = ["enp0s8"]
end
node.vm.provision "setup-dns", type: "shell", :path => "ubuntu/update-dns.sh"
node.vm.provision "setup-dns", type: "shell", :path => "ubuntu/setupworker.sh"
end
end
end```
Saad KHARTOUM is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.