The kubernetes ansible/vagrant install method can be used with the libvirt, virtualbox or openstack providers. The Vagrantfile
requires that vagrant-openstack-provider
be installed whether you're using it or not, so install it:
$ vagrant plugin install vagrant-openstack-provider
Alternatively, you can skip the second step above, but you'll need to comment out the require 'vagrant-openstack-provider'
line in the Vagrantfile
.
$ git clone https://github.com/jasonbrooks/contrib.git
$ cd contrib/ansible/vagrant
The Vagrantfile
in my fork of the kuberenetes contrib repo adds support for setting a distro_type
to indicate whether you want to use CentOS 7 (default), Fedora 22 (export DISTRO_TYPE=fedora
), Fedora Atomic (export DISTRO_TYPE=fedora-atomic
), or CentOS Atomic (export DISTRO_TYPE=centos-atomic
). This should work with both the libvirt and virtualbox providers.
NOTE: Plain CentOS 7 and Fedora 22 aren't working for me right now w/ the script, but the atomic versions are working.
Use vagrant to bring up your kube-master and kube-nodes. The default number of nodes is 2, but you can change this by setting a different env variable for NUM_NODES
.
$ vagrant up --no-provision
If your Atomic Host image needs updating, you can do it before provisioning, like this:
$ for i in {kube-node-1,kube-master,kube-node-2}; do vagrant ssh $i -c "sudo atomic host upgrade"; done
$ vagrant reload --no-provision
Time to configure kubernetes, but running the ansible playbook on the kube-master:
$ vagrant provision kube-master
Kubernetes should be all set up now:
$ vagrant ssh kube-master
$ kubectl get nodes
Fedora 22 needs this: ansible/ansible-modules-extras#885