Skip to content

Commit df869b2

Browse files
Merge pull request #44 from kameshsampath/camelk/cbr
feat: add content based router demo
2 parents 7af9e58 + 1138a5e commit df869b2

19 files changed

Lines changed: 700 additions & 136 deletions

09-camel-k/knative/channels.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: eventing.knative.dev/v1alpha1
22
kind: Channel
33
metadata:
4-
name: messages-us
4+
name: genre-comedy
55
spec:
66
provisioner:
77
apiVersion: eventing.knative.dev/v1alpha1
@@ -12,7 +12,7 @@ spec:
1212
apiVersion: eventing.knative.dev/v1alpha1
1313
kind: Channel
1414
metadata:
15-
name: messages-others
15+
name: genre-others
1616
spec:
1717
provisioner:
1818
apiVersion: eventing.knative.dev/v1alpha1

documentation/modules/ROOT/nav.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@
8282
* xref:05eventing/eventing.adoc[7. Eventing]
8383
** xref:05eventing/eventing.adoc#eventing-prerequisite[Prerequisites]
8484
** xref:05eventing/eventing.adoc#eventing-assumptions[Assumptions]
85-
** xref:05eventing/eventing.adoc#eventing-watch-logs[Watching Logs]
8685
** xref:05eventing/eventing-src-svc.adoc[Source to Service]
8786
*** xref:05eventing/eventing-src-svc.adoc#eventing-source[Event Source]
8887
*** xref:05eventing/eventing-src-svc.adoc#eventing-create-event-source[Create Event Source]
@@ -108,6 +107,7 @@
108107
**** xref:05eventing/eventing-src-sub.adoc#eventing-gen-subscriber-service[Generate Service]
109108
**** xref:05eventing/eventing-src-sub.adoc#eventing-deploy-subscriber-service[Deploy Service]
110109
*** xref:05eventing/eventing-src-sub.adoc#eventing-cleanup[Cleanup]
110+
** xref:05eventing/eventing.adoc#eventing-watch-logs[Watching Logs]
111111
112112
113113
* xref:faq.adoc[8.Frequently Asked Questions]

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,16 @@ image::greeter-00001.png[Greeter Service]
7070

7171
[#basics-invoke-service]
7272
== Invoke Service
73-
include::partial$invoke-service.adoc[tag=*]
73+
74+
:k8s-env: minikube
75+
:k8s-cli: kubectl
76+
include::ROOT:partial$invoke-service.adoc[tag=*]
77+
78+
.(OR)
79+
80+
:k8s-env: minishift
81+
:k8s-cli: oc
82+
include::ROOT:partial$invoke-service.adoc[tag=*]
7483

7584
The last curl command should return a response like **Hi greeter => greeter-00001-deployment-5d696cc6c8-m65s5: 1**
7685

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,15 @@ image::greeter-00001.png[Greeter Service]
7070
[#crtd-invoke-service]
7171
== Invoke Service
7272

73-
include::partial$invoke-service.adoc[tag=*]
73+
:k8s-env: minikube
74+
:k8s-cli: kubectl
75+
include::ROOT:partial$invoke-service.adoc[tag=*]
76+
77+
.(OR)
78+
79+
:k8s-env: minishift
80+
:k8s-cli: oc
81+
include::ROOT:partial$invoke-service.adoc[tag=*]
7482

7583
The command will return `HTTP 404` as there are no routes deployed yet. Let us now deploy a route.
7684

documentation/modules/ROOT/pages/03scaling.adoc

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,15 @@ image::greeter-00001.png[Greeter Service]
7171
[#scaling-invoke-service]
7272
== Invoke Service
7373

74-
include::partial$invoke-service.adoc[tags=*]
74+
:k8s-env: minikube
75+
:k8s-cli: kubectl
76+
include::ROOT:partial$invoke-service.adoc[tag=*]
77+
78+
.(OR)
79+
80+
:k8s-env: minishift
81+
:k8s-cli: oc
82+
include::ROOT:partial$invoke-service.adoc[tag=*]
7583

7684
The last `curl` command should return a response like **Hi greeter => greeter-00001-deployment-5d696cc6c8-m65s5: 1**
7785

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,15 @@ image::event-greeter-00001.png[Event Greeter Service]
226226
[#build-template-invoke-service]
227227
== Invoke Service
228228

229-
include::partial$invoke-service.adoc[tag=env]
229+
:k8s-env: minikube
230+
:k8s-cli: kubectl
231+
include::ROOT:partial$invoke-service.adoc[tag=env]
232+
233+
.(OR)
234+
235+
:k8s-env: minishift
236+
:k8s-cli: oc
237+
include::ROOT:partial$invoke-service.adoc[tag=env]
230238

231239
[source,bash,subs="+macros,+attributes",linenums]
232240
----

documentation/modules/ROOT/pages/04build/build.adoc

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,15 @@ image::event-greeter-00001.png[Event Greeter Service]
307307
[#build-invoke-service]
308308
== Invoke service
309309

310-
include::partial$invoke-service.adoc[tag=env]
310+
:k8s-env: minikube
311+
:k8s-cli: kubectl
312+
include::ROOT:partial$invoke-service.adoc[tag=env]
313+
314+
.(OR)
315+
316+
:k8s-env: minishift
317+
:k8s-cli: oc
318+
include::ROOT:partial$invoke-service.adoc[tag=env]
311319

312320
[source,bash,subs="+macros,+attributes",linenums]
313321
----
Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
1-
# tag::env[]
2-
[source,bash,linenums]
1+
[k8s-env='']
2+
[k8s-cli='']
3+
#tag::env[]
4+
[source,bash,subs="+macros,+attributes"]
35
----
46
INGRESSGATEWAY=istio-ingressgateway
5-
IP_ADDRESS="$(minishift ip):$(kubectl get svc $INGRESSGATEWAY --namespace istio-system --output 'jsonpath={.spec.ports[?(@.port==80)].nodePort}')"
7+
IP_ADDRESS="$({k8s-env} ip):$({k8s-cli} get svc $INGRESSGATEWAY --namespace istio-system --output 'jsonpath={.spec.ports[?(@.port==80)].nodePort}')"
68
----
7-
# end::env[]
9+
#end::env[]
810

9-
# tag::call[]
10-
[source,bash,linenums]
11+
#tag::call[]
12+
[source,bash,subs="+macros,+attributes"]
1113
----
1214
curl -v -H "Host: greeter.knativetutorial.example.com" $IP_ADDRESS
1315
----
1416

1517
.(OR)
1618

17-
[source,bash,linenums]
19+
[source,bash,subs="+macros,+attributes"]
1820
----
1921
http $IP_ADDRESS 'Host: greeter.knativetutorial.example.com'
2022
----
21-
# end::call[]
23+
#end::call[]

documentation/modules/camelk/nav.adoc

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
*** xref:camelk:setup.adoc#camelk-install-minio-s3[Install minio s3 Server]
66
**** xref:camelk:setup.adoc#minio-aws-cli-configure[Configure AWS cli]
77
*** xref:camelk:setup.adoc#install-camel-k[Install Camel-K ]
8-
** xref:camelk:getting-started.adoc[Getting Started]
8+
*** xref:camelk:setup.adoc#configure-local-registry[Configure Local Container Registry]
9+
** xref:camelk:getting-started.adoc[Message Filter]
910
*** xref:camelk:getting-started.adoc#gs-prereq[Prerequisite]
1011
*** xref:camelk:getting-started.adoc#gs-overview[Demo Overview]
1112
*** xref:camelk:getting-started.adoc#gs-deployment[Deployment]
@@ -17,7 +18,7 @@
1718
***** xref:camelk:getting-started.adoc#gs-test-data[Upload Test Data]
1819
***** xref:camelk:getting-started.adoc#gs-invoke-service[Invoke service]
1920
*** xref:camelk:getting-started.adoc#gs-cleanup[Cleanup]
20-
** xref:camelk:poll-enrich.adoc[s3 File Downloader]
21+
** xref:camelk:poll-enrich.adoc[Poll Enrich]
2122
*** xref:camelk:poll-enrich.adoc#pe-prereq[Prerequisite]
2223
*** xref:camelk:poll-enrich.adoc#pe-overview[Demo Overview]
2324
*** xref:camelk:poll-enrich.adoc#pe-deployment[Deployment]
@@ -28,4 +29,20 @@
2829
*** xref:camelk:poll-enrich.adoc#pe-test-cartoon-messages-downloader[Testing Route]
2930
***** xref:camelk:poll-enrich.adoc#pe-test-data[Upload Test Data]
3031
***** xref:camelk:poll-enrich.adoc#pe-invoke-service[Invoke service]
31-
*** xref:camelk:poll-enrich.adoc#pe-cleanup[Cleanup]
32+
*** xref:camelk:poll-enrich.adoc#pe-cleanup[Cleanup]
33+
** xref:camelk:content-based-router.adoc[Content Based Router]
34+
*** xref:camelk:content-based-router.adoc#cbr-prereq[Prerequisite]
35+
*** xref:camelk:content-based-router.adoc#cbr-overview[Demo Overview]
36+
*** xref:camelk:content-based-router.adoc#cbr-deployment[Deployment]
37+
**** xref:camelk:content-based-router.adoc#cbr-make-s3-data-bucket[Create data s3 bucket]
38+
**** xref:camelk:content-based-router.adoc#cbr-create-channels[Create Knative Channels]
39+
**** xref:camelk:content-based-router.adoc#cbr-deploy-routes[Deploy Routes]
40+
***** xref:camelk:content-based-router.adoc#cbr-comedy-genre-handler[Comedy Genre Handler]
41+
***** xref:camelk:content-based-router.adoc#cbr-others-genre-handler[Others Genre Handler]
42+
***** xref:camelk:content-based-router.adoc#cbr-cartoon-genre-router[Cartoon Genre Router]
43+
*** xref:camelk:content-based-router.adoc#cbr-see-what-you-have-deployed[See what you have deployed ]
44+
*** xref:camelk:content-based-router.adoc#cbr-watch-logs[Watching Logs]
45+
*** xref:camelk:content-based-router.adoc#cbr-test-cartoon-genre-router[Testing Route]
46+
***** xref:camelk:content-based-router.adoc#cbr-test-data[Upload Test Data]
47+
***** xref:camelk:content-based-router.adoc#cbr-invoke-service[Invoke service]
48+
*** xref:camelk:content-based-router.adoc#cbr-cleanup[Cleanup]

documentation/modules/camelk/pages/_attributes.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
:scaling-repo: 03-scaling
99
:build-repo: 04-build
1010
:eventing-repo: 05-eventing
11-
:camelk-repo: 09-camelk
11+
:camelk-repo: 09-camel-k
1212
:experimental:
13-
:knative-version: v0.3.0
13+
:knative-version: v0.4.0
1414
:knative-serving-repo: https://github.com/knative/serving/releases/download
1515
:knative-build-repo: https://github.com/knative/build/releases/download
1616
:knative-eventing-repo: https://github.com/knative/eventing/releases/download

0 commit comments

Comments
 (0)