2014-11-11 05:35:57 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								## Getting started on AWS
 
							 
						 
					
						
							
								
									
										
										
										
											2014-11-06 19:06:30 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-11-11 05:35:57 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Prerequisites
 
							 
						 
					
						
							
								
									
										
										
										
											2014-11-06 19:06:30 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-11-07 06:27:15 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								1.  You need an AWS account. Visit [http://aws.amazon.com ](http://aws.amazon.com ) to get started
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								2.  Install and configure [AWS Command Line Interface ](http://aws.amazon.com/cli )
							 
						 
					
						
							
								
									
										
										
										
											2014-12-20 07:28:29 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								3.  You need an AWS [instance profile and role ](http://docs.aws.amazon.com/IAM/latest/UserGuide/instance-profiles.html ) with EC2 full access.
							 
						 
					
						
							
								
									
										
										
										
											2014-11-06 19:06:30 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-11-11 05:55:34 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Cluster turnup
 
							 
						 
					
						
							
								
									
										
										
										
											2014-11-07 06:27:15 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-11-18 13:49:56 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								#### Download Kubernetes
 
							 
						 
					
						
							
								
									
										
										
										
											2015-02-06 12:21:38 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								##### a) Preferred Option: Install from [0.10.0 release](https://github.com/GoogleCloudPlatform/kubernetes/releases/tag/v0.10.0)
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								1.  ```wget https://github.com/GoogleCloudPlatform/kubernetes/releases/download/v0.10.0/kubernetes.tar.gz```
							 
						 
					
						
							
								
									
										
										
										
											2014-11-18 13:49:56 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								2.  ```tar -xzf kubernetes.tar.gz; cd kubernetes```
							 
						 
					
						
							
								
									
										
										
										
											2014-11-25 13:26:32 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								3.  ```export PATH=$PATH:$PWD/platforms/< os > /< platform > ```
							 
						 
					
						
							
								
									
										
										
										
											2014-11-18 13:41:13 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-11-18 13:49:56 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								##### b) Alternate Option: Install from source at head
 
							 
						 
					
						
							
								
									
										
										
										
											2014-11-11 05:55:34 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								1.  ```git clone https://github.com/GoogleCloudPlatform/kubernetes.git```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								2.  ```cd kubernetes; make release```
							 
						 
					
						
							
								
									
										
										
										
											2014-11-18 13:49:56 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								3.  ```export PATH=$PATH:$PWD/_output/local/bin/< os > /< platform > ```
							 
						 
					
						
							
								
									
										
										
										
											2014-11-25 00:09:08 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-11-11 05:55:34 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								#### Turn up the cluster
 
							 
						 
					
						
							
								
									
										
										
										
											2014-11-06 19:06:30 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
									
										
										
										
											2014-11-07 06:27:15 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								export KUBERNETES_PROVIDER=aws
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								cluster/kube-up.sh
							 
						 
					
						
							
								
									
										
										
										
											2014-11-06 19:06:30 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-11-11 05:35:57 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								The script above relies on AWS S3 to deploy the software to instances running in EC2.
							 
						 
					
						
							
								
									
										
										
										
											2014-11-06 19:06:30 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-02-06 12:21:38 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								NOTE: The script will provision a new VPC and a 5 node k8s cluster in us-west-2 (Oregon). It'll also try to create a keypair called "kubernetes" as well as create or reuse an IAM role also called "kubernetes" so make sure one doesn't already exist prior to running the script in order to elminate a potential conflict.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Once the cluster is up, it will print the ip address of your cluster, this process takes ~5 minutes.
							 
						 
					
						
							
								
									
										
										
										
											2014-11-18 13:41:13 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								export KUBERNETES_MASTER=https://< ip-address > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-11-18 13:49:56 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								Also setup your path to point to the released binaries:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
									
										
										
										
											2015-02-06 12:21:38 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								export PATH=$PATH:$PWD:/cluster
							 
						 
					
						
							
								
									
										
										
										
											2014-11-18 13:49:56 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-11-07 06:27:15 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Running examples
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								Take a look at [next steps ](https://github.com/GoogleCloudPlatform/kubernetes#where-to-go-next )
							 
						 
					
						
							
								
									
										
										
										
											2014-11-06 19:06:30 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-11-07 06:27:15 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Tearing down the cluster
 
							 
						 
					
						
							
								
									
										
										
										
											2014-11-06 19:06:30 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
									
										
										
										
											2014-11-07 06:27:15 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								cd kubernetes
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								cluster/kube-down.sh
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-11-18 13:49:56 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### Cloud Formation [optional]
 
							 
						 
					
						
							
								
									
										
										
										
											2014-11-11 05:55:34 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								There is a contributed [example ](aws-coreos.md ) from [CoreOS ](http://www.coreos.com ) using Cloud Formation.