This document describes how to deploy kubernetes on multiple ubuntu nodes, including 1 master node and 3 minion nodes, and people uses this approach can scale to **any number of minion nodes** by changing some settings with ease. Although there exists saltstack based ubuntu k8s installation , it may be tedious and hard for a guy that knows little about saltstack but want to build a really distributed k8s cluster. This approach is inspired by [k8s deploy on a single node](https://github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/getting-started-guides/ubuntu_single_node.md).
[Cloud team from ZJU](https://github.com/ZJU-SEL) will keep updating this work.
*1 The minion nodes have installed docker version 1.2+*
*2 All machines can communicate with each orther, no need to connect Internet (should use private docker registry in this case)*
*3 These guide is tested OK on Ubuntu 14.04 LTS 64bit server, but it should also work on most Ubuntu versions*
*4 Dependences of this guide: etcd-2.0.0, flannel-0.2.0, k8s-0.10.1, but it should also work on higher versions*
### **Main Steps**
#### I. Make *kubernetes* , *etcd* and *flanneld* binaries
On your laptop, copy `cluster/ubuntu-cluster` directory to your workspace.
The `build.sh` will download and build all the needed binaries into `./binaries`.
```
$ cd cluster/ubuntu-cluster
$ sudo ./build.sh
```
Please copy all the files in `./binaries` into `/opt/bin` of every machine you want to run as Kubernetes cluster node.
Alternatively, if your Kubernetes nodes have access to Internet, you can copy `cluster/ubuntu-cluster` directory to every node and run:
```
# in every node
$ cd cluster/ubuntu-cluster
$ sudo ./build.sh
$ sudo cp ./binaries/* /opt/bin
```
> We used flannel here because we want to use overlay network, but please remember it is not the only choice, and it is also not a k8s' necessary dependence. Actually you can just build up k8s cluster natively, or use flannel, Open vSwitch or any other SDN tool you like, we just choose flannel here as a example.
#### II. Configue and install every components upstart script
This will make the docker daemon aware of flannel network.
**All done !**
#### IV. Validation
You can use kubectl command to see if the newly created k8s is working correctly.
For example , `$ kubectl get minions` to see if you get all your minion nodes comming up.
Also you can run kubernetes [guest-example](https://github.com/GoogleCloudPlatform/kubernetes/tree/master/examples/guestbook) to build a redis backend cluster on the k8s.
#### V. Trouble Shooting
Generally, what of this guide did is quite simple: