Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use template for documents and add kamel bind and Kafka instructions #388

Merged
merged 2 commits into from
Jun 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/antora-playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@ content:
asciidoc:
extensions:
- "@djencks/asciidoctor-antora-indexer"
ui:
bundle:
url: https://gitlab.com/antora/antora-ui-default/-/jobs/artifacts/master/raw/build/ui-bundle.zip?job=bundle-stable
snapshot: true
83 changes: 83 additions & 0 deletions docs/modules/ROOT/kamelet.adoc.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT
= {{ .Image }} {{ .Kamelet.Spec.Definition.Title }}

*Provided by: "{{ index .Kamelet.ObjectMeta.Annotations "camel.apache.org/provider" }}"*

*Support Level for this Kamelet is: "{{ index .Kamelet.ObjectMeta.Annotations "camel.apache.org/kamelet.support.level" }}"*

{{ .Kamelet.Spec.Definition.Description }}

== Configuration Options
{{ if .HasProperties }}
The following table summarizes the configuration options available for the `{{ .Kamelet.ObjectMeta.Name }}` Kamelet:
{{ .Properties }}
NOTE: Fields marked with ({empty}*) are mandatory.
{{ else }}
The Kamelet does not specify any configuration option.
{{ end }}
== Usage

This section summarizes how the `{{ .Kamelet.ObjectMeta.Name }}` can be used in various contexts.

=== Knative {{ index .Kamelet.ObjectMeta.Labels "camel.apache.org/kamelet.type" | ToCamel }}

{{ if eq (index .Kamelet.ObjectMeta.Labels "camel.apache.org/kamelet.type") "action" -}}
The `{{ .Kamelet.ObjectMeta.Name }}` Kamelet can be used as intermediate step in a Knative binding.
{{ else -}}
The `{{ .Kamelet.ObjectMeta.Name }}` Kamelet can be used as Knative {{ index .Kamelet.ObjectMeta.Labels "camel.apache.org/kamelet.type" }} by binding it to a Knative object.
{{ end }}
{{ .ExampleBinding "messaging.knative.dev/v1" "InMemoryChannel" "mychannel" }}
Make sure you have xref:latest@camel-k::installation/installation.adoc[Camel K installed] into the Kubernetes cluster you're connected to.

Save the `{{ .Kamelet.ObjectMeta.Name }}-binding.yaml` file into your hard drive, then configure it according to your needs.

You can run the {{ index .Kamelet.ObjectMeta.Labels "camel.apache.org/kamelet.type" }} using the following command:

[source,shell]
----
kubectl apply -f {{ .Kamelet.ObjectMeta.Name }}-binding.yaml
----

==== *Binding to Knative using the Kamel CLI:*

The procedure described above can be simplified into a single execution of the `kamel bind` command:

[source,shell]
----
{{ .ExampleKamelBindCommand "channel/mychannel" }}
----

This will create the KameletBinding under the hood and apply it to the current namespace in the cluster.

=== Kafka {{ index .Kamelet.ObjectMeta.Labels "camel.apache.org/kamelet.type" | ToCamel }}

{{ if eq (index .Kamelet.ObjectMeta.Labels "camel.apache.org/kamelet.type") "action" -}}
The `{{ .Kamelet.ObjectMeta.Name }}` Kamelet can be used as intermediate step in a Kafka binding.
{{ else -}}
The `{{ .Kamelet.ObjectMeta.Name }}` Kamelet can be used as Kafka {{ index .Kamelet.ObjectMeta.Labels "camel.apache.org/kamelet.type" }} by binding it to a Kafka topic.
{{ end }}
{{ .ExampleBinding "kafka.strimzi.io/v1beta1" "KafkaTopic" "my-topic" }}
Ensure that you've installed https://strimzi.io/[Strimzi] and created a topic named `my-topic` in the current namespace.
Make also sure you have xref:latest@camel-k::installation/installation.adoc[Camel K installed] into the Kubernetes cluster you're connected to.

Save the `{{ .Kamelet.ObjectMeta.Name }}-binding.yaml` file into your hard drive, then configure it according to your needs.

You can run the {{ index .Kamelet.ObjectMeta.Labels "camel.apache.org/kamelet.type" }} using the following command:

[source,shell]
----
kubectl apply -f {{ .Kamelet.ObjectMeta.Name }}-binding.yaml
----

==== *Binding to Kafka using the Kamel CLI:*

The procedure described above can be simplified into a single execution of the `kamel bind` command:

[source,shell]
----
{{ .ExampleKamelBindCommand "kafka.strimzi.io/v1beta1:KafkaTopic:my-topic" }}
----

This will create the KameletBinding under the hood and apply it to the current namespace in the cluster.

// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT
71 changes: 70 additions & 1 deletion docs/modules/ROOT/pages/avro-deserialize-action.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ This section summarizes how the `avro-deserialize-action` can be used in various

=== Knative Action

The `avro-deserialize-action` Kamelet can be used as intermediate step in a binding.
The `avro-deserialize-action` Kamelet can be used as intermediate step in a Knative binding.

.avro-deserialize-action-binding.yaml
[source,yaml]
Expand Down Expand Up @@ -67,4 +67,73 @@ You can run the action using the following command:
----
kubectl apply -f avro-deserialize-action-binding.yaml
----

==== *Binding to Knative using the Kamel CLI:*

The procedure described above can be simplified into a single execution of the `kamel bind` command:

[source,shell]
----
kamel bind timer-source?message=Hello --step avro-deserialize-action -p "step-0.schema={\"type\": \"record\", \"namespace\": \"com.example\", \"name\": \"FullName\", \"fields\": [{\"name\": \"first\", \"type\": \"string\"},{\"name\": \"last\", \"type\": \"string\"}]}" channel/mychannel
----

This will create the KameletBinding under the hood and apply it to the current namespace in the cluster.

=== Kafka Action

The `avro-deserialize-action` Kamelet can be used as intermediate step in a Kafka binding.

.avro-deserialize-action-binding.yaml
[source,yaml]
----
apiVersion: camel.apache.org/v1alpha1
kind: KameletBinding
metadata:
name: avro-deserialize-action-binding
spec:
source:
ref:
kind: Kamelet
apiVersion: camel.apache.org/v1alpha1
name: timer-source
properties:
message: "Hello"
steps:
- ref:
kind: Kamelet
apiVersion: camel.apache.org/v1alpha1
name: avro-deserialize-action
properties:
schema: "{\"type\": \"record\", \"namespace\": \"com.example\", \"name\": \"FullName\", \"fields\": [{\"name\": \"first\", \"type\": \"string\"},{\"name\": \"last\", \"type\": \"string\"}]}"
sink:
ref:
kind: KafkaTopic
apiVersion: kafka.strimzi.io/v1beta1
name: my-topic

----

Ensure that you've installed https://strimzi.io/[Strimzi] and created a topic named `my-topic` in the current namespace.
Make also sure you have xref:latest@camel-k::installation/installation.adoc[Camel K installed] into the Kubernetes cluster you're connected to.

Save the `avro-deserialize-action-binding.yaml` file into your hard drive, then configure it according to your needs.

You can run the action using the following command:

[source,shell]
----
kubectl apply -f avro-deserialize-action-binding.yaml
----

==== *Binding to Kafka using the Kamel CLI:*

The procedure described above can be simplified into a single execution of the `kamel bind` command:

[source,shell]
----
kamel bind timer-source?message=Hello --step avro-deserialize-action -p "step-0.schema={\"type\": \"record\", \"namespace\": \"com.example\", \"name\": \"FullName\", \"fields\": [{\"name\": \"first\", \"type\": \"string\"},{\"name\": \"last\", \"type\": \"string\"}]}" kafka.strimzi.io/v1beta1:KafkaTopic:my-topic
----

This will create the KameletBinding under the hood and apply it to the current namespace in the cluster.

// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT
71 changes: 70 additions & 1 deletion docs/modules/ROOT/pages/avro-serialize-action.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ This section summarizes how the `avro-serialize-action` can be used in various c

=== Knative Action

The `avro-serialize-action` Kamelet can be used as intermediate step in a binding.
The `avro-serialize-action` Kamelet can be used as intermediate step in a Knative binding.

.avro-serialize-action-binding.yaml
[source,yaml]
Expand Down Expand Up @@ -67,4 +67,73 @@ You can run the action using the following command:
----
kubectl apply -f avro-serialize-action-binding.yaml
----

==== *Binding to Knative using the Kamel CLI:*

The procedure described above can be simplified into a single execution of the `kamel bind` command:

[source,shell]
----
kamel bind timer-source?message=Hello --step avro-serialize-action -p "step-0.schema={\"type\": \"record\", \"namespace\": \"com.example\", \"name\": \"FullName\", \"fields\": [{\"name\": \"first\", \"type\": \"string\"},{\"name\": \"last\", \"type\": \"string\"}]}" channel/mychannel
----

This will create the KameletBinding under the hood and apply it to the current namespace in the cluster.

=== Kafka Action

The `avro-serialize-action` Kamelet can be used as intermediate step in a Kafka binding.

.avro-serialize-action-binding.yaml
[source,yaml]
----
apiVersion: camel.apache.org/v1alpha1
kind: KameletBinding
metadata:
name: avro-serialize-action-binding
spec:
source:
ref:
kind: Kamelet
apiVersion: camel.apache.org/v1alpha1
name: timer-source
properties:
message: "Hello"
steps:
- ref:
kind: Kamelet
apiVersion: camel.apache.org/v1alpha1
name: avro-serialize-action
properties:
schema: "{\"type\": \"record\", \"namespace\": \"com.example\", \"name\": \"FullName\", \"fields\": [{\"name\": \"first\", \"type\": \"string\"},{\"name\": \"last\", \"type\": \"string\"}]}"
sink:
ref:
kind: KafkaTopic
apiVersion: kafka.strimzi.io/v1beta1
name: my-topic

----

Ensure that you've installed https://strimzi.io/[Strimzi] and created a topic named `my-topic` in the current namespace.
Make also sure you have xref:latest@camel-k::installation/installation.adoc[Camel K installed] into the Kubernetes cluster you're connected to.

Save the `avro-serialize-action-binding.yaml` file into your hard drive, then configure it according to your needs.

You can run the action using the following command:

[source,shell]
----
kubectl apply -f avro-serialize-action-binding.yaml
----

==== *Binding to Kafka using the Kamel CLI:*

The procedure described above can be simplified into a single execution of the `kamel bind` command:

[source,shell]
----
kamel bind timer-source?message=Hello --step avro-serialize-action -p "step-0.schema={\"type\": \"record\", \"namespace\": \"com.example\", \"name\": \"FullName\", \"fields\": [{\"name\": \"first\", \"type\": \"string\"},{\"name\": \"last\", \"type\": \"string\"}]}" kafka.strimzi.io/v1beta1:KafkaTopic:my-topic
----

This will create the KameletBinding under the hood and apply it to the current namespace in the cluster.

// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT
65 changes: 65 additions & 0 deletions docs/modules/ROOT/pages/aws-cloudwatch-sink.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,69 @@ You can run the sink using the following command:
----
kubectl apply -f aws-cloudwatch-sink-binding.yaml
----

==== *Binding to Knative using the Kamel CLI:*

The procedure described above can be simplified into a single execution of the `kamel bind` command:

[source,shell]
----
kamel bind channel/mychannel aws-cloudwatch-sink -p "sink.accessKey=The Access Key" -p "sink.cw_namespace=The Cloud Watch Namespace" -p "sink.region=eu-west-1" -p "sink.secretKey=The Secret Key"
----

This will create the KameletBinding under the hood and apply it to the current namespace in the cluster.

=== Kafka Sink

The `aws-cloudwatch-sink` Kamelet can be used as Kafka sink by binding it to a Kafka topic.

.aws-cloudwatch-sink-binding.yaml
[source,yaml]
----
apiVersion: camel.apache.org/v1alpha1
kind: KameletBinding
metadata:
name: aws-cloudwatch-sink-binding
spec:
source:
ref:
kind: KafkaTopic
apiVersion: kafka.strimzi.io/v1beta1
name: my-topic
sink:
ref:
kind: Kamelet
apiVersion: camel.apache.org/v1alpha1
name: aws-cloudwatch-sink
properties:
accessKey: "The Access Key"
cw_namespace: "The Cloud Watch Namespace"
region: "eu-west-1"
secretKey: "The Secret Key"

----

Ensure that you've installed https://strimzi.io/[Strimzi] and created a topic named `my-topic` in the current namespace.
Make also sure you have xref:latest@camel-k::installation/installation.adoc[Camel K installed] into the Kubernetes cluster you're connected to.

Save the `aws-cloudwatch-sink-binding.yaml` file into your hard drive, then configure it according to your needs.

You can run the sink using the following command:

[source,shell]
----
kubectl apply -f aws-cloudwatch-sink-binding.yaml
----

==== *Binding to Kafka using the Kamel CLI:*

The procedure described above can be simplified into a single execution of the `kamel bind` command:

[source,shell]
----
kamel bind kafka.strimzi.io/v1beta1:KafkaTopic:my-topic aws-cloudwatch-sink -p "sink.accessKey=The Access Key" -p "sink.cw_namespace=The Cloud Watch Namespace" -p "sink.region=eu-west-1" -p "sink.secretKey=The Secret Key"
----

This will create the KameletBinding under the hood and apply it to the current namespace in the cluster.

// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT
65 changes: 65 additions & 0 deletions docs/modules/ROOT/pages/aws-ddb-streams-source.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,69 @@ You can run the source using the following command:
----
kubectl apply -f aws-ddb-streams-source-binding.yaml
----

==== *Binding to Knative using the Kamel CLI:*

The procedure described above can be simplified into a single execution of the `kamel bind` command:

[source,shell]
----
kamel bind aws-ddb-streams-source -p "source.accessKey=The Access Key" -p "source.region=eu-west-1" -p "source.secretKey=The Secret Key" -p "source.table=The Table" channel/mychannel
----

This will create the KameletBinding under the hood and apply it to the current namespace in the cluster.

=== Kafka Source

The `aws-ddb-streams-source` Kamelet can be used as Kafka source by binding it to a Kafka topic.

.aws-ddb-streams-source-binding.yaml
[source,yaml]
----
apiVersion: camel.apache.org/v1alpha1
kind: KameletBinding
metadata:
name: aws-ddb-streams-source-binding
spec:
source:
ref:
kind: Kamelet
apiVersion: camel.apache.org/v1alpha1
name: aws-ddb-streams-source
properties:
accessKey: "The Access Key"
region: "eu-west-1"
secretKey: "The Secret Key"
table: "The Table"
sink:
ref:
kind: KafkaTopic
apiVersion: kafka.strimzi.io/v1beta1
name: my-topic

----

Ensure that you've installed https://strimzi.io/[Strimzi] and created a topic named `my-topic` in the current namespace.
Make also sure you have xref:latest@camel-k::installation/installation.adoc[Camel K installed] into the Kubernetes cluster you're connected to.

Save the `aws-ddb-streams-source-binding.yaml` file into your hard drive, then configure it according to your needs.

You can run the source using the following command:

[source,shell]
----
kubectl apply -f aws-ddb-streams-source-binding.yaml
----

==== *Binding to Kafka using the Kamel CLI:*

The procedure described above can be simplified into a single execution of the `kamel bind` command:

[source,shell]
----
kamel bind aws-ddb-streams-source -p "source.accessKey=The Access Key" -p "source.region=eu-west-1" -p "source.secretKey=The Secret Key" -p "source.table=The Table" kafka.strimzi.io/v1beta1:KafkaTopic:my-topic
----

This will create the KameletBinding under the hood and apply it to the current namespace in the cluster.

// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT
Loading