Skip to content

Instantly share code, notes, and snippets.

@mihok
Created February 14, 2016 01:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mihok/04e13a276c72a0d1b9da to your computer and use it in GitHub Desktop.
Save mihok/04e13a276c72a0d1b9da to your computer and use it in GitHub Desktop.
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