Skip to content

Commit

Permalink
feat: add get started section for eventing with camel
Browse files Browse the repository at this point in the history
- started version 1.0-SNAPSHOT
- adds new chapter documentation
- adds getting started demo and chapter for eventing with camel

Fixes #34
  • Loading branch information
kameshsampath committed Mar 6, 2019
1 parent f2ae8e7 commit 5ab91ea
Show file tree
Hide file tree
Showing 33 changed files with 937 additions and 199 deletions.
4 changes: 2 additions & 2 deletions 01-basics/knative/service.yaml
Expand Up @@ -8,10 +8,10 @@ spec:
revisionTemplate:
spec:
container:
image: dev.local/rhdevelopers/greeter:0.0.1
image: quay.io/rhdevelopers/greeter:0.0.1
livenessProbe:
httpGet:
path: /healthz
readinessProbe:
httpGet:
path: /healthz
path: /healthz
8 changes: 8 additions & 0 deletions 09-camel-k/.editorconfig
@@ -0,0 +1,8 @@
root = true

[*]
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = false
insert_final_newline = false
20 changes: 20 additions & 0 deletions 09-camel-k/knative/channels.yaml
@@ -0,0 +1,20 @@
apiVersion: eventing.knative.dev/v1alpha1
kind: Channel
metadata:
name: messages-us
spec:
provisioner:
apiVersion: eventing.knative.dev/v1alpha1
kind: ClusterChannelProvisioner
name: in-memory-channel

---
apiVersion: eventing.knative.dev/v1alpha1
kind: Channel
metadata:
name: messages-others
spec:
provisioner:
apiVersion: eventing.knative.dev/v1alpha1
kind: ClusterChannelProvisioner
name: in-memory-channel
3 changes: 3 additions & 0 deletions 09-camel-k/knative/print.groovy
@@ -0,0 +1,3 @@
from("knative:channel/sortucase")
.convertBodyTo(String.class)
.to("log:info");
50 changes: 50 additions & 0 deletions apps/apache-artemis/skaffold.yaml
@@ -0,0 +1,50 @@
---
apiVersion: v1
kind: Service
metadata:
name: apache-artemis-web
spec:
type: NodePort
selector:
app: apache-artemis
ports:
- name: admin-console
port: 8161
targetPort: 8161
---
apiVersion: v1
kind: Service
metadata:
name: apache-artemis-amqp
spec:
type: NodePort
selector:
app: apache-artemis
ports:
- name: amqp
port: 5672
targetPort: 5672
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: apache-artemis
spec:
selector:
matchLabels:
app: apache-artemis
template:
metadata:
labels:
app: apache-artemis
spec:
containers:
- name: broker
image: quay.io/rhdevelopers/apache-artemis:2.6.4
ports:
- containerPort: 8161
protocol: TCP
name: admin-console
- containerPort: 5672
protocol: TCP
name: amqp
92 changes: 92 additions & 0 deletions apps/minio-s3-server/skaffold.yaml
@@ -0,0 +1,92 @@
---
apiVersion: v1
kind: Secret
type: Opaque
metadata:
annotations: {}
name: minio-access-secrets
stringData:
minioSecret: demosecretkey
minioAccessKey: demoaccesskey
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: home-claim
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 8Gi
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: minio-config-claim
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 8Gi
---
apiVersion: v1
kind: Service
metadata:
name: minio-server
spec:
type: NodePort
selector:
app: minio-server
ports:
- name: web
port: 80
targetPort: 9000
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: minio-server
spec:
selector:
matchLabels:
app: minio-server
template:
metadata:
labels:
app: minio-server
spec:
containers:
- name: minio
env:
- name: MINIO_ACCESS_KEY
valueFrom:
secretKeyRef:
name: minio-access-secrets
key: minioAccessKey
- name: MINIO_SECRET_KEY
valueFrom:
secretKeyRef:
name: minio-access-secrets
key: minioSecret
image: minio/minio
args:
- server
- /data
ports:
- containerPort: 9000
protocol: TCP
name: web
volumeMounts:
- name: home
mountPath: /data
- name: config
mountPath: /root/.minio
volumes:
- name: home
persistentVolumeClaim:
claimName: home-claim
- name: config
persistentVolumeClaim:
claimName: minio-config-claim
Empty file removed bin/.gitkeep
Empty file.
12 changes: 0 additions & 12 deletions bin/oc-istio-policies.sh

This file was deleted.

3 changes: 2 additions & 1 deletion documentation/antora.yml
@@ -1,7 +1,8 @@
name: knative-tutorial
title: Knative Tutorial
version: "v1.0"
version: 1.0-SNAPSHOT
nav:
- modules/ROOT/nav.adoc
- modules/camelk/nav.adoc

start_page: ROOT:index.adoc
2 changes: 1 addition & 1 deletion documentation/modules/ROOT/nav.adoc
Expand Up @@ -110,6 +110,6 @@
*** xref:05eventing/eventing-src-sub.adoc#eventing-cleanup[Cleanup]
* xref:faq.adoc[Frequently Asked Questions]
* xref:faq.adoc[8.Frequently Asked Questions]
16 changes: 1 addition & 15 deletions documentation/modules/ROOT/pages/05eventing/eventing.adoc
Expand Up @@ -21,21 +21,7 @@ You have completed the xref:ROOT:04build/build.adoc[Build] or xref:ROOT:04build/
[#eventing-watch-logs]
== Watching Logs

Since it is a Cron job source, it would have started to emit events every minute. We can watch the logs of the service to see the messages delivered.

The logs could be watched using the command:

[source,bash,subs="+macros,+attributes"]
----
kubectl logs -n knativetutorial -f <pod-name> -c user-container
----

.(OR)

[source,bash,subs="+macros,+attributes"]
----
oc logs -n knativetutorial -f <pod-name> -c user-container
----
include::partial$watching-logs.adoc[]

[TIP]
====
Expand Down
15 changes: 15 additions & 0 deletions documentation/modules/ROOT/pages/_partials/watching-logs.adoc
@@ -0,0 +1,15 @@
Since it is a Cron job source, it would have started to emit events every minute. We can watch the logs of the service to see the messages delivered.

The logs could be watched using the command:

[source,bash,subs="+macros,+attributes"]
----
kubectl logs -n knativetutorial -f <pod-name> -c user-container
----

.(OR)

[source,bash,subs="+macros,+attributes"]
----
oc logs -n knativetutorial -f <pod-name> -c user-container
----
4 changes: 4 additions & 0 deletions documentation/modules/camelk/_attributes.adoc
@@ -0,0 +1,4 @@
:icons: font
:stem: latexmath
:source-highlighter: coderay
:imagesdir: {moduledir}/assets/images
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions documentation/modules/camelk/nav.adoc
@@ -0,0 +1,19 @@
* xref:intro.adoc[9.Eventing with Apache Camel]
** xref:camelk:setup.adoc[Setup]
*** xref:camelk:setup.adoc#camelk-prerequisite[Prerequisite]
*** xref:camelk:setup.adoc#camelk-download-sources[Download Demo Sources]
*** xref:camelk:setup.adoc#camelk-install-minio-s3[Install minio s3 Server]
**** xref:camelk:setup.adoc#minio-aws-cli-configure[Configure AWS cli]
*** xref:camelk:setup.adoc#install-camel-k[Install Camel-K ]
** xref:camelk:getting-started.adoc[Getting Started]
*** xref:camelk:getting-started.adoc#gs-prereq[Prerequisite]
*** xref:camelk:getting-started.adoc#gs-overview[Demo Overview]
*** xref:camelk:getting-started.adoc#gs-deployment[Deployment]
**** xref:camelk:getting-started.adoc#gs-make-s3-data-bucket[Create data s3 bucket]
**** xref:camelk:getting-started.adoc#gs-make-s3-top-bucket[Create top s3 bucket]
**** xref:camelk:getting-started.adoc#gs-cartoon-messages-mover[Deploy Camel Route]
*** xref:camelk:getting-started.adoc#gs-watch-logs[Watching Logs]
*** xref:camelk:getting-started.adoc#gs-test-cartoon-messages-mover[Testing Route]
***** xref:camelk:getting-started.adoc#gs-test-data[Upload Test Data]
***** xref:camelk:getting-started.adoc#gs-invoke-service[Invoke service]
*** xref:camelk:getting-started.adoc#gs-cleanup[Cleanup]
17 changes: 17 additions & 0 deletions documentation/modules/camelk/pages/_attributes.adoc
@@ -0,0 +1,17 @@
:moduledir: ..
:branch: master
:github-repo: https://github.com/redhat-developer-demos/knative-tutorial/blob/{branch}
:camelk-demos-github-repo-uri: https://github.com/redhat-developer-demos/knative-tutorial-camelk
:camelk-demos-github-repo: {camelk-demos-github-repo-uri}/blob/{branch}
:basics-repo: 01-basics
:configs-and-routes-repo: 02-configs-and-routes
:scaling-repo: 03-scaling
:build-repo: 04-build
:eventing-repo: 05-eventing
:camelk-repo: 09-camelk
:experimental:
:knative-version: v0.3.0
:knative-serving-repo: https://github.com/knative/serving/releases/download
:knative-build-repo: https://github.com/knative/build/releases/download
:knative-eventing-repo: https://github.com/knative/eventing/releases/download
:knative-sources-repo: https://github.com/knative/eventing-sources/releases/download
@@ -0,0 +1,41 @@
#tag::integrations[]
[source,bash,linenums]
----
kubectl -n knativetutorial get integrations.camel.apache.org
----

.(OR)

[source,bash,linenums]
----
oc -n knativetutorial get get integrations.camel.apache.org
----
#end::integrations[]

#tag::svc[]
[source,bash,linenums]
----
kubectl -n knativetutorial get svc
----

.(OR)

[source,bash,linenums]
----
oc -n knativetutorial get get svc
----
#end::svc[]

#tag::deployments[]
[source,bash,linenums]
----
kubectl -n knativetutorial get deployments
----

.(OR)

[source,bash,linenums]
----
oc -n knativetutorial get get deployments
----
#end::deployments[]
31 changes: 31 additions & 0 deletions documentation/modules/camelk/pages/_partials/extras.adoc
@@ -0,0 +1,31 @@

# tag::minio[]

For various exercises in this cookbook we will be using the s3 kind of object storage. We will use open source object storage called https://github.com/minio/minio[minio] that is compatible with Amazon S3

The following section details how to setup minio server

[source,bash]
----
cd $COOKBOOKS_SOURCES_HOME/minio-s3-server
oc apply -f skaffold.yaml -n cookbook
oc expose svc minio-server -n cookbook
----

[.text-center]
**(OR)**
[source,bash]
----
kubectl apply -f skaffold.yaml -n cookbook
----

[NOTE]
====
Details on how to use AWS s3 with minio is available https://docs.minio.io/docs/aws-cli-with-minio.html[here]
====

A successful minio deployment can be viewed via OpenShift dashboard as shown below:

image::minio-server.png[minio server]

#end::minio[]

0 comments on commit 5ab91ea

Please sign in to comment.