Files
kubernetes/contrib/ansible
Eric Paris a25b34e1a4 Ansible: Vagrant: allow passing ansible tags to vagrant provision
Creating a cluster from scratch takes about 7 minutes. But if you just
rebuild the binaries and want to update those you don't want to have to
rerun the entire thing. There is an ansible tag 'binary-update' which
will do that. Now one can do
```
ANSIBLE_TAGS=binary-update vagrant provision
```
And it will push the new binaries.
2015-07-24 09:58:31 -04:00
..
2015-04-03 12:01:36 -04:00
2015-06-24 13:45:46 -04:00
2015-07-24 09:58:31 -04:00

Kubernetes Ansible

This playbook and set of roles set up a Kubernetes cluster onto machines. They can be real hardware, VMs, things in a public cloud, etc. Anything that you can connect to via SSH.

Before starting

  • Record the IP address/hostname of which machine you want to be your master (only support a single master)
  • Record the IP address/hostname of the machine you want to be your etcd server (often same as master, only one)
  • Record the IP addresses/hostname of the machines you want to be your nodes. (the master can also be a node)
  • Make sure your ansible running machine has ansible 1.9 and python-netaddr installed.

Setup

Configure inventory

Add the system information gathered above into the 'inventory' file, or create a new inventory file for the cluster.

Configure Cluster options

Look though all of the options in group_vars/all.yml and set the variables to reflect your needs. The options are described there in full detail.

Running the playbook

After going through the setup, run the setup script provided:

$ ./setup.sh

You may override the inventory file by doing:

INVENTORY=myinventory ./setup.sh

In general this will work on very recent Fedora, rawhide or F21. Future work to support RHEL7, CentOS, and possible other distros should be forthcoming.

Targeted runs

You can just setup certain parts instead of doing it all.

etcd

$ ./setup.sh --tags=etcd

Kubernetes master

$ ./setup.sh --tags=masters

kubernetes nodes

$ ./setup.sh --tags=nodes

flannel

$ ./setup.sh --tags=flannel

Analytics