Skip to content

Commit 0c48975

Browse files
Merge pull request #112 from alanconway/tutorial-suggestions-1
Tutorial improvements - fixing style - content clarity - typos
2 parents 27b36f5 + 9bc7bca commit 0c48975

10 files changed

Lines changed: 31 additions & 32 deletions

File tree

02-basics/bin/call.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
INGRESSGATEWAY=istio-ingressgateway
44
IP_ADDRESS="$(minishift ip):$(kubectl get svc $INGRESSGATEWAY --namespace istio-system --output 'jsonpath={.spec.ports[?(@.port==80)].nodePort}')"
55

6-
curl -H "Host: greeter.knativetutorial.example.com" $IP_ADDRESS
6+
curl -H "Host:greeter.knativetutorial.example.com" $IP_ADDRESS

03-configs-and-routes/bin/call.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ IP_ADDRESS="$(minishift ip):$(kubectl get svc $INGRESSGATEWAY --namespace istio-
77

88
while true
99
do
10-
curl -H "Host: greeter.knativetutorial.example.com" $IP_ADDRESS
10+
curl -H "Host:greeter.knativetutorial.example.com" $IP_ADDRESS
1111
echo ""
1212
sleep .2
1313
done;

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

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
= Basics and Fundamentals
22
include::_attributes.adoc[]
33

4-
At the end of this chapter you will be able to understand and know how to :
4+
At the end of this chapter you will be able to :
55

6-
* Deploy first Knative service ?
7-
* Deploying multiple revisions of the service
8-
* What different service deployment strategies possible (service vs configurations/routes) ?
9-
* Always running latest vs pinning revision to services
6+
* Deploy a Knative service.
7+
* Deploy multiple revisions of a service.
8+
* Choose between different service deployment strategies.
9+
* Running different revisions of a service.
1010
1111
[#basics-prerequisite]
12-
== Prerequisite
12+
== Prerequisite
13+
1314
include::partial$prereq-cli.adoc[]
1415

1516
[#basics-build-containers]
@@ -102,7 +103,7 @@ include::partial$knative-objects.adoc[tag=knative-configs]
102103
=== routes
103104
include::partial$knative-objects.adoc[tag=knative-routes]
104105

105-
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>**`.
106+
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>**`.
106107

107108
[NOTE]
108109
====

documentation/modules/ROOT/pages/03-configs-and-routes.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ include::partial$knative-objects.adoc[tag=knative-configs]
134134
=== routes
135135
include::partial$knative-objects.adoc[tag=knative-routes]
136136

137-
When the service is invoked with `curl -H "Host: greeter.knativetutorial.example.com" $IP_ADDRESS`, you noticed that we added a **Host** header to the `curl` command with the value `greeter.knativetutorial.example.com`. This FQDN is automatically assigned to your Knative service by the Knative route we created. It follows a format `<route-name>.<namespace>.<domain-suffix>`.
137+
When the service is invoked with `curl -H "Host:greeter.knativetutorial.example.com" $IP_ADDRESS`, you noticed that we added a **Host** header to the `curl` command with the value `greeter.knativetutorial.example.com`. This FQDN is automatically assigned to your Knative service by the Knative route we created. It follows a format `<route-name>.<namespace>.<domain-suffix>`.
138138

139139
[NOTE]
140140
====

documentation/modules/ROOT/pages/04-scaling.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ We will now send some load to the greeter service. The command below sends 50 c
356356
[source,bash,subs="+macros,+attributes",linenums]
357357
----
358358
siege -r 1 -c 50 -t 30S \
359-
-H "Host: greeter.knativetutorial.example.com" \
359+
-H "Host:greeter.knativetutorial.example.com" \
360360
"http://pass:[${IP_ADDRESS}]"
361361
----
362362

documentation/modules/ROOT/pages/05-build/build-templates.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ include::ROOT:partial$invoke-service.adoc[tag=env]
209209

210210
[source,bash,subs="+macros,+attributes",linenums]
211211
----
212-
curl -H "Host: event-greeter.knativetutorial.example.com" $IP_ADDRESS \
212+
curl -H "Host:event-greeter.knativetutorial.example.com" $IP_ADDRESS \
213213
-H "Content-Type: application/json" \
214214
-d '{"message": "test message"}'
215215
----
@@ -219,7 +219,7 @@ curl -H "Host: event-greeter.knativetutorial.example.com" $IP_ADDRESS \
219219
[source,bash,subs="+macros,+attributes",linenums]
220220
----
221221
http POST $IP_ADDRESS \
222-
'Host: event-greeter.knativetutorial.example.com' \
222+
'Host:event-greeter.knativetutorial.example.com' \
223223
message="test message"
224224
----
225225

documentation/modules/ROOT/pages/05-build/build.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ include::ROOT:partial$invoke-service.adoc[tag=env]
306306

307307
[source,bash,subs="+macros,+attributes",linenums]
308308
----
309-
curl -H "Host: event-greeter.knativetutorial.example.com" $IP_ADDRESS \
309+
curl -H "Host:event-greeter.knativetutorial.example.com" $IP_ADDRESS \
310310
-H "Content-Type: application/json" \
311311
-d '{"message": "test message"}'
312312
----
@@ -316,7 +316,7 @@ curl -H "Host: event-greeter.knativetutorial.example.com" $IP_ADDRESS \
316316
[source,bash,subs="+macros,+attributes",linenums]
317317
----
318318
http POST $IP_ADDRESS \
319-
'Host: event-greeter.knativetutorial.example.com' \
319+
'Host:event-greeter.knativetutorial.example.com' \
320320
message="test message"
321321
----
322322

documentation/modules/ROOT/pages/_partials/invoke-service.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ IP_ADDRESS="$({k8s-env} ip):$({k8s-cli} get svc $INGRESSGATEWAY --namespace isti
1111
#tag::call[]
1212
[source,bash,subs="+macros,+attributes"]
1313
----
14-
curl -v -H "Host: greeter.knativetutorial.example.com" $IP_ADDRESS
14+
curl -v -H "Host:greeter.knativetutorial.example.com" $IP_ADDRESS
1515
----
1616

1717
.(OR)
1818

1919
[source,bash,subs="+macros,+attributes"]
2020
----
21-
http $IP_ADDRESS 'Host: greeter.knativetutorial.example.com'
21+
http $IP_ADDRESS 'Host:greeter.knativetutorial.example.com'
2222
----
2323
#end::call[]

documentation/modules/ROOT/pages/faq.adoc

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,32 +17,31 @@ if kubectl get configmap config-istio -n knative-serving &> /dev/null; then
1717
INGRESSGATEWAY=istio-ingressgateway
1818
fi
1919

20-
INGRESSGATEWAY=istio-ingressgateway
2120
IP_ADDRESS="$(minishift ip):$(kubectl get svc $INGRESSGATEWAY --namespace istio-system --output 'jsonpath={.spec.ports[?(@.port==80)].nodePort}')"
2221

2322
# calling a knative service named greeter
24-
curl -H "Host: greeter.knativetutorial.example.com" $IP_ADDRESS
23+
curl -H "Host:greeter.knativetutorial.example.com" $IP_ADDRESS
2524
----
2625

2726
[#faq-q2]
2827
== Why `dev.local` suffixes for container images?
2928

3029
.Tag Digest
3130
***
32-
> Docker images wit v2 or later format has content addressable identifier called digest. The digest remains unchanged as long the underlying image content remains unchanged.
31+
> Docker images with v2 or later format have a content-addressable identifier called a `digest`. The digest is a hash of the image content, so images with the same digest are guaranteed to have idetical content.
3332
[.text-right]
3433
__**Source**: https://docs.docker.com/engine/reference/commandline/images/#list-image-digests__
3534

3635
***
3736

38-
Let say you have a deployment like the following (note that resource definition have been trimmed for brevity):
37+
Given a deployment like the following (note that resource definitions have been trimmed for brevity):
3938

4039
[source,yaml,linenums]
4140
----
4241
apiVersion: apps/v1
4342
kind: Deployment
4443
metadata:
45-
name: helloworld
44+
name: helloworld
4645
spec:
4746
template:
4847
spec:
@@ -60,20 +59,19 @@ When you deploy this application in kubernetes, the deployment will look like:
6059
apiVersion: apps/v1
6160
kind: Deployment
6261
metadata:
63-
name: helloworld
62+
name: helloworld
6463
spec:
6564
template:
6665
spec:
6766
containers:
6867
- name: my-container
69-
image: >-
70-
gcr.io/knative-samples/helloworld-go@sha256:98af362ceca8191277206b3b3854220ce125924b28a1166126296982e33882d0
68+
image: gcr.io/knative-samples/helloworld-go@sha256:98af362ceca8191277206b3b3854220ce125924b28a1166126296982e33882d0
7169
. . .
7270
----
7371

74-
In the above example the container image name of the deployment i.e. gcr.io/knative-samples/helloworld-go was resolved to its digest gcr.io/knative-samples/helloworld-go@sha256:98af362ceca8191277206b3b3854220ce125924b28a1166126296982e33882d0. Kubernetes extracts the digest from the image manifest. This process of resolving image tag to its digest is informally called as “Tag to Digest”.
72+
The container image name `gcr.io/knative-samples/helloworld-go` was resolved to its digest `gcr.io/knative-samples/helloworld-go@sha256:98af362ceca8191277206b3b3854220ce125924b28a1166126296982e33882d0`. Kubernetes extracts the digest from the image manifest. This process of resolving image tag to its digest is informally called as “Tag to Digest”.
7573

76-
Knative Serving deployments by default resolve the container images to digest during the deployment process. Knative Serving has been configured to skip the resolution of image name/tag to image digest for registries ko.local and dev.local, which can be used for local development builds, as the underlying image content are subject to changes during the development process.
74+
Knative Serving deployments, by default, resolve the container images to digest during the deployment process. Knative Serving has been configured to skip the resolution of image name/tag to image digest for registries ko.local and dev.local, which can be used for local development builds where the underlying image contents are subject to change during the development process.
7775

7876
[TIP]
7977
====
@@ -84,10 +82,10 @@ The following command shows an example how to add a registry **my.docker.registr
8482
```
8583
val=$(oc -n knative-serving get cm config-controller -oyaml | yq r - data.registriesSkippingTagResolving | awk '{print $1",my.docker.registry"}')
8684
87-
oc -n knative-serving get cm config-controller -oyaml | yq w - data.registriesSkippingTagResolving $val | oc apply -f -
85+
oc -n knative-serving get cm config-controller -oyaml | yq w - data.registriesSkippingTagResolving $val | oc apply -f -
8886
```
8987
====
9088

9189
[#faq-q3]
92-
== What is revision simpler terms?
93-
In Knative serving, things are driven via a https://github.com/knative/serving/blob/master/docs/spec/spec.md#configuration[Configuration] to make a separation between code (container images) and config. One of the good practices in configuration management is that we should always be able to rollback the application state to any “last known good configuration”, to be able to allow this type of rollback Knative creates an unique revision for each and every configuration change.
90+
== What is a "revision" in simpler terms?
91+
A https://github.com/knative/serving/blob/master/docs/spec/overview.md#revision[Revision] is an immutable snapshot of code and configuration. Each change to an application's https://github.com/knative/serving/blob/master/docs/spec/overview.md#configuration[Configuration] creates a new *Revision*, which allows an application to be rolled back to any previous “known good configuration”.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
= Knative Tutorial
22

3-
Serverless epitomize the very benefits of what cloud platforms promise: offload the management of infrastructure while taking advantage of a consumption model for the actual utilization of services. While there are a number of server frameworks out there, Knative is the first serverless platform specifically designed for Kubernetes and OpenShift.
3+
Serverless epitomizes the very benefits of what cloud platforms promise: offload the management of infrastructure while taking advantage of a consumption model for the actual utilization of services. While there are a number of serverless frameworks out there, Knative is the first specifically designed for Kubernetes and OpenShift.
44

55
> Serverless computing refers to the concept of building and running applications that do not require server management. It describes a finer-grained deployment model where applications, bundled as one or more functions, are uploaded to a platform and then executed, scaled, and billed in response to the exact demand needed at the moment”
66

@@ -9,4 +9,4 @@ __**Source**__: https://www.cncf.io/blog/2018/02/14/cncf-takes-first-step-towar
99

1010
This tutorial will act as a step-by-step guide in helping you understand Knative, starting with setup, fundamental concepts such as service, configuration, revision etc., and finally deploying some use cases which could help deploying serverless applications at enterprises.
1111

12-
This content is brought to you by http://developers.redhat.com[Red Hat Developer Program] - Register today!
12+
This content is brought to you by http://developers.redhat.com[Red Hat Developer Program] - Register today!

0 commit comments

Comments
 (0)