Skip to content

Commit 73ecdaa

Browse files
hatmarchMarc Hildenbrand
and
Marc Hildenbrand
authored
Selected fixes (#255)
* Ignore .DS_Store * Fix for build-tasks.ts This change is necessary for newer versions of npm/typescript bash-4.4$ npm version { npm: '6.14.8', ares: '1.16.0', brotli: '1.0.6', cldr: '37.0', http_parser: '2.9.3', icu: '67.1', llhttp: '2.1.2', modules: '72', napi: '7', nghttp2: '1.41.0', node: '12.19.1', openssl: '1.1.1g', tz: '2019c', unicode: '13.0', uv: '1.39.0', v8: '7.8.279.23-node.44', zlib: '1.2.11' } bash-4.4$ gulp -v CLI version: 2.3.0 Local version: 4.0.2 bash-4.4$ npx -v 10.2.2 * Fix broken kn revision command Also remove some hard coding for greater attribute use * Fix incorrect console output * Fixes to the scaling pages Fix incorrect statements and commands (e.g. default utilization rate has changed yielding 5 pods instead of 7) * Update tag and traffic aspects of kn update so that it doesn't hang Tested with version 0.17.0 * Updates to the Eventing section up to Source-to-Sink Corrects a number of issues and updates output to match instructions given * Fix Traffic Distribution Fix incorrect path for applying knative service files Update services so that kn and {kubernetes-cli} can be used interchangeably in this section - without commenting out the health check, kn command can't be used to ammend service created with CLI because validation hook would require a rename of the service Update example files Co-authored-by: Marc Hildenbrand <[email protected]>
1 parent 5f175a8 commit 73ecdaa

18 files changed

+143
-130
lines changed

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,6 @@ bin/kubectl
4444
gh-pages
4545
staging-gh-pages
4646

47-
yarn.lock
47+
yarn.lock
48+
49+
.DS_Store

build-tasks.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ interface BuildConfig {
1414
cacheDir: string;
1515
[x: string]: unknown;
1616
$0: string;
17-
_: string[];
17+
_: (string | number)[];
1818
}
1919

2020
//Antora Published Site info

documentation/modules/eventing/examples/eventing/eventinghello-source.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ kind: PingSource
33
metadata:
44
name: eventinghello-ping-source
55
spec:
6-
schedule: "*/2 * * * *"
7-
jsonData: '{"key": "every 2 mins"}'
6+
jsonData: '{"message": "Thanks for doing Knative Tutorial"}'
7+
schedule: '*/2 * * * *'
88
sink:
99
ref:
1010
apiVersion: serving.knative.dev/v1

documentation/modules/eventing/nav.adoc

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
** xref:eventing-src-to-sink.adoc#eventing-sink-service[Sink Service]
55
** xref:eventing-src-to-sink.adoc#eventing-create-event-source[Create Event Source]
66
** xref:eventing-src-to-sink.adoc#eventing-verify-event-source[Verify]
7-
** xref:eventing-src-to-sink.adoc#eventing-see-what-you-have-deployed[See What You Have Deployed]
87
** xref:eventing-src-to-sink.adoc#eventing-cleanup[Cleanup]
98
109
* xref:channel-and-subscribers.adoc[Channel and Subscribers]

documentation/modules/eventing/pages/_attributes.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
:moduledir: ..
2-
:github-repo: https://github.com/redhat-developer-demos/knative-tutorial/blob/{branch}
2+
:github-repo: {repo-base}/blob/{branch}
33
:basics-repo: serving
44
:configs-and-routes-repo: configs-and-routes
55
:scaling-repo: scaling

documentation/modules/eventing/pages/_partials/deploy-knative-resources.adoc

+2-1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ kn service create {sink-service-name} \
4545
kn source ping create eventinghello-ping-source \
4646
--namespace {tutorial-namespace} \
4747
--schedule "*/2 * * * *" \
48+
--data pass:['{"message": "Thanks for doing Knative Tutorial"}'] \
4849
--sink ksvc:eventinghello
4950
----
5051
#end::eventing-hello-source[]
@@ -110,7 +111,7 @@ kn trigger create {trigger-name} \
110111
[.console-input]
111112
[source,bash,subs="+macros,+attributes"]
112113
----
113-
{kubernetes-cli} apply -n {tutorial-namespace} -f link:{github-repo}/{eventing-repo}/knative/{service-file}[{service-file}]
114+
{kubernetes-cli} apply -n {tutorial-namespace} -f link:{github-repo}/{eventing-repo}/{service-file}[pass:[${TUTORIAL_HOME}]/{eventing-repo}/{service-file}]
114115
----
115116
--
116117
====

documentation/modules/eventing/pages/_partials/watching-logs.adoc

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
ifndef::workshop[]
2-
[kube-ns='knativetutorial']
3-
[kube-svc='']
1+
2+
:kube-svc: eventing-hello
43

54
In the eventing related subsections of this tutorial, event sources are configured to emit events every minute with a `PingSource` or with a `ContainerSource`.
65

76
The logs could be watched using the command:
87

9-
[source,yaml,subs="attributes+,+macros"]
8+
[source,yaml,subs="+attributes,+macros"]
109
----
11-
kubectl logs -n {kube-ns} -f <pod-name> -c user-container
10+
{kubernetes-cli} logs -n {tutorial-namespace} -f <pod-name> -c user-container
1211
----
1312

1413
[TIP]
1514
====
1615
* Using stern with the command `stern -n {kube-ns} {kube-svc}`, to filter the logs further add `-c user-container` to the stern command.
1716
17+
[.console-input]
1818
[source,bash,subs="+macros,+attributes"]
1919
----
20-
stern -n {kube-ns} -c user-container {kube-svc}
20+
stern -n {tutorial-namespace} -c user-container {kube-svc}
2121
----
2222
====
2323

@@ -43,4 +43,4 @@ event-greeter-g94kp-deployment-89f66cb58-wjl2v user-container "message" : "Tha
4343
event-greeter-g94kp-deployment-89f66cb58-wjl2v user-container "host" : "Event greeter => 'event-greeter-5cbh5-pod-52d8fb' : 2",
4444
event-greeter-g94kp-deployment-89f66cb58-wjl2v user-container "time" : "13:52:07"
4545
event-greeter-g94kp-deployment-89f66cb58-wjl2v user-container }
46-
----
46+
----

documentation/modules/eventing/pages/eventing-src-to-sink.adoc

+34-29
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,16 @@ kn::
127127
----
128128
kn source ping list -n {tutorial-namespace}
129129
----
130+
131+
Running the above command should return the following result:
132+
133+
[.console-output]
134+
[source,bash]
135+
----
136+
NAME SCHEDULE SINK AGE CONDITIONS READY REASON
137+
eventinghello-ping-source */2 * * * * ksvc:eventinghello 99s 4 OK / 4 True
138+
----
139+
130140
--
131141
{kubernetes-cli}::
132142
+
@@ -138,47 +148,42 @@ kubectl -n {tutorial-namespace} get \
138148
pingsources.sources.knative.dev \
139149
eventinghello-ping-source
140150
----
141-
--
142-
====
143151
144152
Running the above command should return the following result:
145153
146-
[tabs]
147-
====
148-
kn::
149-
+
150-
--
151154
[.console-output]
152-
[source,bash]
153-
----
154-
NAME SCHEDULE SINK AGE CONDITIONS READY REASON
155-
eventinghello-ping-source */2 * * * * ksvc:eventinghello 99s 4 OK / 4 True
156-
----
157-
--
158-
{kubernetes-cli}::
159-
+
160-
--
161-
[.console-output]
162-
[source,bash]
155+
[source,bash,subs="+macros,+attributes"]
163156
----
164157
NAME SINK AGE READY REASON
165158
eventinghello-ping-source http://eventinghello.knativetutorial.svc.cluster.local 47s True
166159
----
167160
--
168161
====
169162

163+
If you haven't already, you can xref:{eventing-repo}#eventing-watch-logs[watch logs] to see the ping job source sending an event every 2 minutes:
170164

171-
You can xref:{eventing-repo}#eventing-watch-logs[watch logs] to see the ping job source sending an event every 2 minutes.
172-
173-
[#eventing-see-what-you-have-deployed]
174-
== See what you have deployed
165+
[.console-input]
166+
[source,bash,subs="+macros,+attributes"]
167+
----
168+
stern eventinghello -c user-container-n {tutorial-namespace}
169+
----
175170

176-
=== sources
177-
include::eventing:partial$knative-objects.adoc[tag=knative-event-ping-sources]
171+
[.console-output]
172+
[source,bash,subs="quotes"]
173+
----
174+
...
175+
eventinghello-2m4hn-deployment-c8f4f6758-qrjm6 user-container 2021-01-28 08:14:05,427 INFO [eventing-hello] (executor-thread-1) ce-id=4b59c201-56a3-4189-b042-4246d3f33504
176+
eventinghello-2m4hn-deployment-c8f4f6758-qrjm6 user-container 2021-01-28 08:14:05,501 INFO [eventing-hello] (executor-thread-1) ce-source=/apis/v1/namespaces/user2-knativetutorial/pingsources/eventinghello-ping-source
177+
eventinghello-2m4hn-deployment-c8f4f6758-qrjm6 user-container 2021-01-28 08:14:05,501 INFO [eventing-hello] (executor-thread-1) ce-specversion=1.0
178+
eventinghello-2m4hn-deployment-c8f4f6758-qrjm6 user-container 2021-01-28 08:14:05,501 INFO [eventing-hello] (executor-thread-1) ce-time=2021-01-28T08:14:00.000224506Z
179+
eventinghello-2m4hn-deployment-c8f4f6758-qrjm6 user-container 2021-01-28 08:14:05,502 INFO [eventing-hello] (executor-thread-1) ce-type=dev.knative.sources.ping
180+
eventinghello-2m4hn-deployment-c8f4f6758-qrjm6 user-container 2021-01-28 08:14:05,502 INFO [eventing-hello] (executor-thread-1) content-type=application/json
181+
eventinghello-2m4hn-deployment-c8f4f6758-qrjm6 user-container 2021-01-28 08:14:05,502 INFO [eventing-hello] (executor-thread-1) content-length=47
182+
#eventinghello-2m4hn-deployment-c8f4f6758-qrjm6 user-container 2021-01-28 08:14:05,502 INFO [eventing-hello] (executor-thread-1) POST:{"message":"Thanks for doing Knative Tutorial"}#
183+
eventinghello-2m4hn-deployment-c8f4f6758-qrjm6 user-container I> No access restrictor found, access to any MBean is allowed
184+
eventinghello-2m4hn-deployment-c8f4f6758-qrjm6 user-container Jolokia: Agent started with URL https://10.129.4.97:8778/jolokia/
185+
----
178186

179-
=== services
180-
:svc-name: eventinghello
181-
include::eventing:partial$knative-objects.adoc[tag=knative-event-services]
182187

183188
[#eventing-cleanup]
184189
== Cleanup
@@ -201,8 +206,8 @@ kn service delete -n {tutorial-namespace} eventinghello
201206
[.console-input]
202207
[source,bash,subs="+macros,+attributes"]
203208
----
204-
kubectl -n {tutorial-namespace} delete -f eventinghello-source.yaml
205-
kubectl -n {tutorial-namespace} delete -f eventing-hello-sink.yaml
209+
{kubernetes-cli} -n {tutorial-namespace} delete -f pass:[${TUTORIAL_HOME}]/eventing/eventinghello-source.yaml
210+
{kubernetes-cli} -n {tutorial-namespace} delete -f pass:[${TUTORIAL_HOME}]/eventing/eventing-hello-sink.yaml
206211
----
207212
--
208213
====

documentation/modules/serving/examples/serving/greeter-v1-service.yaml

+6-6
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ spec:
99
spec:
1010
containers:
1111
- image: quay.io/rhdevelopers/knative-tutorial-greeter:quarkus
12-
livenessProbe:
13-
httpGet:
14-
path: /healthz
15-
readinessProbe:
16-
httpGet:
17-
path: /healthz
12+
# livenessProbe:
13+
# httpGet:
14+
# path: /healthz
15+
# readinessProbe:
16+
# httpGet:
17+
# path: /healthz

documentation/modules/serving/examples/serving/greeter-v2-service.yaml

+6-6
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ spec:
1212
env:
1313
- name: MESSAGE_PREFIX
1414
value: Namaste
15-
livenessProbe:
16-
httpGet:
17-
path: /healthz
18-
readinessProbe:
19-
httpGet:
20-
path: /healthz
15+
# livenessProbe:
16+
# httpGet:
17+
# path: /healthz
18+
# readinessProbe:
19+
# httpGet:
20+
# path: /healthz

documentation/modules/serving/examples/serving/service-pinned.yaml

+6-6
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ spec:
1010
env:
1111
- name: MESSAGE_PREFIX
1212
value: Namaste
13-
livenessProbe:
14-
httpGet:
15-
path: /healthz
16-
readinessProbe:
17-
httpGet:
18-
path: /healthz
13+
# livenessProbe:
14+
# httpGet:
15+
# path: /healthz
16+
# readinessProbe:
17+
# httpGet:
18+
# path: /healthz
1919
traffic:
2020
- tag: v1
2121
revisionName: greeter-v1

documentation/modules/serving/pages/_partials/deploy-knative-resources.adoc

+7-13
Original file line numberDiff line numberDiff line change
@@ -46,40 +46,34 @@ kn service update greeter \
4646
[.console-input]
4747
[source,bash,subs="+macros,+attributes"]
4848
----
49-
kn service update greeter --tag="greeter-v1=v1"
49+
kn service update greeter --tag greeter-v1=v1
5050
----
5151
.Tag Revision v2
5252
[.console-input]
5353
[source,bash,subs="+macros,+attributes"]
5454
----
55-
kn service update greeter --tag="greeter-v2=v2"
55+
kn service update greeter --tag greeter-v2=v2
5656
----
5757

5858
.Tag Revision latest
5959
[.console-input]
6060
[source,bash,subs="+macros,+attributes"]
6161
----
62-
kn service update greeter --tag="@latest=latest"
62+
kn service update greeter --tag @latest=latest
6363
----
6464

6565
.Route all traffic to v1
6666
[.console-input]
6767
[source,bash,subs="+macros,+attributes"]
6868
----
69-
kn service update greeter \
70-
--traffic="v1=100" \
71-
--traffic="v2=0" \
72-
--traffic="latest=0"
69+
kn service update greeter --traffic v1=100,v2=0,latest=0
7370
----
7471
#end::td-pinned[]
7572
#tag::td-canary[]
7673
[.console-input]
7774
[source,bash,subs="+macros,+attributes"]
7875
----
79-
kn service update greeter \
80-
--traffic="v1=80" \
81-
--traffic="v2=20" \
82-
--traffic="latest=0"
76+
kn service update greeter --traffic v1=80,v2=20,latest=0
8377
----
8478
#end::td-canary[]
8579
#tag::scaling-10[]
@@ -95,7 +89,7 @@ kn service create prime-generator \
9589
[.console-input]
9690
[source,bash,subs="+macros,+attributes"]
9791
----
98-
kn service create prime-generator \
92+
kn service update prime-generator \
9993
--concurrency-target=10 \
10094
--scale-min=2 \
10195
--image=quay.io/rhdevelopers/prime-generator:v27-quarkus
@@ -109,7 +103,7 @@ kn service create prime-generator \
109103
[.console-input]
110104
[source,bash,subs="+macros,+attributes"]
111105
----
112-
{kubernetes-cli} apply -n {tutorial-namespace} -f link:{github-repo}/{basics-repo}/knative/{service-file}[{service-file}]
106+
{kubernetes-cli} apply -n tutorial-namespace} -f link:{github-repo}/{basics-repo}/{service-file}[pass:[${TUTORIAL_HOME}]/{basics-repo}/{service-file}]
113107
----
114108
--
115109
====

0 commit comments

Comments
 (0)