Instantly share code, notes, and snippets.

Embed
What would you like to do?
Vagrant file to create 3 Ubuntu 14.04 machines to run Kubernetes on
$instances = 3
$instance_name_prefix = "kube"
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/trusty64"
config.ssh.forward_agent = true
(1..$instances).each do |i|
config.vm.define vm_name = "%s-%02d" % [$instance_name_prefix, i] do |config|
config.vm.hostname = vm_name
ip = "172.20.0.#{i+100}"
config.vm.network :private_network, ip: ip
config.vm.provision "docker"
config.vm.provision "file", source: "kube.pub", destination: ".ssh/authorized_keys"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment