Skip to content
This repository was archived by the owner on Jul 30, 2021. It is now read-only.

Commit a06bd34

Browse files
authored
Merge pull request #202 from aaronlevy/qsname
Specify cluster identifier in quickstart guides
2 parents f8c47c3 + 9731c1f commit a06bd34

File tree

2 files changed

+29
-13
lines changed

2 files changed

+29
-13
lines changed

hack/quickstart/quickstart-aws.md

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,35 @@
11
## AWS Quickstart
22

3+
### Choose a cluster prefix
4+
5+
This can be changed to identify separate clusters.
6+
7+
```
8+
export CLUSTER_PREFIX=quickstart
9+
```
10+
311
### Configure Security Groups
412

513
Make note of the `GroupId` output of this command, as it will be referenced later in this guide as `<K8S_SG_ID>`.
614

715
```
8-
$ aws ec2 create-security-group --region us-west-2 --group-name k8s-sg --description "Security group for k8s cluster"
16+
$ aws ec2 create-security-group --region us-west-2 --group-name ${CLUSTER_PREFIX}-sg --description "Security group for ${CLUSTER_PREFIX} cluster"
917
GroupID: "sg-abcdefg"
1018
```
1119

1220
Next, create the security group rules.
1321

1422
```
15-
$ aws ec2 authorize-security-group-ingress --region us-west-2 --group-name k8s-sg --protocol tcp --port 22 --cidr 0.0.0.0/0
16-
$ aws ec2 authorize-security-group-ingress --region us-west-2 --group-name k8s-sg --protocol tcp --port 443 --cidr 0.0.0.0/0
17-
$ aws ec2 authorize-security-group-ingress --region us-west-2 --group-name k8s-sg --protocol tcp --port 0-65535 --source-group k8s-sg
23+
$ aws ec2 authorize-security-group-ingress --region us-west-2 --group-name ${CLUSTER_PREFIX}-sg --protocol tcp --port 22 --cidr 0.0.0.0/0
24+
$ aws ec2 authorize-security-group-ingress --region us-west-2 --group-name ${CLUSTER_PREFIX}-sg --protocol tcp --port 443 --cidr 0.0.0.0/0
25+
$ aws ec2 authorize-security-group-ingress --region us-west-2 --group-name ${CLUSTER_PREFIX}-sg --protocol tcp --port 0-65535 --source-group k8s-sg
1826
```
1927

2028
### Create a key-pair
2129

2230
```
23-
$ aws ec2 create-key-pair --key-name k8s-key --query 'KeyMaterial' --output text > k8s-key.pem
24-
$ chmod 400 k8s-key.pem
31+
$ aws ec2 create-key-pair --key-name ${CLUSTER_PREFIX}-key --query 'KeyMaterial' --output text > ${CLUSTER_PREFIX}-key.pem
32+
$ chmod 400 ${CLUSTER_PREFIX}-key.pem
2533
```
2634

2735
### Launch Nodes
@@ -31,7 +39,7 @@ To find the latest CoreOS alpha/beta/stable images, please see the [CoreOS AWS D
3139
In the command below, replace `<K8S_SG_ID>` with the security-group-id noted earlier.
3240

3341
```
34-
$ aws ec2 run-instances --region us-west-2 --image-id ami-184a8f78 --security-group-ids <K8S_SG_ID> --count 1 --instance-type m3.medium --key-name k8s-key --query 'Instances[0].InstanceId'
42+
$ aws ec2 run-instances --region us-west-2 --image-id ami-184a8f78 --security-group-ids <K8S_SG_ID> --count 1 --instance-type m3.medium --key-name ${CLUSTER_PREFIX}-key --query 'Instances[0].InstanceId'
3543
"i-abcdefgh"
3644
```
3745

hack/quickstart/quickstart-gce.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,30 @@
11
## GCE Quickstart
22

3+
### Choose a cluster prefix
4+
5+
This can be changed to identify separate clusters.
6+
7+
```
8+
export CLUSTER_PREFIX=quickstart
9+
```
10+
311
### Launch Nodes
412

513
To find the latest CoreOS alpha/beta/stable images, please see the [CoreOS GCE Documentation](https://coreos.com/os/docs/latest/booting-on-google-compute-engine.html). Then replace the `--image` flag in the command below.
614

715
Launch nodes:
816

917
```
10-
$ gcloud compute instances create k8s-core1 \
18+
$ gcloud compute instances create ${CLUSTER_PREFIX}-core1 \
1119
--image https://www.googleapis.com/compute/v1/projects/coreos-cloud/global/images/coreos-stable-1068-9-0-v20160809 \
1220
--zone us-central1-a --machine-type n1-standard-1
1321
```
1422

1523
Tag the first node as an apiserver node, and allow traffic to 443 on that node.
1624

1725
```
18-
$ gcloud compute instances add-tags k8s-core1 --tags apiserver
19-
$ gcloud compute firewall-rules create api-443 --target-tags=apiserver --allow tcp:443
26+
$ gcloud compute instances add-tags ${CLUSTER_PREFIX}-core1 --tags ${CLUSTER_PREFIX}-apiserver
27+
$ gcloud compute firewall-rules create ${CLUSTER_PREFIX}-443 --target-tags= ${CLUSTER_PREFIX}-apiserver --allow tcp:443
2028
```
2129

2230
### Bootstrap Master
@@ -35,13 +43,13 @@ $ kubectl --kubeconfig=cluster/auth/kubeconfig get nodes
3543

3644
### Add Workers
3745

38-
Run the `Launch Nodes` step for each additional node you wish to add (changing the name from `k8s-core1`)
46+
Run the `Launch Nodes` step for each additional node you wish to add (changing the name from ` ${CLUSTER_PREFIX}-core1`)
3947

4048
Get the EXTERNAL_IP from each node you wish to add:
4149

4250
```
43-
$ gcloud compute instances list k8s-core2
44-
$ gcloud compute instances list k8s-core3
51+
$ gcloud compute instances list ${CLUSTER_PREFIX}-core2
52+
$ gcloud compute instances list ${CLUSTER_PREFIX}-core3
4553
```
4654

4755
Initialize each worker node by replacing `<node-ip>` with the EXTERNAL_IP from the commands above.

0 commit comments

Comments
 (0)