Skip to content

Commit 5565d75

Browse files
authored
Merge branch 'master' into master
2 parents 96ad4c2 + 20b1cac commit 5565d75

File tree

30 files changed

+258
-148
lines changed

30 files changed

+258
-148
lines changed

01-path-basics/101-start-here/readme.adoc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ image:cloud9-run-script.png[Running the script in Cloud9 Terminal]
7777
[NOTE]
7878
All shell commands _(starting with "$")_ throughout the rest of the workshop should be run in this tab. You may want to resize it upwards to make it larger.
7979

80+
At this point you can restart the Cloud9 IDE terminal session to ensure that the kublectl completion is enabled. Once a new terminal window is opened, type $ kubectl get nodes.
81+
8082
One last step is required so that the Cloud9 IDE uses the assigned IAM Instance profile. Open the "AWS Cloud9" menu, go to "Preferences", go to "AWS Settings", and disable "AWS managed temporary credentials" as depicted in the diagram here:
8183

8284
image:cloud9-disable-temp-credentials.png[]
@@ -93,10 +95,14 @@ You are now ready to continue on with the workshop!
9395
|image:button-continue-standard.png[link=../102-your-first-cluster/]
9496
|image:button-continue-developer.png[link=../102-your-first-cluster/]
9597
|image:button-continue-operations.png[link=../102-your-first-cluster/]
98+
|link:../../standard-path.adoc[Go to Standard Index]
99+
|link:../../developer-path.adoc[Go to Developer Index]
100+
|link:../../operations-path.adoc[Go to Operations Index]
96101
|=====
97102

98103
The next step is link:../102-your-first-cluster[to create a Kubernetes cluster using kops].
99104

105+
100106
== Workshop Cleanup
101107

102108
Once you have finished with the workshop, please don't forget to spin down your cluster or you will incur additional charges.

01-path-basics/101-start-here/scripts/lab-ide-build.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,13 @@
1111
# Install jq
1212
sudo yum -y install jq
1313

14+
# Install bash-completion
15+
sudo yum install bash-completion -y
16+
1417
# Install kubectl
1518
curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
1619
chmod +x kubectl && sudo mv kubectl /usr/local/bin/
17-
source <(kubectl completion bash)
20+
echo "source <(kubectl completion bash)" >> ~/.bashrc
1821

1922
# Install kops
2023
curl -LO https://github.com/kubernetes/kops/releases/download/$(curl -s https://api.github.com/repos/kubernetes/kops/releases/latest | grep tag_name | cut -d '"' -f 4)/kops-linux-amd64
@@ -44,5 +47,7 @@ echo "export AWS_AVAILABILITY_ZONES KOPS_STATE_STORE" >> ~/.bash_profile
4447
# Create SSH key
4548
ssh-keygen -t rsa -N "" -f ~/.ssh/id_rsa
4649

47-
# Download lab Repository
48-
git clone https://github.com/aws-samples/aws-workshop-for-kubernetes
50+
if [ ! -d "aws-workshop-for-kubernetes/" ]; then
51+
# Download lab Repository
52+
git clone https://github.com/aws-samples/aws-workshop-for-kubernetes
53+
fi

01-path-basics/102-your-first-cluster/readme.adoc

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ If you have not set up the link:../101-start-here[Cloud9 Devlopment Environment,
1212
1313
== Create a Kubernetes Cluster with kops
1414
15-
kops can be used to create a highly available cluster, with multiple master and worker nodes spread across multiple availability zones.
15+
kops can be used to create a highly available cluster, with multiple master and worker nodes spread across multiple availability zones.
1616
The master and worker nodes within the cluster can use either DNS or the https://github.com/weaveworks/mesh[Weave Mesh, window="_blank"] *gossip* protocol for name resolution. For this workshop, we will use the gossip protocol. A gossip-based cluster is easier and quicker to setup, and does not does not require a domain, subdomain, or Route53 hosted zone to be registered. Instructions for creating a DNS-based cluster are provided as an appendix at the bottom of this page.
1717
1818
To create a cluster using the gossip protocol, simply use a cluster name with a suffix of `.k8s.local`. In the following steps, we will use `example.cluster.k8s.local` as a sample gossip cluster name. You may choose a different name as long as it ends with `.k8s.local`.
@@ -165,6 +165,9 @@ You are now ready to continue on with the workshop!
165165
|image:button-continue-standard.png[link=../103-kubernetes-concepts/]
166166
|image:button-continue-developer.png[link=../103-kubernetes-concepts/]
167167
|image:button-continue-operations.png[link=../103-kubernetes-concepts/]
168+
|link:../../standard-path.adoc[Go to Standard Index]
169+
|link:../../developer-path.adoc[Go to Developer Index]
170+
|link:../../operations-path.adoc[Go to Operations Index]
168171
|=====
169172
The next step is link:../103-kubernetes-concepts[to learn about basic Kubernetes Concepts].
170173

@@ -221,7 +224,7 @@ Although most of the exercises in this workshop should work on a cluster with a
221224

222225
=== (Optional) Turn on an API version for your Cluster
223226

224-
Note: This section is for Kubebernetes 1.7.x, in 1.8.x the api is `batch/v1beta1`.
227+
Note: This section is for Kubebernetes 1.7.x, in 1.8.x the api is `batch/v1beta1`.
225228

226229
Kubernetes resources are created with a specific API version. The exact value is defined by the `apiVersion` attribute in the resource configuration file. Some of the values are `v1`, `extensions/v1beta1` or `batch/v1`. By default, resources with `apiVersion` values X, Y, Z are enabled. If a resource has a version with the word `alpha` in it, then that version needs to be explicitly enabled in the cluster. For example, if you are running a Kubernetes cluster of version 1.7.x, then Cron Job resource cannot be created unless `batch/v2alpha1` is explicitly enabled.
227230

@@ -301,7 +304,7 @@ The output clearly shows that `--runtime-config=batch/v2alpha1=true` is passed a
301304

302305
=== (Optional) Delete A Cluster
303306

304-
Note: If you are going through the workshop paths, please do not delete the cluster you just created!
307+
Note: If you are going through the workshop paths, please do not delete the cluster you just created!
305308

306309
This information is to show you how to delete a cluster.
307310
(We will also provide these instructions at the end of the workshop.)
@@ -357,7 +360,7 @@ Create a Kubernetes cluster using the following command. For the purposes of thi
357360

358361
The `create cluster` command only creates and stores the cluster config in the S3 bucket. Adding `--yes` option ensures that the cluster is immediately created as well.
359362

360-
Alternatively, you may leave off the `--yes` option from the `kops create cluster` command. This will allow you to use `kops edit cluster example.cluster.com` command to view the current cluster state and make changes before actually creating the cluster.
363+
Alternatively, you may leave off the `--yes` option from the `kops create cluster` command. This will allow you to use `kops edit cluster example.cluster.com` command to view the current cluster state and make changes before actually creating the cluster.
361364

362365
The cluster creation, in that case, is started with the following command:
363366

@@ -443,4 +446,3 @@ Your cluster example.cluster.com is ready
443446
Note that all masters are spread across different AZs.
444447

445448
Your output may differ from the one shown here based up on the type of cluster you created.
446-

01-path-basics/103-kubernetes-concepts/readme.adoc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1446,7 +1446,7 @@ Alternatively, a namespace can be created using `kubectl` as well.
14461446

14471447
. Create a Deployment:
14481448

1449-
$ kubectl -n dev2 apply -f deployment.yaml
1449+
$ kubectl -n dev2 apply -f templates/deployment.yaml
14501450
deployment "nginx-deployment-ns" created
14511451

14521452
. Get Deployments in the newly created Namespace:
@@ -1646,4 +1646,7 @@ You are now ready to continue on with the workshop!
16461646
|image:button-continue-standard.png[link=../../02-path-working-with-clusters/201-cluster-monitoring]
16471647
|image:button-continue-developer.png[link=../../03-path-application-development/301-local-development]
16481648
|image:button-continue-operations.png[link=../../02-path-working-with-clusters/201-cluster-monitoring]
1649+
|link:../../standard-path.adoc[Go to Standard Index]
1650+
|link:../../developer-path.adoc[Go to Developer Index]
1651+
|link:../../operations-path.adoc[Go to Operations Index]
16491652
|=====

02-path-working-with-clusters/201-cluster-monitoring/readme.adoc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,4 +329,6 @@ You are now ready to continue on with the workshop!
329329
|=====
330330
|image:button-continue-standard.png[link=../../02-path-working-with-clusters/202-service-mesh]
331331
|image:button-continue-operations.png[link=../../02-path-working-with-clusters/202-service-mesh]
332-
|=====
332+
|link:../../standard-path.adoc[Go to Standard Index]
333+
|link:../../operations-path.adoc[Go to Operations Index]
334+
|=====

02-path-working-with-clusters/202-service-mesh/readme.adoc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -475,5 +475,6 @@ You are now ready to continue on with the workshop!
475475
|=====
476476
|image:button-continue-standard.png[link=../../02-path-working-with-clusters/203-cluster-upgrades]
477477
|image:button-continue-operations.png[link=../../02-path-working-with-clusters/203-cluster-upgrades]
478-
|=====
479-
478+
|link:../../standard-path.adoc[Go to Standard Index]
479+
|link:../../operations-path.adoc[Go to Operations Index]
480+
|=====

02-path-working-with-clusters/203-cluster-upgrades/readme.adoc

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ with 1.6.10 version and perform an automatic rolling upgrade to 1.7.2 using kops
1414

1515
=== Create cluster
1616

17-
Review steps to create link:../prereqs.adoc[prereqs] nad make sure `KOPS_STATE_STORE` and `AWS_AVAILABILITY_ZONES` environment variables are set. More details about creating a cluster are at link:../cluster-install[Create Kubernetes cluster using kops].
17+
Review steps to create link:../prereqs.adoc[prereqs] nad make sure `KOPS_STATE_STORE` and `AWS_AVAILABILITY_ZONES` environment variables are set. More details about creating a cluster are at link:../cluster-install[Create Kubernetes cluster using kops].
1818

1919
In this chapter, we'll create a Kubernetes 1.6.10 version cluster as shown:
2020

@@ -102,7 +102,7 @@ I1028 18:19:04.153174 10844 executor.go:91] Tasks: 78 done / 81 total; 3 can r
102102
I1028 18:19:04.575327 10844 executor.go:91] Tasks: 81 done / 81 total; 0 can run
103103
Will modify resources:
104104
LaunchConfiguration/master-eu-central-1a.masters.cluster.k8s.local
105-
UserData
105+
UserData
106106
...
107107
cat > kube_env.yaml << __EOF_KUBE_ENV
108108
Assets:
@@ -113,10 +113,10 @@ Will modify resources:
113113
- 1d9788b0f5420e1a219aad2cb8681823fc515e7c@https://storage.googleapis.com/kubernetes-release/network-plugins/cni-0799f5732f2a11b329d9e3d51b9c8f2e3759f2ff.tar.gz
114114
- c18ca557507c662e3a072c3475da9bd1bc8a503b@https://kubeupv2.s3.amazonaws.com/kops/1.7.1/linux/amd64/utils.tar.gz
115115
...
116-
116+
117117

118118
LaunchConfiguration/master-eu-central-1b.masters.cluster.k8s.local
119-
UserData
119+
UserData
120120
...
121121
cat > kube_env.yaml << __EOF_KUBE_ENV
122122
Assets:
@@ -127,10 +127,10 @@ Will modify resources:
127127
- 1d9788b0f5420e1a219aad2cb8681823fc515e7c@https://storage.googleapis.com/kubernetes-release/network-plugins/cni-0799f5732f2a11b329d9e3d51b9c8f2e3759f2ff.tar.gz
128128
- c18ca557507c662e3a072c3475da9bd1bc8a503b@https://kubeupv2.s3.amazonaws.com/kops/1.7.1/linux/amd64/utils.tar.gz
129129
...
130-
130+
131131

132132
LaunchConfiguration/master-eu-central-1c.masters.cluster.k8s.local
133-
UserData
133+
UserData
134134
...
135135
cat > kube_env.yaml << __EOF_KUBE_ENV
136136
Assets:
@@ -141,10 +141,10 @@ Will modify resources:
141141
- 1d9788b0f5420e1a219aad2cb8681823fc515e7c@https://storage.googleapis.com/kubernetes-release/network-plugins/cni-0799f5732f2a11b329d9e3d51b9c8f2e3759f2ff.tar.gz
142142
- c18ca557507c662e3a072c3475da9bd1bc8a503b@https://kubeupv2.s3.amazonaws.com/kops/1.7.1/linux/amd64/utils.tar.gz
143143
...
144-
144+
145145

146146
LaunchConfiguration/nodes.cluster.k8s.local
147-
UserData
147+
UserData
148148
...
149149
cat > kube_env.yaml << __EOF_KUBE_ENV
150150
Assets:
@@ -155,7 +155,7 @@ Will modify resources:
155155
- 1d9788b0f5420e1a219aad2cb8681823fc515e7c@https://storage.googleapis.com/kubernetes-release/network-plugins/cni-0799f5732f2a11b329d9e3d51b9c8f2e3759f2ff.tar.gz
156156
- c18ca557507c662e3a072c3475da9bd1bc8a503b@https://kubeupv2.s3.amazonaws.com/kops/1.7.1/linux/amd64/utils.tar.gz
157157
...
158-
158+
159159

160160
LoadBalancer/api.cluster.k8s.local
161161
Lifecycle <nil> -> Sync
@@ -298,4 +298,6 @@ You are now ready to continue on with the workshop!
298298
|=====
299299
|image:button-continue-standard.png[link=../../03-path-application-development/302-app-discovery]
300300
|image:button-continue-operations.png[link=../../02-path-working-with-clusters/204-cluster-logging-with-EFK]
301+
|link:../../standard-path.adoc[Go to Standard Index]
302+
|link:../../operations-path.adoc[Go to Operations Index]
301303
|=====

02-path-working-with-clusters/204-cluster-logging-with-EFK/readme.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ Fluentd log group name and stream name are configured in the file `templates/flu
7575
num_threads 8
7676
</match>
7777

78-
It uses the default log group name of `kubernetes-logs` and the log stream name of `fluentd-cloudwatch`.
78+
It uses the default log group name of `kubernetes-logs` and the log stream name of `fluentd-cloudwatch`.
7979

8080
If you've followed the instructions in this chapter as is, then no change is required in this configuration file. However if a different log group name is used in the previous command or a different log stream name is needed, then that needs to be configured in this configuration file.
8181

@@ -247,5 +247,5 @@ You are now ready to continue on with the workshop!
247247
[align="center", cols="1", grid="none", frame="none"]
248248
|=====
249249
|image:button-continue-operations.png[link=../../02-path-working-with-clusters/204-cluster-logging-with-EFK]
250+
|link:../../operations-path.adoc[Go to Operations Index]
250251
|=====
251-

02-path-working-with-clusters/205-cluster-autoscaling/readme.adoc

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -220,11 +220,11 @@ Before running the command below, update the following attributes in file `templ
220220

221221
You can find the name of nodes ASG using this command
222222

223-
$ aws autoscaling describe-auto-scaling-groups --query 'AutoScalingGroups[].AutoScalingGroupName'
223+
$ aws autoscaling describe-auto-scaling-groups --query 'AutoScalingGroups[].AutoScalingGroupName'
224224
[
225-
"master-eu-central-1a.masters.cluster.k8s.local",
226-
"master-eu-central-1b.masters.cluster.k8s.local",
227-
"master-eu-central-1c.masters.cluster.k8s.local",
225+
"master-eu-central-1a.masters.cluster.k8s.local",
226+
"master-eu-central-1b.masters.cluster.k8s.local",
227+
"master-eu-central-1c.masters.cluster.k8s.local",
228228
"nodes.example.cluster.k8s.local"
229229
]
230230

@@ -289,14 +289,14 @@ If you have deployed Heapster, as described in the link:../cluster-monitoring/RE
289289

290290
```
291291
$ kubectl top nodes
292-
NAME CPU(cores) CPU% MEMORY(bytes) MEMORY%
293-
ip-172-20-109-10.eu-central-1.compute.internal 543m 27% 1722Mi 44%
294-
ip-172-20-44-33.eu-central-1.compute.internal 125m 12% 2120Mi 57%
295-
ip-172-20-75-132.eu-central-1.compute.internal 607m 30% 1733Mi 44%
296-
ip-172-20-41-77.eu-central-1.compute.internal 450m 22% 1703Mi 44%
297-
ip-172-20-85-128.eu-central-1.compute.internal 86m 8% 2049Mi 55%
298-
ip-172-20-93-108.eu-central-1.compute.internal 534m 26% 1747Mi 45%
299-
ip-172-20-106-93.eu-central-1.compute.internal 522m 26% 1734Mi 44%
292+
NAME CPU(cores) CPU% MEMORY(bytes) MEMORY%
293+
ip-172-20-109-10.eu-central-1.compute.internal 543m 27% 1722Mi 44%
294+
ip-172-20-44-33.eu-central-1.compute.internal 125m 12% 2120Mi 57%
295+
ip-172-20-75-132.eu-central-1.compute.internal 607m 30% 1733Mi 44%
296+
ip-172-20-41-77.eu-central-1.compute.internal 450m 22% 1703Mi 44%
297+
ip-172-20-85-128.eu-central-1.compute.internal 86m 8% 2049Mi 55%
298+
ip-172-20-93-108.eu-central-1.compute.internal 534m 26% 1747Mi 45%
299+
ip-172-20-106-93.eu-central-1.compute.internal 522m 26% 1734Mi 44%
300300
ip-172-20-101-20.eu-central-1.compute.internal 101m 5% 2046Mi 55%
301301
```
302302

@@ -319,20 +319,20 @@ It takes a few minutes for the additional worker nodes to start and become part
319319

320320
```
321321
$ kubectl top nodes
322-
NAME CPU(cores) CPU% MEMORY(bytes) MEMORY%
323-
ip-172-20-85-128.eu-central-1.compute.internal 74m 7% 2088Mi 56%
324-
ip-172-20-93-108.eu-central-1.compute.internal 25m 1% 1734Mi 44%
325-
ip-172-20-109-10.eu-central-1.compute.internal 26m 1% 1716Mi 44%
326-
ip-172-20-86-51.eu-central-1.compute.internal 24m 1% 1075Mi 27%
327-
ip-172-20-51-221.eu-central-1.compute.internal 21m 1% 1074Mi 27%
328-
ip-172-20-61-253.eu-central-1.compute.internal 22m 1% 1075Mi 27%
329-
ip-172-20-41-77.eu-central-1.compute.internal 31m 1% 1716Mi 44%
330-
ip-172-20-106-93.eu-central-1.compute.internal 27m 1% 1745Mi 45%
331-
ip-172-20-101-20.eu-central-1.compute.internal 94m 4% 2078Mi 56%
332-
ip-172-20-44-33.eu-central-1.compute.internal 112m 11% 2148Mi 58%
333-
ip-172-20-116-218.eu-central-1.compute.internal 22m 1% 1070Mi 27%
334-
ip-172-20-44-50.eu-central-1.compute.internal 18m 0% 1076Mi 27%
335-
ip-172-20-75-132.eu-central-1.compute.internal 27m 1% 1723Mi 44%
322+
NAME CPU(cores) CPU% MEMORY(bytes) MEMORY%
323+
ip-172-20-85-128.eu-central-1.compute.internal 74m 7% 2088Mi 56%
324+
ip-172-20-93-108.eu-central-1.compute.internal 25m 1% 1734Mi 44%
325+
ip-172-20-109-10.eu-central-1.compute.internal 26m 1% 1716Mi 44%
326+
ip-172-20-86-51.eu-central-1.compute.internal 24m 1% 1075Mi 27%
327+
ip-172-20-51-221.eu-central-1.compute.internal 21m 1% 1074Mi 27%
328+
ip-172-20-61-253.eu-central-1.compute.internal 22m 1% 1075Mi 27%
329+
ip-172-20-41-77.eu-central-1.compute.internal 31m 1% 1716Mi 44%
330+
ip-172-20-106-93.eu-central-1.compute.internal 27m 1% 1745Mi 45%
331+
ip-172-20-101-20.eu-central-1.compute.internal 94m 4% 2078Mi 56%
332+
ip-172-20-44-33.eu-central-1.compute.internal 112m 11% 2148Mi 58%
333+
ip-172-20-116-218.eu-central-1.compute.internal 22m 1% 1070Mi 27%
334+
ip-172-20-44-50.eu-central-1.compute.internal 18m 0% 1076Mi 27%
335+
ip-172-20-75-132.eu-central-1.compute.internal 27m 1% 1723Mi 44%
336336
```
337337

338338
You are now ready to continue on with the workshop!
@@ -344,4 +344,5 @@ You are now ready to continue on with the workshop!
344344
[align="center", cols="1", grid="none", frame="none"]
345345
|=====
346346
|image:button-continue-operations.png[link=../../02-path-working-with-clusters/205-cluster-autoscaling]
347+
|link:../../operations-path.adoc[Go to Operations Index]
347348
|=====

02-path-working-with-clusters/206-cloudformation-and-terraform/readme.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ The following is an explanation of the input parameters:
3232
MasterInstanceType: EC2 instance type of master. # Defaulted to c4.xlarge
3333
NetworkProvider: Container networking provider. # Defaulted to none
3434
NodeInstanceType: EC2 instance type of nodes. # Defaulted to c4.large
35-
Nodes: Number of k8s nodes. # Defaulted to 3
35+
Nodes: Number of k8s nodes. # Defaulted to 3
3636

3737
NOTE: https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/[kubeadm] is used to create the cluster. Currently, it allows to create a single master, with a single etcd database running on it. This means your cluster is not highly available.
3838

@@ -50,4 +50,5 @@ You are now ready to continue on with the workshop!
5050
[align="center", cols="1", grid="none", frame="none"]
5151
|=====
5252
|image:button-continue-operations.png[link=../../04-path-security-and-networking/401-configmaps-and-secrets]
53+
|link:../../operations-path.adoc[Go to Operations Index]
5354
|=====

0 commit comments

Comments
 (0)