1
0
mirror of https://github.com/jcwimer/startup-infrastructure synced 2026-03-24 22:34:42 +00:00

Switched from docker swarm to Kubernetes with rke

This commit is contained in:
2020-05-11 19:39:13 -04:00
parent 01f384ac14
commit 1e5724ec1d
30 changed files with 458 additions and 488 deletions

55
Vagrantfile vendored
View File

@@ -1,36 +1,27 @@
machines = {
'client' => { :ip =>'192.168.254.4', :memory => '512', :cpus => 1, :client => true},
'master1' => { :ip => '192.168.254.2', :memory => '1536', :cpus => 2 },
'worker1' => { :ip => '192.168.254.3', :memory => '1536', :cpus => 2 },
'worker2' => { :ip => '192.168.254.5', :memory => '1536', :cpus => 2 },
'worker3' => { :ip => '192.168.254.6', :memory => '1536', :cpus => 2 },
# 'worker4' => { :ip => '192.168.254.7', :memory => '1536', :cpus => 1 },
}
Vagrant.configure("2") do |config|
config.vm.define "master1" do |bootstrap|
bootstrap.vm.box = "debian/stretch64"
bootstrap.vm.hostname = "bootstrap"
bootstrap.vm.network "private_network", ip: "192.168.254.2"
bootstrap.vm.provision :shell, path: "tests/files/provision-script.sh"
bootstrap.vm.provider "virtualbox" do |v|
v.memory = 2048
v.cpus = 2
end
end
config.vm.define "worker1" do |worker1|
worker1.vm.box = "debian/stretch64"
worker1.vm.hostname = "worker1"
worker1.vm.network "private_network", ip: "192.168.254.3"
worker1.vm.provision :shell, path: "tests/files/provision-script.sh"
worker1.vm.provider "virtualbox" do |v|
v.memory = 2048
v.cpus = 2
end
end
config.vm.define "client" do |client|
client.vm.box = "debian/stretch64"
client.vm.hostname = "client"
client.vm.network "private_network", ip: "192.168.254.4"
client.vm.provision :shell, path: "tests/files/install-pip.sh"
client.vm.provision :shell, path: "tests/files/provision-script.sh"
client.vm.provider "virtualbox" do |v|
v.memory = 512
v.cpus = 1
machines.each do | hostname, attrs|
config.vm.define hostname do |machine|
machine.vm.hostname = hostname
machine.vm.box = "debian/stretch64"
machine.vm.network :private_network, :ip => attrs[:ip], netmask: "255.255.255.0"
machine.vm.provider "virtualbox" do |v|
v.memory = attrs[:memory]
v.cpus = attrs[:cpus]
end
machine.vm.provision :shell, path: "tests/files/provision-script.sh"
if attrs[:client] == true
machine.vm.provision :shell, path: "tests/files/install-pip.sh"
end
end
end
end