add support for aws

pull/48/merge
Kelsey Hightower 2016-09-11 02:53:34 -07:00
parent ed7b9fc2da
commit 02f4bef7b3
2 changed files with 23 additions and 13 deletions

View File

@ -10,7 +10,9 @@ After completing this guide you should have the following compute instances:
To make our Kubernetes control plane remotely accessible, a public IP address will be provisioned and assigned to a Load Balancer that will sit in front of the 3 Kubernetes controllers. To make our Kubernetes control plane remotely accessible, a public IP address will be provisioned and assigned to a Load Balancer that will sit in front of the 3 Kubernetes controllers.
## Create a Custom Network ## Networking
### VPC
``` ```
VPC_ID=$(aws ec2 create-vpc \ VPC_ID=$(aws ec2 create-vpc \
@ -36,6 +38,8 @@ aws ec2 modify-vpc-attribute \
--enable-dns-hostnames '{"Value": true}' --enable-dns-hostnames '{"Value": true}'
``` ```
### DHCP Option Sets
``` ```
DHCP_OPTION_SET_ID=$(aws ec2 create-dhcp-options \ DHCP_OPTION_SET_ID=$(aws ec2 create-dhcp-options \
--dhcp-configuration "Key=domain-name,Values=us-west-2.compute.internal" \ --dhcp-configuration "Key=domain-name,Values=us-west-2.compute.internal" \
@ -55,6 +59,8 @@ aws ec2 associate-dhcp-options \
--vpc-id ${VPC_ID} --vpc-id ${VPC_ID}
``` ```
### Subnets
Create a subnet for the Kubernetes cluster: Create a subnet for the Kubernetes cluster:
``` ```
@ -70,7 +76,7 @@ aws ec2 create-tags \
--tags Key=Name,Value=kubernetes --tags Key=Name,Value=kubernetes
``` ```
Create an internet gateway ### Internet Gateways
``` ```
INTERNET_GATEWAY_ID=$(aws ec2 create-internet-gateway | \ INTERNET_GATEWAY_ID=$(aws ec2 create-internet-gateway | \
@ -89,7 +95,7 @@ aws ec2 attach-internet-gateway \
--vpc-id ${VPC_ID} --vpc-id ${VPC_ID}
``` ```
### Route Table ### Route Tables
``` ```
ROUTE_TABLE_ID=$(aws ec2 create-route-table \ ROUTE_TABLE_ID=$(aws ec2 create-route-table \
@ -162,9 +168,9 @@ aws ec2 authorize-security-group-ingress \
--cidr 0.0.0.0/0 --cidr 0.0.0.0/0
``` ```
## Create the Kubernetes Public IP Address ### Kubernetes Public Address
Create a public IP address that will be used by remote clients to connect to the Kubernetes control plane: An ELB will be used to load balance traffic across the Kubernetes control plane.
``` ```
aws elb create-load-balancer \ aws elb create-load-balancer \
@ -173,6 +179,7 @@ aws elb create-load-balancer \
--subnets ${SUBNET_ID} \ --subnets ${SUBNET_ID} \
--security-groups ${SECURITY_GROUP_ID} --security-groups ${SECURITY_GROUP_ID}
``` ```
``` ```
KUBERNETES_PUBLIC_IP_ADDRESS=$(aws elb describe-load-balancers \ KUBERNETES_PUBLIC_IP_ADDRESS=$(aws elb describe-load-balancers \
--load-balancer-name kubernetes | \ --load-balancer-name kubernetes | \
@ -257,7 +264,9 @@ chmod 600 ~/.ssh/kubernetes_the_hard_way
ssh-add ~/.ssh/kubernetes_the_hard_way ssh-add ~/.ssh/kubernetes_the_hard_way
``` ```
### etcd ### Virtual Machines
#### etcd
``` ```
ETCD_0_INSTANCE_ID=$(aws ec2 run-instances \ ETCD_0_INSTANCE_ID=$(aws ec2 run-instances \
@ -316,7 +325,7 @@ aws ec2 create-tags \
--tags Key=Name,Value=etcd2 --tags Key=Name,Value=etcd2
``` ```
### Kubernetes Controllers #### Kubernetes Controllers
``` ```
CONTROLLER_0_INSTANCE_ID=$(aws ec2 run-instances \ CONTROLLER_0_INSTANCE_ID=$(aws ec2 run-instances \
@ -378,7 +387,7 @@ aws ec2 create-tags \
--tags Key=Name,Value=controller2 --tags Key=Name,Value=controller2
``` ```
### Kubernetes Workers #### Kubernetes Workers
``` ```
WORKER_0_INSTANCE_ID=$(aws ec2 run-instances \ WORKER_0_INSTANCE_ID=$(aws ec2 run-instances \

View File

@ -25,7 +25,7 @@ worker2 us-central1-f n1-standard-1 10.240.0.32 XXX.XXX.XXX
To make our Kubernetes control plane remotely accessible, a public IP address will be provisioned and assigned to a Load Balancer that will sit in front of the 3 Kubernetes controllers. To make our Kubernetes control plane remotely accessible, a public IP address will be provisioned and assigned to a Load Balancer that will sit in front of the 3 Kubernetes controllers.
## Create a Custom Network ## Networking
``` ```
gcloud compute networks create kubernetes --mode custom gcloud compute networks create kubernetes --mode custom
@ -109,7 +109,7 @@ kubernetes-allow-rdp kubernetes 0.0.0.0/0 tcp:3389
kubernetes-allow-ssh kubernetes 0.0.0.0/0 tcp:22 kubernetes-allow-ssh kubernetes 0.0.0.0/0 tcp:22
``` ```
## Create the Kubernetes Public IP Address ### Kubernetes Public Address
Create a public IP address that will be used by remote clients to connect to the Kubernetes control plane: Create a public IP address that will be used by remote clients to connect to the Kubernetes control plane:
@ -129,8 +129,9 @@ kubernetes us-central1 XXX.XXX.XXX.XXX RESERVED
All the VMs in this lab will be provisioned using Ubuntu 16.04 mainly because it runs a newish Linux Kernel that has good support for Docker. All the VMs in this lab will be provisioned using Ubuntu 16.04 mainly because it runs a newish Linux Kernel that has good support for Docker.
### Virtual Machines
### etcd #### etcd
``` ```
gcloud compute instances create etcd0 \ gcloud compute instances create etcd0 \
@ -165,7 +166,7 @@ gcloud compute instances create etcd2 \
--subnet kubernetes --subnet kubernetes
``` ```
### Kubernetes Controllers #### Kubernetes Controllers
``` ```
gcloud compute instances create controller0 \ gcloud compute instances create controller0 \
@ -200,7 +201,7 @@ gcloud compute instances create controller2 \
--subnet kubernetes --subnet kubernetes
``` ```
### Kubernetes Workers #### Kubernetes Workers
``` ```
gcloud compute instances create worker0 \ gcloud compute instances create worker0 \