add support for aws

pull/48/merge
Kelsey Hightower 2016-09-10 20:00:31 -07:00
parent 82b3c26a42
commit f0fbfe87c4
2 changed files with 33 additions and 23 deletions

View File

@ -104,6 +104,14 @@ aws ec2 authorize-security-group-ingress \
--protocol all --protocol all
``` ```
```
aws ec2 authorize-security-group-ingress \
--group-id ${SECURITY_GROUP_ID} \
--protocol all \
--port 0-65535 \
--cidr 10.240.0.0/16
```
``` ```
aws ec2 authorize-security-group-ingress \ aws ec2 authorize-security-group-ingress \
--group-id ${SECURITY_GROUP_ID} \ --group-id ${SECURITY_GROUP_ID} \

View File

@ -2,16 +2,9 @@
In this lab you will bootstrap a 3 node etcd cluster. The following virtual machines will be used: In this lab you will bootstrap a 3 node etcd cluster. The following virtual machines will be used:
``` * etcd0
gcloud compute instances list * etcd1
``` * etcd2
````
NAME ZONE MACHINE_TYPE PREEMPTIBLE INTERNAL_IP EXTERNAL_IP STATUS
etcd0 us-central1-f n1-standard-1 10.240.0.10 XXX.XXX.XXX.XXX RUNNING
etcd1 us-central1-f n1-standard-1 10.240.0.11 XXX.XXX.XXX.XXX RUNNING
etcd2 us-central1-f n1-standard-1 10.240.0.12 XXX.XXX.XXX.XXX RUNNING
````
## Why ## Why
@ -27,8 +20,6 @@ following reasons:
Run the following commands on `etcd0`, `etcd1`, `etcd2`: Run the following commands on `etcd0`, `etcd1`, `etcd2`:
> SSH into each machine using the `gcloud compute ssh` command
Move the TLS certificates in place: Move the TLS certificates in place:
``` ```
@ -42,15 +33,15 @@ sudo mv ca.pem kubernetes-key.pem kubernetes.pem /etc/etcd/
Download and install the etcd binaries: Download and install the etcd binaries:
``` ```
wget https://github.com/coreos/etcd/releases/download/v3.0.1/etcd-v3.0.1-linux-amd64.tar.gz wget https://github.com/coreos/etcd/releases/download/v3.0.8/etcd-v3.0.8-linux-amd64.tar.gz
``` ```
``` ```
tar -xvf etcd-v3.0.1-linux-amd64.tar.gz tar -xvf etcd-v3.0.8-linux-amd64.tar.gz
``` ```
``` ```
sudo cp etcd-v3.0.1-linux-amd64/etcd* /usr/bin/ sudo cp etcd-v3.0.8-linux-amd64/etcd* /usr/bin/
``` ```
``` ```
@ -59,7 +50,6 @@ sudo mkdir -p /var/lib/etcd
Create the etcd systemd unit file: Create the etcd systemd unit file:
``` ```
cat > etcd.service <<"EOF" cat > etcd.service <<"EOF"
[Unit] [Unit]
@ -90,21 +80,35 @@ WantedBy=multi-user.target
EOF EOF
``` ```
### Set The Internal IP Address
#### GCE
``` ```
export INTERNAL_IP=$(curl -s -H "Metadata-Flavor: Google" \ export INTERNAL_IP=$(curl -s -H "Metadata-Flavor: Google" \
http://metadata.google.internal/computeMetadata/v1/instance/network-interfaces/0/ip) http://metadata.google.internal/computeMetadata/v1/instance/network-interfaces/0/ip)
``` ```
#### AWS
``` ```
export ETCD_NAME=$(hostname -s) export INTERNAL_IP=$(curl -s http://169.254.169.254/latest/meta-data/local-ipv4)
```
---
Set the etcd name:
```
export ETCD_NAME=etcd$(echo $INTERNAL_IP | cut -c 11)
``` ```
``` ```
sed -i s/INTERNAL_IP/$INTERNAL_IP/g etcd.service sed -i s/INTERNAL_IP/${INTERNAL_IP}/g etcd.service
``` ```
``` ```
sed -i s/ETCD_NAME/$ETCD_NAME/g etcd.service sed -i s/ETCD_NAME/${ETCD_NAME}/g etcd.service
``` ```
``` ```
@ -132,9 +136,7 @@ sudo systemctl status etcd --no-pager
Once all 3 etcd nodes have been bootstrapped verify the etcd cluster is healthy: Once all 3 etcd nodes have been bootstrapped verify the etcd cluster is healthy:
``` * SSH to etcd0 and run the following commands:
gcloud compute ssh etcd0
```
``` ```
etcdctl --ca-file=/etc/etcd/ca.pem cluster-health etcdctl --ca-file=/etc/etcd/ca.pem cluster-health
@ -145,4 +147,4 @@ member 3a57933972cb5131 is healthy: got healthy result from https://10.240.0.12:
member f98dc20bce6225a0 is healthy: got healthy result from https://10.240.0.10:2379 member f98dc20bce6225a0 is healthy: got healthy result from https://10.240.0.10:2379
member ffed16798470cab5 is healthy: got healthy result from https://10.240.0.11:2379 member ffed16798470cab5 is healthy: got healthy result from https://10.240.0.11:2379
cluster is healthy cluster is healthy
``` ```