Skip to content

Commit bf3b883

Browse files
authored
more namespace references were removed (#283)
* removed namespace from kubectl and kn commands * more namespace references removed * Updated the traffic distribution to use the new rules Co-authored-by: ammbra <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>
1 parent 259efcb commit bf3b883

3 files changed

Lines changed: 40 additions & 40 deletions

File tree

documentation/modules/eventing/pages/channel-and-subscribers.adoc

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -347,12 +347,12 @@ kn::
347347
[.console-input]
348348
[source,bash,subs="+macros,+attributes"]
349349
----
350-
kn service delete -n {tutorial-namespace} eventinghelloa
351-
kn subscription delete eventinghelloa-sub --namespace {tutorial-namespace}
352-
kn service delete -n {tutorial-namespace} eventinghellob
353-
kn subscription delete eventinghellob-sub --namespace {tutorial-namespace}
354-
kn source ping delete -n {tutorial-namespace} event-greeter-ping-source
355-
kn channel delete -n {tutorial-namespace} eventinghello-ch
350+
kn service delete eventinghelloa
351+
kn subscription delete eventinghelloa-sub
352+
kn service delete eventinghellob
353+
kn subscription delete eventinghellob-sub
354+
kn source ping delete event-greeter-ping-source
355+
kn channel delete eventinghello-ch
356356
----
357357
--
358358
{kubernetes-cli}::
@@ -361,12 +361,12 @@ kn channel delete -n {tutorial-namespace} eventinghello-ch
361361
[.console-input]
362362
[source,bash,subs="+macros,+attributes"]
363363
----
364-
kubectl -n {tutorial-namespace} delete -f eventing-helloa-sink.yaml
365-
kubectl -n {tutorial-namespace} delete -f eventing-helloa-sub.yaml
366-
kubectl -n {tutorial-namespace} delete -f eventing-hellob-sink.yaml
367-
kubectl -n {tutorial-namespace} delete -f eventing-hellob-sub.yaml
368-
kubectl -n {tutorial-namespace} delete -f event-source.yaml
369-
kubectl -n knativetutorial delete -f channel.yaml
364+
kubectl delete -f eventing-helloa-sink.yaml
365+
kubectl delete -f eventing-helloa-sub.yaml
366+
kubectl delete -f eventing-hellob-sink.yaml
367+
kubectl delete -f eventing-hellob-sub.yaml
368+
kubectl delete -f event-source.yaml
369+
kubectl delete -f channel.yaml
370370
----
371371
--
372372
====

documentation/modules/serving/pages/_partials/knative-objects.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ kn::
5656
[.console-input]
5757
[source,bash,subs="+macros,+attributes"]
5858
----
59-
kn route --namespace {tutorial-namespace} list
59+
kn route list
6060
----
6161

6262
[.console-output]

documentation/modules/serving/pages/traffic-distribution.adoc

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -102,15 +102,15 @@ kn::
102102
[.console-input]
103103
[source,bash,subs="+macros,attributes+"]
104104
----
105-
kn revision list --namespace {tutorial-namespace}
105+
kn revision list
106106
----
107107
108108
[.console-output]
109109
[source,bash]
110110
----
111111
NAME SERVICE TRAFFIC TAGS GENERATION AGE CONDITIONS READY REASON
112-
blue-green-canary-yzrwq-2 blue-green-canary 100% 2 2m33s 3 OK / 4 True
113-
blue-green-canary-xjygh-1 blue-green-canary 1 30m 3 OK / 4 True
112+
blue-green-canary-00002 blue-green-canary 100% 2 2m33s 3 OK / 4 True
113+
blue-green-canary-00001 blue-green-canary 1 30m 3 OK / 4 True
114114
----
115115
--
116116
{kubernetes-cli}::
@@ -120,7 +120,7 @@ blue-green-canary-xjygh-1 blue-green-canary 1 30
120120
[.console-input]
121121
[source,bash,subs="+macros,attributes+"]
122122
----
123-
kubectl --namespace {tutorial-namespace} get rev \
123+
kubectl get rev \
124124
--selector=serving.knative.dev/service=blue-green-canary \
125125
--sort-by="{.metadata.creationTimestamp}"
126126
----
@@ -129,8 +129,8 @@ kubectl --namespace {tutorial-namespace} get rev \
129129
[source,bash]
130130
----
131131
NAME CONFIG NAME K8S SERVICE NAME GENERATION READY REASON
132-
blue-green-canary-xjygh-1 blue-green-canary blue-green-canary-xjygh-1 1 True
133-
blue-green-canary-yzrwq-2 blue-green-canary blue-green-canary-yzrwq-2 2 True
132+
blue-green-canary-00001 blue-green-canary blue-green-canary-00001 1 True
133+
blue-green-canary-00002 blue-green-canary blue-green-canary-00002 2 True
134134
----
135135
--
136136
====
@@ -144,7 +144,7 @@ video::KAeDG4j5fr8[youtube,width=640,height=480]
144144
[#tag-service-revisions]
145145
== Tag Revisions
146146

147-
As you had observed that the Knative service `blue-green-canary` now has two revisions namely *blue-green-canary-xjygh-1* and *blue-green-canary-yzrwq-2*. As the Revision names are autogenerated it is hard to comprehend to which code/configuration set it corresponds to. To overcome this problem Knative provides *tagging* of revision names that allows one to tag a revision name to a logical human understanable names called *tags*.
147+
As you had observed that the Knative service `blue-green-canary` now has two revisions namely *blue-green-canary-00001* and *blue-green-canary-00002*. As the Revision names are autogenerated it is hard to comprehend to which code/configuration set it corresponds to. To overcome this problem Knative provides *tagging* of revision names that allows one to tag a revision name to a logical human understanable names called *tags*.
148148

149149
As our colors service shows different colors on the browser let us tag the revisions with color,
150150

@@ -160,20 +160,20 @@ kn revision list -s blue-green-canary
160160
[source,bash]
161161
----
162162
NAME SERVICE TRAFFIC TAGS GENERATION AGE CONDITIONS READY REASON
163-
blue-green-canary-yzrwq-2 blue-green-canary 100% 2 23m 3 OK / 4 True
164-
blue-green-canary-xjygh-1 blue-green-canary 1 51m 3 OK / 4 True
163+
blue-green-canary-00002 blue-green-canary 100% 2 23m 3 OK / 4 True
164+
blue-green-canary-00001 blue-green-canary 1 51m 3 OK / 4 True
165165
----
166166

167167
When Knative rolls out a new revision, it increments the `GENERATION` by *1* and then routes *100%* of the `TRAFFIC` to it, hence we can use the `GENERATION` or `TRAFFIC` to identify the latest reivsion.
168168

169169
=== Tag Blue
170170

171-
Let us tag `blue-green-canary-xjygh-1` which shows *blue* browser page with tag name `blue`.
171+
Let us tag `blue-green-canary-00001` which shows *blue* browser page with tag name `blue`.
172172

173173
[.console-input]
174174
[source,bash,subs="+macros,attributes+,+quotes"]
175175
----
176-
kn service update blue-green-canary --tag=#blue-green-canary-xjygh-1#=blue
176+
kn service update blue-green-canary --tag=#blue-green-canary-00001#=blue
177177
----
178178

179179
[.console-output]
@@ -186,18 +186,18 @@ Updating Service 'blue-green-canary' in namespace 'knativetutorial':
186186
0.162s Waiting for load balancer to be ready
187187
0.303s Ready to serve.
188188
189-
Service 'blue-green-canary' with latest revision 'blue-green-canary-yzrwq-2' (unchanged) is available at URL:
189+
Service 'blue-green-canary' with latest revision 'blue-green-canary-00002' (unchanged) is available at URL:
190190
http://blue-green-canary.knativetutorial.192.168.64.13.nip.io
191191
----
192192

193193
=== Tag Green
194194

195-
Let us tag `blue-green-canary-yzrwq-2` which shows *green* browser page with tag name `green`.
195+
Let us tag `blue-green-canary-00002` which shows *green* browser page with tag name `green`.
196196

197197
[.console-input]
198198
[source,bash,subs="+macros,attributes+,+quotes"]
199199
----
200-
kn service update blue-green-canary --tag=#blue-green-canary-yzrwq-2#=green
200+
kn service update blue-green-canary --tag=#blue-green-canary-00002#=green
201201
----
202202

203203
[.console-output]
@@ -210,7 +210,7 @@ Updating Service 'blue-green-canary' in namespace 'knativetutorial':
210210
0.162s Waiting for load balancer to be ready
211211
0.303s Ready to serve.
212212
213-
Service 'blue-green-canary' with latest revision 'blue-green-canary-yzrwq-2' (unchanged) is available at URL:
213+
Service 'blue-green-canary' with latest revision 'blue-green-canary-00002' (unchanged) is available at URL:
214214
http://blue-green-canary.knativetutorial.192.168.64.13.nip.io
215215
----
216216

@@ -234,7 +234,7 @@ Updating Service 'blue-green-canary' in namespace 'knativetutorial':
234234
0.162s Waiting for load balancer to be ready
235235
0.303s Ready to serve.
236236
237-
Service 'blue-green-canary' with latest revision 'blue-green-canary-yzrwq-2' (unchanged) is available at URL:
237+
Service 'blue-green-canary' with latest revision 'blue-green-canary-00002' (unchanged) is available at URL:
238238
http://blue-green-canary.knativetutorial.192.168.64.13.nip.io
239239
----
240240

@@ -250,8 +250,8 @@ kn revision list -s blue-green-canary
250250
[source,bash,subs="+quotes"]
251251
----
252252
NAME SERVICE TRAFFIC TAGS GENERATION AGE CONDITIONS READY REASON
253-
blue-green-canary-yzrwq-2 blue-green-canary 100% #latest,green# 2 29m 3 OK / 4 True
254-
blue-green-canary-xjygh-1 blue-green-canary #blue# 1 57m 3 OK / 4 True
253+
blue-green-canary-00002 blue-green-canary 100% #latest,green# 2 29m 3 OK / 4 True
254+
blue-green-canary-00001 blue-green-canary #blue# 1 57m 3 OK / 4 True
255255
----
256256

257257
As *green* happend to be latest revision it has been tagged with name `lastest` in addition to `green`.
@@ -265,7 +265,7 @@ Knative offers a simple way of switching 100% of the traffic from one Knative se
265265

266266
In this exercise you will applying the Blue/Green deployment pattern with the Knative Service called greeter. You have already deployed two <<deploying-revisions,revisions>> of blue-green-canary identified using the tags `blue` and `green`.
267267

268-
With the deployment of *green* revison you noticed that Knative automatically started to routing 100% of the traffic to `blue-green-canary-yzrwq-2`.
268+
With the deployment of *green* revison you noticed that Knative automatically started to routing 100% of the traffic to `blue-green-canary-00002`.
269269

270270
Now let us assume, due to a critical bug we need to roll back `green` to `blue`.
271271

@@ -292,7 +292,7 @@ Let us list all revisions with tags:
292292
[.console-input]
293293
[source,bash,subs="+macros,+attributes"]
294294
----
295-
kn revision list --namespace {tutorial-namespace}
295+
kn revision list
296296
----
297297

298298
Based on the revision tags that we created earlier, the output should be like:
@@ -301,8 +301,8 @@ Based on the revision tags that we created earlier, the output should be like:
301301
[source,text,subs="quotes"]
302302
----
303303
NAME SERVICE TRAFFIC TAGS GENERATION AGE CONDITIONS READY REASON
304-
blue-green-canary-yzrwq-2 blue-green-canary latest,green 2 56m 4 OK / 4 True
305-
blue-green-canary-xjygh-1 blue-green-canary #100%# #blue# 1 83m 4 OK / 4 True
304+
blue-green-canary-00002 blue-green-canary latest,green 2 56m 4 OK / 4 True
305+
blue-green-canary-00001 blue-green-canary #100%# #blue# 1 83m 4 OK / 4 True
306306
----
307307

308308
Let us list the available sub-routes:
@@ -342,8 +342,8 @@ image::blue-green-canary-blue.png[]
342342
[source,bash,subs="+quotes,+attributes,+macros"]
343343
----
344344
NAME READY STATUS RESTARTS AGE
345-
#blue-green-canary-xjygh-1-deployment-54597d94b9-25x4r# 2/2 Running 0 12s
346-
blue-green-canary-yzrwq-2-deployment-6cb545df65-ktqc2 0/2 Terminating 0 2m
345+
#blue-green-canary-00001-deployment-54597d94b9-25x4r# 2/2 Running 0 12s
346+
blue-green-canary-00002-deployment-6cb545df65-ktqc2 0/2 Terminating 0 2m
347347
----
348348

349349
Since `blue` is the active revision now, the existing `green` pod is getting terminated as no future requests will be served by it.
@@ -375,7 +375,7 @@ To roll out the greeter canary deployment use the following command:
375375
[.console-input]
376376
[source,bash,subs="+macros,+attributes"]
377377
----
378-
kn service update blue-green-canary -n {tutorial-namespace} \
378+
kn service update blue-green-canary \
379379
--traffic="blue=80" \
380380
--traffic="green=20"
381381
----
@@ -398,8 +398,8 @@ watch "{kubernetes-cli} get pods -n {tutorial-namespace}"
398398
[source,bash,subs="+quotes,+attributes,+macros"]
399399
----
400400
NAME READY STATUS RESTARTS AGE
401-
blue-green-canary-xjygh-1-deployment-54597d94b9-q8c57 2/2 Running 0 79s
402-
blue-green-canary-yzrwq-2-deployment-8564bf5b5b-gtvh4 2/2 Running 0 14s
401+
blue-green-canary-00001-deployment-54597d94b9-q8c57 2/2 Running 0 79s
402+
blue-green-canary-00002-deployment-8564bf5b5b-gtvh4 2/2 Running 0 14s
403403
----
404404

405405
[NOTE,caption=Challenge]

0 commit comments

Comments
 (0)