Skip to content

Commit 3dedeab

Browse files
Merge pull request #121 from syedriko/tutorial_fixes_20190405
Misc fixes to chapters 1 and 2: spelling, capitalization, shell commands
2 parents 9dc8822 + 4d06b6d commit 3dedeab

12 files changed

Lines changed: 120 additions & 103 deletions

File tree

README-DEV.adoc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ You can preview changes as you make them as follows:
77
1. Install the `antora` website generator and `gulp` build system
88
+
99
....
10-
npm install -g @antora/cli @antora/site-generator-default gulp@^3.9.1 gulp-connect yaml-js
10+
npm install @antora/cli @antora/site-generator-default gulp@^3.9.1 gulp-connect yaml-js
1111
....
1212
1313
2. Create a `dev-site.yml` file (the `site.yml` file is for the public website)
@@ -27,6 +27,11 @@ content:
2727
- url: .
2828
branches: HEAD
2929
start_path: documentation
30+
asciidoc:
31+
attributes:
32+
tutorial-namespace: knativetutorial
33+
extensions:
34+
- ./lib/copy-to-clipboard.js
3035

3136
ui:
3237
bundle:

documentation/modules/ROOT/nav.adoc

Lines changed: 23 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,27 @@
22
** xref:01-setup.adoc#prerequisite[Prerequisites]
33
** xref:01-setup.adoc#download-tutorial-sources[Download Tutorial Sources]
44
** xref:01-setup.adoc#kubernetes-cluster[Kubernetes Cluster]
5-
*** xref:01-setup.adoc#install-knative-minikube[Install with Minikube ]
6-
**** xref:01-setup.adoc#start-minikube[Configure and Start minikube ]
5+
*** xref:01-setup.adoc#install-knative-minikube[Install with Minikube]
6+
**** xref:01-setup.adoc#start-minikube[Configure and Start Minikube]
77
**** xref:01-setup.adoc#install-knative-istio[Install Istio ]
8-
**** xref:01-setup.adoc#install-knative-serving[Install Knative Serving ]
8+
**** xref:01-setup.adoc#install-knative-serving[Install Knative Serving]
99
**** xref:01-setup.adoc#install-knative-build[Install Knative Build]
10-
**** xref:01-setup.adoc#install-knative-eventing[Install Knative Eventing ]
11-
**** xref:01-setup.adoc#set-knative-tutorial-ns[Configuring Kubernetes namespace ]
10+
**** xref:01-setup.adoc#install-knative-eventing[Install Knative Eventing]
11+
**** xref:01-setup.adoc#set-knative-tutorial-ns[Configuring Kubernetes Namespace]
1212
*** xref:01-setup.adoc#install-knative-openshift[Install with OpenShift]
1313
**** xref:01-setup.adoc#install-knative-ocp[Install on OCP]
1414
**** xref:01-setup.adoc#install-knative-minishift[Install on Minishift]
15-
**** xref:01-setup.adoc#configure-openshift-project[Configure OpenShift project]
15+
**** xref:01-setup.adoc#configure-openshift-project[Configure OpenShift Project]
1616
** xref:01-setup.adoc#setup-work-folder[Work Folder]
1717
1818
* xref:02-basic-fundas.adoc[2. Basics and Fundamentals]
1919
** xref:02-basic-fundas.adoc#basics-prerequisite[Prerequisites]
2020
** xref:02-basic-fundas.adoc#basics-build-containers[Build Containers]
2121
** xref:02-basic-fundas.adoc#basics-deploy-service[Deploy Service]
2222
** xref:02-basic-fundas.adoc#basics-invoke-service[Invoke Service]
23-
** xref:02-basic-fundas.adoc#basics-see-what-you-have-deployed[See what you have deployed]
24-
** xref:02-basic-fundas.adoc#deploying-new-revision[Deploy new Revision Service]
25-
** xref:02-basic-fundas.adoc#basics-pinning-revision[Pinning service to a revision]
23+
** xref:02-basic-fundas.adoc#basics-see-what-you-have-deployed[See What You Have Deployed]
24+
** xref:02-basic-fundas.adoc#deploying-new-revision[Deploy a New Revision of a Service]
25+
** xref:02-basic-fundas.adoc#basics-pinning-revision[Pinning Service to a Revision]
2626
** xref:02-basic-fundas.adoc#basics-cleanup[Cleanup]
2727
2828
* xref:03-configs-and-routes.adoc[3. Configurations and Routes]
@@ -31,8 +31,8 @@
3131
** xref:03-configs-and-routes.adoc#crtd-deploy-configuration[Deploy Configuration]
3232
** xref:03-configs-and-routes.adoc#crtd-invoke-service[Invoke Service]
3333
** xref:03-configs-and-routes.adoc#crtd-deploy-route[Deploy Route]
34-
** xref:03-configs-and-routes.adoc#crtd-see-what-you-have-deployed[See what you have deployed]
35-
** xref:03-configs-and-routes.adoc#crtd-deploying-new-revision[Deploy new Revision Service]
34+
** xref:03-configs-and-routes.adoc#crtd-see-what-you-have-deployed[See What You Have Deployed]
35+
** xref:03-configs-and-routes.adoc#crtd-deploying-new-revision[Deploy a New Revision of a Service]
3636
** xref:03-configs-and-routes.adoc#crtd-distributing-traffic[Distributing Traffic]
3737
** xref:03-configs-and-routes.adoc#ctrd-cleanup[Cleanup]
3838
@@ -42,38 +42,38 @@
4242
** xref:04-scaling.adoc#scaling-deploy-service[Deploy Service]
4343
** xref:04-scaling.adoc#scaling-invoke-service[Invoke Service]
4444
** xref:04-scaling.adoc#scaling-scale-to-zero[Scale to Zero]
45-
*** xref:04-scaling.adoc#scaling-observer-scale-to-zero[Observing default scale down ]
46-
*** xref:04-scaling.adoc#scaling-observer-scale-to-zero-1m[Change scale-to-zero time]
45+
*** xref:04-scaling.adoc#scaling-observer-scale-to-zero[Observing Default Scale Down]
46+
*** xref:04-scaling.adoc#scaling-observer-scale-to-zero-1m[Change Scale-to-Zero Time]
4747
*** xref:04-scaling.adoc#scaling-reset-to-defaults[Reset to Defaults]
4848
** xref:04-scaling.adoc#scaling-auto-scaling[Auto Scaling]
4949
*** xref:04-scaling.adoc#scaling-autoscaling-deploy-service[Deploy Service]
5050
*** xref:04-scaling.adoc#scaling-autoscaling-invoke-service[Invoke Service]
5151
*** xref:04-scaling.adoc#scaling-load-service[Load Service]
5252
** xref:04-scaling.adoc#scaling-min-scale[Minimum Scale]
53-
*** xref:04-scaling.adoc#scaling-deploy-service-minscale[Deploy service ]
53+
*** xref:04-scaling.adoc#scaling-deploy-service-minscale[Deploy Service]
5454
** xref:04-scaling.adoc#scaling-cleanup[Cleanup]
5555
5656
* xref:05-build/build.adoc[5. Build]
5757
** xref:05-build/build.adoc#build-prerequisite[Prerequisites]
5858
*** xref:05-build/build.adoc#build-edit-cr-secret[Edit Container Registry Secret]
5959
*** xref:05-build/build.adoc#build-edit-build-spec[Edit Build Spec]
60-
*** xref:05-build/build.adoc#build-edit-knative-service[Edit Knative service]
60+
*** xref:05-build/build.adoc#build-edit-knative-service[Edit Knative Service]
6161
*** xref:05-build/build.adoc#build-apply-prereq-resources[Apply Resources]
6262
** xref:05-build/build.adoc#build-create-build[Create Build]
63-
** xref:05-build/build.adoc#build-see-what-you-have-deployed[See what you have deployed]
64-
** xref:05-build/build.adoc#build-watching-logs[Watching logs]
63+
** xref:05-build/build.adoc#build-see-what-you-have-deployed[See What You Have Deployed]
64+
** xref:05-build/build.adoc#build-watching-logs[Watching Logs]
6565
** xref:05-build/build.adoc#build-build-status[Build Status]
6666
** xref:05-build/build.adoc#build-deploy-service-build[Deploy Service]
6767
** xref:05-build/build.adoc#build-invoke-service[Invoke Service]
6868
** xref:05-build/build.adoc#build-build-cleanup[Cleanup]
6969
7070
* xref:05-build/build-templates.adoc[6. Build Template]
7171
** xref:05-build/build-templates.adoc#build-template-prerequisite[Prerequisites]
72-
*** xref:05-build/build-templates.adoc#build-template-template[Build template]
73-
*** xref:05-build/build-templates.adoc#build-template-edit-service[Edit Knative service]
72+
*** xref:05-build/build-templates.adoc#build-template-template[Build Template]
73+
*** xref:05-build/build-templates.adoc#build-template-edit-service[Edit Knative Service]
7474
** xref:05-build/build-templates.adoc#build-template-apply-resources[Apply Resources]
7575
*** xref:05-build/build-templates.adoc#build-template-create-template[Create Build Template]
76-
*** xref:05-build/build-templates.adoc#build-see-what-you-have-deployed[See what you have deployed]
76+
*** xref:05-build/build-templates.adoc#build-see-what-you-have-deployed[See What You Have Deployed]
7777
** xref:05-build/build-templates.adoc#build-deploy-service-build-template[Deploy Service]
7878
** xref:05-build/build-templates.adoc#build-template-invoke-service[Invoke Service]
7979
** xref:05-build/build-templates.adoc#build-template-cleanup[Cleanup]
@@ -88,9 +88,8 @@
8888
*** xref:06-eventing/eventing-src-svc.adoc#eventing-sink-service[Sink Service]
8989
**** xref:06-eventing/eventing-src-svc.adoc#eventing-gen-sink-service[Generate Service]
9090
**** xref:06-eventing/eventing-src-svc.adoc#eventing-deploy-sink-service[Deploy Service]
91-
*** xref:06-eventing/eventing-src-svc.adoc#eventing-see-what-you-have-deployed[See what you have deployed]
91+
*** xref:06-eventing/eventing-src-svc.adoc#eventing-see-what-you-have-deployed[See What You Have Deployed]
9292
*** xref:06-eventing/eventing-src-svc.adoc#eventing-cleanup[Cleanup]
93-
9493
** xref:06-eventing/eventing-src-sub.adoc[Source to Subscriber]
9594
*** xref:06-eventing/eventing-src-sub.adoc#eventing-channel[Channel]
9695
**** xref:06-eventing/eventing-src-sub.adoc#eventing-create-event-channel[Create Event Channel]
@@ -101,14 +100,11 @@
101100
*** xref:06-eventing/eventing-src-sub.adoc#eventing-subscriber[Event Subscriber]
102101
**** xref:06-eventing/eventing-src-sub.adoc#eventing-create-subscriber[Create Event Subscriber]
103102
**** xref:06-eventing/eventing-src-sub.adoc#eventing-verify-subscriber[Verify]
104-
*** xref:06-eventing/eventing-src-sub.adoc#eventing-see-what-you-have-deployed[See what you have deployed]
103+
*** xref:06-eventing/eventing-src-sub.adoc#eventing-see-what-you-have-deployed[See What You Have Deployed]
105104
*** xref:06-eventing/eventing-src-sub.adoc#eventing-subscriber-service[Subscriber Service]
106105
**** xref:06-eventing/eventing-src-sub.adoc#eventing-gen-subscriber-service[Generate Service]
107106
**** xref:06-eventing/eventing-src-sub.adoc#eventing-deploy-subscriber-service[Deploy Service]
108107
*** xref:06-eventing/eventing-src-sub.adoc#eventing-cleanup[Cleanup]
109108
** xref:06-eventing/eventing.adoc#eventing-watch-logs[Watching Logs]
110109
111-
112-
* xref:faq.adoc[8.Frequently Asked Questions]
113-
114-
110+
* xref:faq.adoc[8. Frequently Asked Questions]

documentation/modules/ROOT/pages/01-setup.adoc

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,58 +6,52 @@ include::_attributes.adoc[]
66

77
The following CLI tools are required for running the exercises in this tutorial. Please have them installed and configured before you get started with any of the tutorial chapters.
88

9-
[cols="4*^,4*."]
9+
[cols="3*^,3*.",options="header"]
1010
|===
11-
|**Tool** |**macOS** |**Fedora** | **Remarks**
12-
| `minikube`
13-
| https://kubernetes.io/docs/setup/minikube
14-
| https://kubernetes.io/docs/setup/minikube
15-
|
11+
|**Tool**|**macOS**|**Fedora**
1612

17-
| `minishift`
18-
| https://github.com/minishift/minishift/releases
19-
| https://github.com/minishift/minishift/releases
20-
|
13+
| `Minikube`
14+
2+| https://kubernetes.io/docs/setup/minikube
15+
16+
| `Minishift`
17+
2+| https://github.com/minishift/minishift/releases
2118

2219
| `git`
2320
| https://git-scm.com/download/mac
2421
| `dnf install git`
25-
|
22+
23+
| `Docker`
24+
| https://docs.docker.com/docker-for-mac/install
25+
| `dnf install docker`
2626

2727
| https://maven.apache.org[Apache Maven]
2828
| `brew install maven`
2929
| `dnf install maven`
30-
|
3130

3231
| https://github.com/wercker/stern[stern]
3332
| `brew install stern`
3433
| `sudo curl --output /usr/local/bin/stern -L https://github.com/wercker/stern/releases/download/1.6.0/stern_linux_amd64 && sudo chmod +x /usr/local/bin/stern`
35-
|
3634

3735
| https://github.com/mikefarah/yq[yq]
3836
| `brew install yq`
3937
| https://github.com/mikefarah/yq/releases/latest
40-
|
4138

4239
| https://httpie.org/[httpie]
4340
| `brew install httpie`
4441
| `dnf install httpie`
45-
|
4642

4743
| https://github.com/JoeDog/siege[siege]
4844
| `brew install siege`
4945
| `dnf install siege`
50-
|
5146

5247
| watch
5348
| `brew install watch`
5449
| `dnf install procps-ng`
55-
|
5650

5751
| kubectx and kubens
5852
| `brew install kubectx`
5953
| https://github.com/ahmetb/kubectx
60-
|
54+
6155
|===
6256

6357
[#download-tutorial-sources]
@@ -79,9 +73,9 @@ The `work` folder in `$TUTORIAL_HOME` can be used to download the demo applicati
7973
This tutorial was developed and tested with:
8074
8175
- Knative `{knative-version}`
82-
- minikube `{minikube-version}`
76+
- Minikube `{minikube-version}`
8377
- OpenShift `{openshift-version}`
84-
- minishift `{minishift-version}`
78+
- Minishift `{minishift-version}`
8579
====
8680

8781
[#kubernetes-cluster]

documentation/modules/ROOT/pages/02-basic-fundas.adoc

Lines changed: 48 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ At the end of this chapter you will be able to :
66
* Deploy a Knative service.
77
* Deploy multiple revisions of a service.
88
* Choose between different service deployment strategies.
9-
* Running different revisions of a service.
9+
* Run different revisions of a service.
1010
1111
[#basics-prerequisite]
1212
== Prerequisite
@@ -27,7 +27,7 @@ Navigate to the tutorial chapter's `knative` folder:
2727
cd $TUTORIAL_HOME/{basics-repo}/knative
2828
----
2929

30-
The following snippet shows how a Knative service YAML will look like:
30+
The following snippet shows what a Knative service YAML looks like:
3131

3232

3333
.link:{github-repo}/{basics-repo}/knative/service.yaml[service.yaml]
@@ -46,10 +46,10 @@ spec:
4646
image: dev.local/rhdevelopers/greeter:0.0.1 #<2>
4747
----
4848

49-
<1> Makes Knative to always run the latest revision of the deployment
50-
<2> It is very important that the image is a fully qualified name docker image name with tag. For more details on this xref:ROOT:faq.adoc#faq-q2[Question 2 of FAQ]
49+
<1> Makes Knative always run the latest revision of the deployment
50+
<2> It is very important that the image is a fully qualified docker image name with tag. For more details on this, see xref:ROOT:faq.adoc#faq-q2[Question 2 of FAQ]
5151

52-
The service could be deployed using the command:
52+
The service can be deployed using the following command:
5353

5454
[#basics-run-svc-apply]
5555
[source,bash,subs="+macros,+attributes"]
@@ -67,7 +67,24 @@ oc apply -n {tutorial-namespace} -f link:{github-repo}/{basics-repo}/knative/ser
6767
----
6868
copyToClipboard::basics-run-oc-svc-apply[]
6969

70-
After successful deployment of the service we should see a kubernetes deployment like `greeter-nsrbr-deployment` available.
70+
After successful deployment of the service we should see a Kubernetes Deployment named similar to `greeter-nsrbr-deployment` available:
71+
72+
[#basics-run-svc-apply]
73+
[source,bash,subs="+macros,+attributes"]
74+
----
75+
kubectl get deployments -n {tutorial-namespace}
76+
----
77+
copyToClipboard::basics-run-svc-apply[]
78+
79+
**(OR)**
80+
81+
[#basics-run-oc-svc-apply]
82+
[source,bash,linenums,subs="+macros,+attributes"]
83+
----
84+
oc get deployments -n {tutorial-namespace}
85+
----
86+
copyToClipboard::basics-run-oc-svc-apply[]
87+
7188

7289
[NOTE]
7390
====
@@ -87,9 +104,9 @@ include::ROOT:partial$invoke-service.adoc[tag=*]
87104
:k8s-cli: oc
88105
include::ROOT:partial$invoke-service.adoc[tag=*]
89106

90-
The last curl command should return a response like **Hi greeter => '6fee83923a9f' : 1**
107+
The last http command should return a response containing a line similar to **Hi greeter => '6fee83923a9f' : 1**
91108

92-
NOTE: Sometimes the response might not be returned immediately especially when the pod is coming up from dormant state, at those times try giving request again
109+
NOTE: Sometimes the response might not be returned immediately especially when the pod is coming up from dormant state. In that case, repeat service invocation.
93110

94111
[#basics-see-what-you-have-deployed]
95112
== See what you have deployed
@@ -111,7 +128,7 @@ include::partial$knative-objects.adoc[tag=knative-configs]
111128

112129
include::partial$knative-objects.adoc[tag=knative-routes]
113130

114-
When the service was invoked with `curl -H "Host:greeter.knativetutorial.example.com" $IP_ADDRESS`,you noticed that we added a **Host** header to the request with value `greeter.knativetutorial.example.com`,this FQDN is automatically assigned to your Knative service by the Knative Routes,it uses the format like `**<service-name>.<namespace>.<domain-suffix>**`.
131+
When the service was invoked with `http $IP_ADDRESS 'Host:greeter.knativetutorial.example.com'`, you noticed that we added a **Host** header to the request with value `greeter.knativetutorial.example.com`. This FQDN is automatically assigned to your Knative service by the Knative Routes and uses the following format: `**<service-name>.<namespace>.<domain-suffix>**`.
115132

116133
[NOTE]
117134
====
@@ -128,9 +145,9 @@ include::partial$knative-objects.adoc[tag=knative-revisions]
128145
====
129146

130147
[#deploying-new-revision]
131-
== Deploy new Revision Service
148+
== Deploy a New Revision of a Service
132149

133-
As Knative follows https://12factor.net[12-Factor] application principles, any new https://12factor.net/config[configuration] change will trigger new revision of the deployment.
150+
As Knative follows https://12factor.net[12-Factor] application principles, any https://12factor.net/config[configuration] change will trigger creation of a new revision of the deployment.
134151

135152
To deploy a new revision of the greeter service, we will add an environment variable to the existing service as shown below:
136153

@@ -175,22 +192,28 @@ oc apply -n {tutorial-namespace} -f link:{github-repo}/{basics-repo}/knative/ser
175192
----
176193
copyToClipboard::oc-basics-run-service-env[]
177194

178-
After successful deployment of the service we should see a kubernetes deployment called `greeter-cqgcf-deployment`.
195+
After successful deployment of the service we should see a Kubernetes deployment called `greeter-cqgcf-deployment`.
196+
197+
Now if you list revisions
179198

180-
Now running the <<basics-show-knative-revisions,command>> will show two revisions namely `greeter-cqgcf` and `greeter-nsrbr`.
199+
[#basics-show-knative-revisions]
200+
=== revisions
201+
include::partial$knative-objects.adoc[tag=knative-revisions]
181202

182-
<<basics-invoke-service,Invoking Service>> will now show an output like **Namaste greeter => '6fee83923a9f' : 1**, where __Namaste__ is the value that we configured via environment variable in the Knative service resource file.
203+
, you will see two of them, named similar to `greeter-cqgcf` and `greeter-nsrbr`.
204+
205+
<<basics-invoke-service,Invoking Service>> will now show an output like **Namaste greeter => '6fee83923a9f' : 1**, where __Namaste__ is the value we configured via environment variable in the Knative service resource file.
183206

184207
[#basics-pinning-revision]
185-
== Pinning service to a revision
208+
== Pinning Service to a Revision
186209

187-
As you noticed that the Knative services always routes the traffic to the **latest** revision of the service deployment, thats because of the **runLatest** attribute in <<basics-service-rev2,service resource file>>.
210+
As you noticed, Knative service always routes traffic to the **latest** revision of the service deployment, due to the **runLatest** attribute in the <<basics-service-rev2,service resource file>>.
188211

189-
Let us now make the greeter service use first revision created i.e. the one using the default `MESSAGE_PREFIX`.
212+
Let us now make the greeter service use the first revision created, the one using the default `MESSAGE_PREFIX`.
190213

191214
[TIP]
192215
====
193-
You can use the get <<basics-show-knative-revisions, show knative revisions>> command to find the available revisions for the greeter service.
216+
You can use the <<basics-show-knative-revisions, show Knative service revisions>> command to find the available revisions for the greeter service.
194217
====
195218

196219
=== Service pinned to first revision
@@ -222,20 +245,20 @@ spec:
222245
path: /healthz
223246
----
224247

225-
<1> The **release** attribute in service resource file will make Knative use the revision specified in the **revisions** attribute.
248+
<1> The **release** attribute in the service resource file will make Knative use the revision specified in the **revisions** attribute.
226249

227250
[IMPORTANT]
228251
====
229-
The value of revisions might be different in your setup
252+
The names of revisions may be different in your setup
230253
====
231254

232-
Let redeploy the greeter service by pinning it to the first revision that was created:
255+
Let us redeploy the greeter service by pinning it to the first revision that was created:
233256

234257
[#run-pinned-revision]
235258
[source,bash,subs="+macros,+attributes"]
236259
----
237260
PIN_REVISION=`kubectl get rev -l serving.knative.dev/service=greeter -l serving.knative.dev/configurationGeneration=1 | awk 'NR==2{print $1}'` && \
238-
cat service-pinned.yaml | yq w - "spec.release.revisions[+]" $FIRST_REVISION | kubectl -n {tutorial-namespace} apply -f -
261+
cat service-pinned.yaml | yq w - "spec.release.revisions[+]" $PIN_REVISION | kubectl -n {tutorial-namespace} apply -f -
239262
----
240263
copyToClipboard::run-pinned-revision[]
241264

@@ -244,12 +267,12 @@ copyToClipboard::run-pinned-revision[]
244267
[#run-oc-pinned-revision]
245268
[source,bash,subs="+macros,+attributes"]
246269
----
247-
PIN_REVISION=`kubectl get rev -l serving.knative.dev/service=greeter -l serving.knative.dev/configurationGeneration=1 | awk 'NR==2{print $1}'` && \
248-
cat service-pinned.yaml | yq w - "spec.release.revisions[+]" $FIRST_REVISION | oc -n {tutorial-namespace} apply -f -
270+
PIN_REVISION=`oc get rev -l serving.knative.dev/service=greeter -l serving.knative.dev/configurationGeneration=1 | awk 'NR==2{print $1}'` && \
271+
cat service-pinned.yaml | yq w - "spec.release.revisions[+]" $PIN_REVISION | oc -n {tutorial-namespace} apply -f -
249272
----
250273
copyToClipboard::run-oc-pinned-revision[]
251274

252-
<<basics-invoke-service,Invoking Service>> will now show an output like **Hi greeter => '6fee83923a9f' : 1**
275+
<<basics-invoke-service,Invoking Service>> will produce output similar to **Hi greeter => '6fee83923a9f' : 1**
253276

254277
[#basics-cleanup]
255278
== Cleanup

0 commit comments

Comments
 (0)