| 
									
										
										
										
											2015-07-12 12:04:52 +08:00
										 |  |  | <!-- BEGIN MUNGE: UNVERSIONED_WARNING --> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | <!-- BEGIN STRIP_FOR_RELEASE --> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-17 01:02:26 +08:00
										 |  |  | <img src="http://kubernetes.io/img/warning.png" alt="WARNING" | 
					
						
							|  |  |  |      width="25" height="25"> | 
					
						
							|  |  |  | <img src="http://kubernetes.io/img/warning.png" alt="WARNING" | 
					
						
							|  |  |  |      width="25" height="25"> | 
					
						
							|  |  |  | <img src="http://kubernetes.io/img/warning.png" alt="WARNING" | 
					
						
							|  |  |  |      width="25" height="25"> | 
					
						
							|  |  |  | <img src="http://kubernetes.io/img/warning.png" alt="WARNING" | 
					
						
							|  |  |  |      width="25" height="25"> | 
					
						
							|  |  |  | <img src="http://kubernetes.io/img/warning.png" alt="WARNING" | 
					
						
							|  |  |  |      width="25" height="25"> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | <h2>PLEASE NOTE: This document applies to the HEAD of the source tree</h2> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | If you are using a released version of Kubernetes, you should | 
					
						
							|  |  |  | refer to the docs that go with that version. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | <strong> | 
					
						
							|  |  |  | The latest 1.0.x release of this document can be found | 
					
						
							|  |  |  | [here](http://releases.k8s.io/release-1.0/docs/getting-started-guides/docker-multinode.md). | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Documentation for other releases can be found at | 
					
						
							|  |  |  | [releases.k8s.io](http://releases.k8s.io). | 
					
						
							|  |  |  | </strong> | 
					
						
							|  |  |  | -- | 
					
						
							| 
									
										
										
										
											2015-07-14 06:15:35 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-12 12:04:52 +08:00
										 |  |  | <!-- END STRIP_FOR_RELEASE --> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | <!-- END MUNGE: UNVERSIONED_WARNING --> | 
					
						
							| 
									
										
										
										
											2015-06-23 03:39:35 +08:00
										 |  |  | Running Multi-Node Kubernetes Using Docker | 
					
						
							|  |  |  | ------------------------------------------ | 
					
						
							| 
									
										
										
										
											2015-04-07 07:29:46 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-04-07 12:47:04 +08:00
										 |  |  | _Note_: | 
					
						
							|  |  |  | These instructions are somewhat significantly more advanced than the [single node](docker.md) instructions.  If you are | 
					
						
							| 
									
										
										
										
											2015-04-07 07:29:46 +08:00
										 |  |  | interested in just starting to explore Kubernetes, we recommend that you start there. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-14 11:58:33 +08:00
										 |  |  | _Note_: | 
					
						
							|  |  |  | There is a [bug](https://github.com/docker/docker/issues/14106) in Docker 1.7.0 that prevents this from working correctly. | 
					
						
							| 
									
										
										
										
											2015-07-30 04:38:28 +08:00
										 |  |  | Please install Docker 1.6.2 or Docker 1.7.1. | 
					
						
							| 
									
										
										
										
											2015-07-14 11:58:33 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-06-23 03:39:35 +08:00
										 |  |  | **Table of Contents** | 
					
						
							| 
									
										
										
										
											2015-06-23 02:56:19 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-06-23 23:20:31 +08:00
										 |  |  | - [Prerequisites](#prerequisites) | 
					
						
							|  |  |  | - [Overview](#overview) | 
					
						
							|  |  |  |   - [Bootstrap Docker](#bootstrap-docker) | 
					
						
							|  |  |  | - [Master Node](#master-node) | 
					
						
							|  |  |  | - [Adding a worker node](#adding-a-worker-node) | 
					
						
							| 
									
										
										
										
											2015-08-14 05:53:15 +08:00
										 |  |  | - [Deploy a DNS](#deploy-a-dns) | 
					
						
							| 
									
										
										
										
											2015-06-23 23:20:31 +08:00
										 |  |  | - [Testing your cluster](#testing-your-cluster) | 
					
						
							| 
									
										
										
										
											2015-04-07 07:29:46 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-06-23 03:39:35 +08:00
										 |  |  | ## Prerequisites
 | 
					
						
							| 
									
										
										
										
											2015-07-18 06:35:41 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-30 23:07:53 +08:00
										 |  |  | 1. You need a machine with docker of right version installed. | 
					
						
							| 
									
										
										
										
											2015-07-23 11:09:05 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-04-07 12:47:04 +08:00
										 |  |  | ## Overview
 | 
					
						
							| 
									
										
										
										
											2015-07-18 06:35:41 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-21 04:45:36 +08:00
										 |  |  | This guide will set up a 2-node Kubernetes cluster, consisting of a _master_ node which hosts the API server and orchestrates work | 
					
						
							| 
									
										
										
										
											2015-04-07 12:47:04 +08:00
										 |  |  | and a _worker_ node which receives work from the master.  You can repeat the process of adding worker nodes an arbitrary number of | 
					
						
							|  |  |  | times to create larger clusters. | 
					
						
							| 
									
										
										
										
											2015-04-07 07:29:46 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-04-07 12:47:04 +08:00
										 |  |  | Here's a diagram of what the final result will look like: | 
					
						
							|  |  |  |  | 
					
						
							| 
									
										
										
										
											2015-04-07 07:29:46 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-04-07 12:47:04 +08:00
										 |  |  | ### Bootstrap Docker
 | 
					
						
							| 
									
										
										
										
											2015-07-18 06:35:41 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-04-07 12:47:04 +08:00
										 |  |  | This guide also uses a pattern of running two instances of the Docker daemon | 
					
						
							| 
									
										
										
										
											2015-07-19 13:58:13 +08:00
										 |  |  |    1) A _bootstrap_ Docker instance which is used to start system daemons like `flanneld` and `etcd` | 
					
						
							| 
									
										
										
										
											2015-04-07 12:47:04 +08:00
										 |  |  |    2) A _main_ Docker instance which is used for the Kubernetes infrastructure and user's scheduled containers | 
					
						
							| 
									
										
										
										
											2015-04-07 07:29:46 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-19 13:58:13 +08:00
										 |  |  | This pattern is necessary because the `flannel` daemon is responsible for setting up and managing the network that interconnects | 
					
						
							| 
									
										
										
										
											2015-04-07 12:47:04 +08:00
										 |  |  | all of the Docker containers created by Kubernetes.  To achieve this, it must run outside of the _main_ Docker daemon.  However, | 
					
						
							|  |  |  | it is still useful to use containers for deployment and management, so we create a simpler _bootstrap_ daemon to achieve this. | 
					
						
							| 
									
										
										
										
											2015-04-07 07:29:46 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-09-07 14:16:45 +08:00
										 |  |  | You can specify k8s version on very node before install: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ``` | 
					
						
							|  |  |  | export K8S_VERSION=<your_k8s_version (e.g. 1.0.3)> | 
					
						
							|  |  |  | ``` | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Otherwise, we'll use latest `hyperkube` image as default k8s version. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-04-07 12:47:04 +08:00
										 |  |  | ## Master Node
 | 
					
						
							| 
									
										
										
										
											2015-07-18 06:35:41 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-04-07 12:47:04 +08:00
										 |  |  | The first step in the process is to initialize the master node. | 
					
						
							| 
									
										
										
										
											2015-04-07 07:29:46 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-22 17:54:36 +08:00
										 |  |  | Clone the Kubernetes repo, and run [master.sh](docker-multinode/master.sh) on the master machine with root: | 
					
						
							| 
									
										
										
										
											2015-07-23 11:09:05 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-22 17:54:36 +08:00
										 |  |  | ```sh | 
					
						
							| 
									
										
										
										
											2015-08-14 21:42:07 +08:00
										 |  |  | cd kubernetes/docs/getting-started-guides/docker-multinode/ | 
					
						
							| 
									
										
										
										
											2015-07-22 17:54:36 +08:00
										 |  |  | ./master.sh | 
					
						
							|  |  |  | ``` | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | `Master done!` | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-08-10 02:18:06 +08:00
										 |  |  | See [here](docker-multinode/master.md) for detailed instructions explanation. | 
					
						
							| 
									
										
										
										
											2015-04-07 07:29:46 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-04-07 12:47:04 +08:00
										 |  |  | ## Adding a worker node
 | 
					
						
							| 
									
										
										
										
											2015-04-07 07:29:46 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-04-07 12:47:04 +08:00
										 |  |  | Once your master is up and running you can add one or more workers on different machines. | 
					
						
							| 
									
										
										
										
											2015-04-07 07:29:46 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-23 11:09:05 +08:00
										 |  |  | Clone the Kubernetes repo, and run [worker.sh](docker-multinode/worker.sh) on the worker machine with root: | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-22 17:54:36 +08:00
										 |  |  | ```sh | 
					
						
							| 
									
										
										
										
											2015-07-30 04:38:28 +08:00
										 |  |  | export MASTER_IP=<your_master_ip (e.g. 1.2.3.4)> | 
					
						
							| 
									
										
										
										
											2015-08-14 21:42:07 +08:00
										 |  |  | cd kubernetes/docs/getting-started-guides/docker-multinode/ | 
					
						
							| 
									
										
										
										
											2015-07-22 17:54:36 +08:00
										 |  |  | ./worker.sh | 
					
						
							|  |  |  | ``` | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | `Worker done!` | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-08-10 02:18:06 +08:00
										 |  |  | See [here](docker-multinode/worker.md) for detailed instructions explanation. | 
					
						
							| 
									
										
										
										
											2015-04-07 07:29:46 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-08-14 05:53:15 +08:00
										 |  |  | ## Deploy a DNS
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | See [here](docker-multinode/deployDNS.md) for instructions. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-04-07 12:47:04 +08:00
										 |  |  | ## Testing your cluster
 | 
					
						
							| 
									
										
										
										
											2015-04-07 07:29:46 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-01 13:16:59 +08:00
										 |  |  | Once your cluster has been created you can [test it out](docker-multinode/testing.md) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-10 09:02:10 +08:00
										 |  |  | For more complete applications, please look in the [examples directory](../../examples/) | 
					
						
							| 
									
										
										
										
											2015-05-15 06:12:45 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-14 08:13:09 +08:00
										 |  |  | <!-- BEGIN MUNGE: GENERATED_ANALYTICS --> | 
					
						
							| 
									
										
										
										
											2015-05-15 06:12:45 +08:00
										 |  |  | []() | 
					
						
							| 
									
										
										
										
											2015-07-14 08:13:09 +08:00
										 |  |  | <!-- END MUNGE: GENERATED_ANALYTICS --> |