forked from rootsongjc/kubernetes-vagrant-centos-cluster
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
27 lines (26 loc) · 906 Bytes
/
Vagrantfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box_check_update = false
config.vm.provider 'virtualbox' do |vb|
vb.customize [ "guestproperty", "set", :id, "/VirtualBox/GuestAdd/VBoxService/--timesync-set-threshold", 1000 ]
end
config.vm.synced_folder ".", "/vagrant", type: "rsync"
$num_instances = 3
# curl https://discovery.etcd.io/new?size=3
$etcd_cluster = "node1=http://172.17.8.101:2380"
(1..$num_instances).each do |i|
config.vm.define "node#{i}" do |node|
node.vm.box = "centos/7"
node.vm.hostname = "node#{i}"
ip = "172.17.8.#{i+100}"
node.vm.network "private_network", ip: ip
node.vm.provider "virtualbox" do |vb|
vb.memory = "3072"
vb.cpus = 1
vb.name = "node#{i}"
end
node.vm.provision "shell", path: "install.sh", args: [i, ip, $etcd_cluster]
end
end
end