You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: documentation/modules/ROOT/pages/01-setup.adoc
+14-9Lines changed: 14 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,17 +9,22 @@ The following CLI tools are required for running the exercises in this tutorial.
9
9
[cols="4*^,4*."]
10
10
|===
11
11
|**Tool** |**macOS** |**Fedora** | **Remarks**
12
-
| `minikube`
12
+
| `minikube`
13
13
| https://kubernetes.io/docs/setup/minikube
14
14
| https://kubernetes.io/docs/setup/minikube
15
15
|
16
16
17
-
| `minishift`
17
+
| `minishift`
18
18
| https://github.com/minishift/minishift/releases
19
19
| https://github.com/minishift/minishift/releases
20
20
|
21
21
22
-
| https://maven.apacge.org[Apache Maven]
22
+
| `git`
23
+
| https://git-scm.com/download/mac
24
+
| `dnf install git`
25
+
|
26
+
27
+
| https://maven.apache.org[Apache Maven]
23
28
| `brew install maven`
24
29
| `dnf install maven`
25
30
|
@@ -41,12 +46,12 @@ The following CLI tools are required for running the exercises in this tutorial.
41
46
42
47
| https://github.com/JoeDog/siege[siege]
43
48
| `brew install siege`
44
-
| https://github.com/JoeDog/siege
49
+
| `dnf install siege`
45
50
|
46
51
47
52
| watch
48
-
|`brew install watch`
49
-
| it will be pre-installed
53
+
|`brew install watch`
54
+
| `dnf install procps-ng`
50
55
|
51
56
52
57
| kubectx and kubens
@@ -57,14 +62,14 @@ The following CLI tools are required for running the exercises in this tutorial.
57
62
58
63
[#download-tutorial-sources]
59
64
== Download Tutorial Sources
60
-
Before we start to setting up the environment, lets clone the tutorial sources and call the cloned folder as `$TUTORIAL_HOME`
65
+
Before we start setting up the environment, let's clone the tutorial sources and set the `TUTORIAL_HOME` environment variable to point to the root directory of the tutorial:
The `work` folder in `$TUTORIAL_HOME` can be used to download the demo application resources and refer them during the exercises. The `work` folder has a README, which has instructions on source code repo and git commands to clone the sources.
72
+
The `work` folder in `$TUTORIAL_HOME` can be used to download the demo application resources and refer to them during the exercises. The `work` folder has a README with instructions on the source code repo and git commands to clone the sources.
The work folder i.e `$TUTORIAL_HOME/work` can be used as a work directory during the build. The README in the work folder as the GitHub repository links of the applications `greeter` and `event-greeter` that will be used in various exercises.
94
+
The work folder i.e `$TUTORIAL_HOME/work` can be used as a work directory during the build. The README in the work folder has the GitHub repository links of the applications `greeter` and `event-greeter` that will be used in various exercises.
Copy file name to clipboardExpand all lines: documentation/modules/ROOT/pages/02-basic-fundas.adoc
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -88,7 +88,7 @@ NOTE: Sometimes the response might not be returned immediately especially when t
88
88
[#basics-see-what-you-have-deployed]
89
89
== See what you have deployed
90
90
91
-
The servicebased deployment strategy that we did now will create many knative resources, the following commands will help you to query and find what has been deployed.
91
+
The service-based deployment strategy that we did now will create many Knative resources, the following commands will help you to query and find what has been deployed.
In the previous chapter we saw how we can deploy services using a holistic service resource file, in this chapter we will see how to deploy the service using configurations and route files.
22
22
23
-
Navigate to the tutorial chapter's `knative`folder:
Copy file name to clipboardExpand all lines: documentation/modules/ROOT/pages/04-scaling.adoc
+15-45Lines changed: 15 additions & 45 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -86,7 +86,7 @@ The last `curl` command should return a response like **Hi greeter => greeter-00
86
86
Check <<02-basic-fundas.adoc#see-what-you-have-deployed,deployed Knative resources>> for more details on which Knative objects and resources have been created with the service deployment above.
87
87
88
88
[#scaling-scale-to-zero]
89
-
== Configure scale to zero
89
+
== Configure scale-to-zero
90
90
91
91
Assuming that <<scaling-deploy-service, Greeter service>> has been deployed, once no more traffic is seen going into that service, we'd like to scale this service down to zero replicas. That's called **scale-to-zero**.
92
92
@@ -95,7 +95,7 @@ Scale-to-zero is one of the main properties making Knative a serverless platform
95
95
If another request tries to get to this revision, the activator will get it, instruct the autoscaler to create new pods for the revision as quickly as possible and buffer the request until those new pods are created.
96
96
97
97
[#scale-to-zero-formulae]
98
-
=== Calculating scale to zero time period
98
+
=== Calculating scale-to-zero time period
99
99
100
100
The Knative autoscaler uses the config map **config-autoscaler** in the **knative-serving** namespace for autoscaling related properties. The values of the attribute `stable-window` and `scale-to-zero-grace-period`, which we've seen above, are part of this config map.
101
101
@@ -131,6 +131,13 @@ As described above, the time it takes to finally scale to zero will be `STABLE_W
131
131
132
132
For easier observation let us open a new terminal and run the following command,
133
133
134
+
[source,bash,subs="+macros,+attributes"]
135
+
----
136
+
watch 'kubectl get pods -n knativetutorial'
137
+
----
138
+
139
+
.(OR)
140
+
134
141
[source,bash,subs="+macros,+attributes"]
135
142
----
136
143
watch 'oc get pods -n knativetutorial'
@@ -147,7 +154,7 @@ echo $STABLE_WINDOW
147
154
echo $SCALE_TO_ZERO_GRACE_PERIOD
148
155
----
149
156
150
-
By default the **scale-to-zero-grace-period** is `30s`, and the **stable-window** is `60s`. Firing a request to the greeter service will bring up the pod (if it is already terminated, as described above) to serve the request. Leaving it without any further requests will automatically cause it to scale to zero in `1 min 30 secs`(<<scale-to-zero-formulae,Compute scale to zero grace period>>).
157
+
By default the **scale-to-zero-grace-period** is `30s`, and the **stable-window** is `60s`. Firing a request to the greeter service will bring up the pod (if it is already terminated, as described above) to serve the request. Leaving it without any further requests will automatically cause it to scale to zero in `1 min 30 secs`(<<scale-to-zero-formulae,Compute scale-to-zero grace period>>).
Now <<scaling-invoke-service,firing the request>> to the greeter service will bring up the pod to serve the request again. Leaving it without any further requests, it will automatically scale to zero in `2 mins`(<<scale-to-zero-formulae,Compute scale to zero grace period>>)
193
-
194
-
[#scaling-observer-scale-to-zero-2m]
195
-
=== Scale to zero in 2 minute
196
-
197
-
Let us now update **scale-to-zero-grace-period** to `2m` and leave the **stable-window** to default `60s`.
198
-
199
-
[source,bash,subs="+macros,+attributes"]
200
-
----
201
-
kubectl -n knative-serving get cm config-autoscaler -o yaml | yq w - -s link:{github-repo}/{scaling-repo}/knative/configure-scaling-to-2m.yaml[configure-scaling-to-2m.yaml] | kubectl apply -f -
202
-
----
203
-
204
-
.(OR)
205
-
206
-
[source,bash,subs="+macros,+attributes"]
207
-
----
208
-
oc -n knative-serving get cm config-autoscaler -o yaml | yq w - -s link:{github-repo}/{scaling-repo}/knative/configure-scaling-to-2m.yaml[configure-scaling-to-2m.yaml] | oc apply -f -
209
-
----
210
-
211
-
Verifying the `scale-to-zero-grace-period` value, which should return `2m`:
212
-
213
-
[source,bash,subs="+macros,+attributes",linenums]
214
-
----
215
-
216
-
kubectl -n knative-serving get configmap config-autoscaler -o yaml \
217
-
| yq r - data.scale-to-zero-grace-period
218
-
----
219
-
220
-
.(OR)
221
-
222
-
[source,bash,subs="+macros,+attributes",linenums]
223
-
----
224
-
oc -n knative-serving get configmap config-autoscaler -o yaml \
225
-
| yq r - data.scale-to-zero-grace-period
226
-
----
227
-
228
-
229
-
Now <<scaling-invoke-service,firing the request>> to the greeter service will bring up the pod to serve the request and if we leave the service without any further requests, it will automatically scale to zero in `3 mins`(<<scale-to-zero-formulae,Compute scale to zero grace period>>).
199
+
Now <<scaling-invoke-service,firing the request>> to the greeter service will bring up the pod to serve the request again. Leaving it without any further requests, it will automatically scale to zero in `2 mins`(<<scale-to-zero-formulae,Compute scale-to-zero grace period>>)
230
200
231
201
[#scaling-reset-to-defaults]
232
-
=== Reset scale to zero to defaults
202
+
=== Reset scale-to-zero to defaults
233
203
234
204
Let us revert the `scale-to-zero-grace-period` to its default:
For better clarity and understanding let us <<scaling-cleanup,clean up>> the deployed knative resources before going to next section.
237
+
For better clarity and understanding let us <<scaling-cleanup,clean up>> the deployed Knative resources before going to next section.
268
238
269
239
[#scaling-auto-scaling]
270
240
== Auto Scaling
@@ -340,11 +310,11 @@ watch oc get pods -n knativetutorial
340
310
[#scaling-load-service]
341
311
=== Load the service
342
312
343
-
We will now send some load to the greeter service. The command below sends 50 concurrent requests (`-c 50`) for the next 10s (`-z 10s`) and test will run for 30 seconds (`-t 30S`)
313
+
We will now send some load to the greeter service. The command below sends 50 concurrent requests (`-c 50`) for the next 30s (`-t 30s`)
NOTE: You can also delete xref:ROOT:05-build/build.adoc#build-apply-prereq-resources[pre-req resources] that were created if you dont need them any more.
282
+
NOTE: You can also delete xref:ROOT:05-build/build.adoc#build-apply-prereq-resources[pre-req resources] that were created if you don't need them anymore.
Copy file name to clipboardExpand all lines: documentation/modules/ROOT/pages/05-build/build.adoc
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ Its required that you have container registry account which is needed during the
19
19
You can get one for free at https://hub.docker.com[Docker Hub]
20
20
====
21
21
22
-
As the Knative build and build template spec needs some customizations,such as creating a secret with your container registry credentials; we need to run following commands to create the needed kubernetes and knative resources with all your customizations. All the generated files will be placed in `$TUTORIAL_HOME/04-build/knative`.
22
+
As the Knative build and build template specs need some customizations,such as creating a secret with your container registry credentials; we need to run the following commands to create the needed kubernetes and Knative resources with all your customizations. All the generated files will be placed in `$TUTORIAL_HOME/04-build/knative`.
<2> The username to use when authenticating with https://index.docker.io/v1/
73
73
<3> The password to use when authenticating with https://index.docker.io/v1/
74
74
75
-
For more details on why we need to do this please check https://github.com/knative/docs/blob/master/build/auth.md#basic-authentication-docker[here].
75
+
For more details on why we need to do this please check https://github.com/knative/docs/blob/master/docs/build/auth.md#basic-authentication-docker[here].
76
76
77
77
[#build-generate-build-spec]
78
78
== Generate Knative build spec
79
-
The knative build spec is used to create and run the knative builds. You can find more details on Knative build https://github.com/knative/docs/tree/master/build[here].
79
+
The Knative build spec is used to create and run the Knative builds. You can find more details on Knative build https://github.com/knative/docs/tree/master/docs/build[here].
<1> The kubernetes secret called `basic-auth-pass`, check https://github.com/knative/docs/blob/master/build/auth.md#basic-authentication-docker[here] for more details
226
-
<2> The kubernetes service account called `build-bot` that wll run the build. Only `build-bot`as access to the secret `basic-auth-pass`. Check https://github.com/knative/docs/blob/master/build/auth.md#basic-authentication-docker[here] for more details
225
+
<1> The kubernetes secret called `basic-auth-pass`, check https://github.com/knative/docs/blob/master/docs/build/auth.md#basic-authentication-docker[here] for more details
226
+
<2> The kubernetes service account called `build-bot` that will run the build. Only `build-bot`has access to the secret `basic-auth-pass`. Check https://github.com/knative/docs/blob/master/docs/build/auth.md#basic-authentication-docker[here] for more details
227
227
<3> the kubernetes persistence volume claim used to cache maven artifacts, to make subsequent builds faster
228
228
<4> the kubernetes persistence volume claim that will be used to cache docker base images to make subsequent https://github.com/GoogleContainerTools/kaniko[Kaniko] docker builds faster
Copy file name to clipboardExpand all lines: documentation/modules/ROOT/pages/06-eventing/eventing-src-sub.adoc
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,8 +22,8 @@ spec:
22
22
name: in-memory-channel
23
23
----
24
24
25
-
<1> The name of the channel, knative make it addressable i.e. resolveable to a target (a consumer service)
26
-
<2> The channel provisioner which is responsible to provision this channel.Various messaging implementations provide their own channel(s) via __ClusterChannelProvisioner__.
25
+
<1> The name of the channel. Knative makes it addressable, i.e. resolveable to a target (a consumer service)
26
+
<2> The channel provisioner which is responsible for provisioning this channel.Various messaging implementations provide their own channel(s) via __ClusterChannelProvisioner__.
NOTE: You can also delete xref:ROOT:05-build/build.adoc#build-apply-prereq-resources[pre-req resources] that were created if you dont need them any more.
356
+
NOTE: You can also delete xref:ROOT:05-build/build.adoc#build-apply-prereq-resources[pre-req resources] that were created if you don't need them anymore.
NOTE: You can also delete xref:ROOT:05-build/build.adoc#build-apply-prereq-resources[pre-req resources] that were created if you dont need them any more.
216
+
NOTE: You can also delete xref:ROOT:05-build/build.adoc#build-apply-prereq-resources[pre-req resources] that were created if you don't need them anymore.
0 commit comments