Skip to content

Commit 2459547

Browse files
Merge pull request #107 from kameshsampath/upgrade/v0.4.0
Upgrade/v0.4.0
2 parents 88c818a + 04871b7 commit 2459547

7 files changed

Lines changed: 24 additions & 83 deletions

File tree

05-build/knative/service-with-build-template.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ kind: Service
33
metadata:
44
name: event-greeter
55
spec:
6-
runLatest:
6+
runLatest:
77
configuration:
88
build:
99
apiVersion: build.knative.dev/v1alpha1

06-eventing/knative/service.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ spec:
1111
app: event-greeter
1212
spec:
1313
container:
14-
image: docker.io/kameshsampath/event-greeter:0.0.1
14+
image: $destinationImageName

06-eventing/knative/templates/service.jsonnet

Lines changed: 0 additions & 27 deletions
This file was deleted.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ spec:
8888

8989
The build done by the build steps of the template is exactly same like what was done by xref:ROOT:05-build/build.adoc#build-create-build[raw build], but templates gives flexibility and ease of configuration via parameters. The template step(s) modifications are transparent to the consumers (the builds inheriting the template), the builds using the template will automatically inherit the modified steps.
9090

91-
[#build-template-generate-service]
91+
[#build-template-edit-service]
9292
=== Edit Knative service
9393

9494
Run the following command to create the knative service that will use the image created by the Knative build template we defined earlier.

documentation/modules/ROOT/pages/06-eventing/eventing-src-sub.adoc

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Navigate to tutorial chapter's `knative` folder:
2929

3030
[source,bash,subs="+macros,+attributes"]
3131
----
32-
cd $TUTORIAL_HOME/05-eventing/knative
32+
cd $TUTORIAL_HOME/{eventing-repo}/knative
3333
----
3434

3535
Run the following commands to create the channel:
@@ -96,12 +96,12 @@ spec:
9696
<1> The type of event source, the eventing system deploys a bunch of sources out of the box and it also provides way to deploy custom resources
9797
<2> The channel(sink) where the event data will be drained
9898
99-
[NOTE]
99+
[NOTE,subs="macros+"]
100100
====
101101
Event Source can define the attributes that it wishes to receive via the
102102
spec. In the above example it defines **schedule**(the the cron expression) and **data** that will be sent as part of the event.
103103

104-
When you xref:06-eventing/eventing.adoc#eventing-watch-logs[watch logs], you will notice this data being delivered to the service.
104+
When you xref:{eventing-repo}/eventing.adoc#eventing-watch-logs[watch logs], you will notice this data being delivered to the service.
105105
====
106106

107107
Run the following commands to create the event source resources:
@@ -256,25 +256,14 @@ Navigate to tutorial chapter's `templates` folder:
256256

257257
[source,bash,subs="+macros,+attributes"]
258258
----
259-
cd $TUTORIAL_HOME/05-eventing/knative/templates
259+
cd $TUTORIAL_HOME/{eventing-repo}/knative/templates
260260
----
261261

262262
Run the following command to create the knative service that will be used as the subscriber for the cron events:
263263

264264
[source,bash,subs="+macros,+attributes",linenums]
265265
----
266-
267-
jsonnet --ext-str image='<your-docker-image-name>' \
268-
link:{github-repo}/{eventing-repo}/knative/templates/service.jsonnet[service.jsonnet]\
269-
| yq r - | tee ../service.yaml
270-
----
271-
272-
(e.g)
273-
[source,bash,subs="+macros,+attributes",linenums]
274-
----
275-
jsonnet --ext-str image='docker.io/demo/event-greeter:0.0.1' \
276-
link:{github-repo}/{eventing-repo}/knative/templates/service.jsonnet[service.jsonnet] \
277-
| yq r - | tee ../service.yaml
266+
pass:[ sed -i "s~\$destinationImageName~${DESTINATION_IMAGE_NAME}~g" service-with-build-template.yaml ]
278267
----
279268

280269
[.text-center]
@@ -297,11 +286,13 @@ spec:
297286
image: docker.io/demo/event-greeter:0.0.1 <1>
298287
----
299288

300-
<1> Set from `image` parameter -- the fully qualified container image that will be pushed to the registry as part of the build --
289+
<1> Set from `${DESTINATION_IMAGE_NAME}` environment variable -- the fully qualified container image that will be pushed to the registry as part of the build --
290+
291+
Refer to xref:ROOT:05-build/build.adoc#build-set-env[Build Environment Variables]
301292

302-
[NOTE]
293+
[NOTE,subs="macros+"]
303294
====
304-
If you have skipped the xref:ROOT:05-build/build.adoc[Build] or xref:ROOT:05-build/build-templates.adoc[Build Templates] do not have the container image of `event-greeter`; then you can update the Knative serving service to use the pre-built event-greeter image available at `quay.io/rhdevelopers/knative-tutorial-event-greeter:0.0.1`
295+
If you have skipped the xref:ROOT:{build-repo}/build.adoc[Build] or xref:ROOT:{build-repo}/build-templates.adoc[Build Templates] do not have the container image of `event-greeter`; then you can update the Knative serving service to use the pre-built event-greeter image available at `quay.io/rhdevelopers/knative-tutorial-event-greeter:0.0.1`
305296
====
306297

307298
[#eventing-deploy-subscriber-service]
@@ -311,7 +302,7 @@ Navigate to tutorial chapter's `knative` folder:
311302

312303
[source,bash,subs="+macros,+attributes"]
313304
----
314-
cd $TUTORIAL_HOME/05-eventing/knative
305+
cd $TUTORIAL_HOME/{eventing-repo}/knative
315306
----
316307

317308
Run the following commands to create the service:
@@ -328,7 +319,7 @@ kubectl apply -n knativetutorial -f service.yaml
328319
oc apply -n knativetutorial -f service.yaml
329320
----
330321

331-
You can xref:06-eventing/eventing.adoc#eventing-watch-logs[watch logs] to see the cron job source sending an event every 1 minute.
322+
You can xref:{eventing-repo}/eventing.adoc#eventing-watch-logs[watch logs] to see the cron job source sending an event every 1 minute.
332323

333324
[#eventing-cleanup]
334325
== Cleanup

documentation/modules/ROOT/pages/06-eventing/eventing-src-svc.adoc

Lines changed: 7 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Navigate to the tutorial chapter's `knative` folder:
1010

1111
[source,bash,subs="+macros,+attributes"]
1212
----
13-
cd $TUTORIAL_HOME/05-eventing/knative
13+
cd $TUTORIAL_HOME/{eventing-repo}/knative
1414
----
1515

1616
[#eventing-create-event-source]
@@ -107,29 +107,11 @@ cronjob-event-greeter-cronjob-source-4v9vq-6bff96b58f-tgrhj 2/2 Running
107107
[#eventing-gen-sink-service]
108108
=== Generate Sink Service
109109

110-
Navigate to tutorial chapter's `templates` folder:
111-
112-
[source,bash,subs="+macros,+attributes"]
113-
----
114-
cd $TUTORIAL_HOME/05-eventing/knative/templates
115-
----
116-
117110
Run the following command to create the Knative service that will be used as the subscriber for the cron events:
118111

119112
[source,bash,subs="+macros,+attributes",linenums]
120113
----
121-
122-
jsonnet --ext-str image='<your-docker-image-name>' \
123-
link:{github-repo}/{eventing-repo}/knative/templates/service.jsonnet[service.jsonnet]\
124-
| yq r - | tee ../service.yaml
125-
----
126-
127-
(e.g)
128-
[source,bash,subs="+macros,+attributes",linenums]
129-
----
130-
jsonnet --ext-str image='docker.io/demo/event-greeter:0.0.1' \
131-
link:{github-repo}/{eventing-repo}/knative/templates/service.jsonnet[service.jsonnet] \
132-
| yq r - | tee ../service.yaml
114+
pass:[ sed -i "s~\$destinationImageName~${DESTINATION_IMAGE_NAME}~g" service-with-build-template.yaml ]
133115
----
134116

135117
[.text-center]
@@ -152,23 +134,18 @@ spec:
152134
image: docker.io/demo/event-greeter:0.0.1 <1>
153135
----
154136

155-
<1> Set from `image` parameter -- the fully qualified container image that will be pushed to the registry as part of the build --
137+
<1> Set from `${DESTINATION_IMAGE_NAME}` environment variable -- the fully qualified container image that will be pushed to the registry as part of the build --
156138

157-
[NOTE]
139+
Refer to xref:ROOT:05-build/build.adoc#build-set-env[Build Environment Variables]
140+
141+
[NOTE,subs="macros+"]
158142
====
159-
If you have skipped the xref:ROOT:05-build/build.adoc[Build] or xref:ROOT:05-build/build-templates.adoc[Build Templates] do not have the container image of `event-greeter`; then you can update the Knative serving service to use the pre-built event-greeter image available at `quay.io/rhdevelopers/knative-tutorial-event-greeter:0.0.1`
143+
If you have skipped the xref:ROOT:{build-repo}/build.adoc[Build] or xref:ROOT:05-build/build-templates.adoc[Build Templates] and dont have the container image of `event-greeter`; then you can update the Knative serving service to use the pre-built event-greeter image available at `quay.io/rhdevelopers/knative-tutorial-event-greeter:0.0.1`
160144
====
161145

162146
[#eventing-deploy-sink-service]
163147
=== Deploy Sink Service
164148

165-
Navigate to tutorial chapter's `knative` folder:
166-
167-
[source,bash,subs="+macros,+attributes"]
168-
----
169-
cd $TUTORIAL_HOME/05-eventing/knative
170-
----
171-
172149
Run the following commands to create the service:
173150

174151
[source,bash,subs="+macros,+attributes"]

documentation/modules/ROOT/pages/06-eventing/eventing.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ The logs will have the output like below printing every minute.
3333
"ID" : "1549548420001445196-715",
3434
"EventTime" : "2019-02-07T14:07:00.001470981Z",
3535
"Body" : "{\"message\": \"Thanks for doing Knative Tutorial\"}",
36-
"host" : "Event greeter => 'event-greeter-00001-deployment-84f879ff6d-88rxb' : 3 ",
36+
"host" : "Event greeter => 'event-greeter-rz7lz-pod-938e74' : 1",
3737
"time" : "14:07:00"
3838
}
3939
----
@@ -45,7 +45,7 @@ The logs will have the output like below printing every minute.
4545
"ID" : "1549548420001445196-715",
4646
"EventTime" : "2019-02-07T14:07:00.001470981Z",
4747
"Body" : "{\"message\": \"Thanks for doing Knative Tutorial\"}",
48-
"host" : "Event greeter v0.0.2 => 'event-greeter-00001-deployment-84f879ff6d-88rxb' : 3 ",
48+
"host" : "Event greeter => 'event-greeter-rz7lz-pod-938e74' : 1",
4949
"time" : "14:07:00"
5050
}
5151
----

0 commit comments

Comments
 (0)