From ce88f0f836f3f1efd4181097a7cb449fc71f4a6b Mon Sep 17 00:00:00 2001 From: Matthias Wessendorf Date: Tue, 26 Nov 2024 10:30:11 +0100 Subject: [PATCH] adding first draft of IntegrationSource doc (#6156) Signed-off-by: Matthias Wessendorf --- config/nav.yml | 6 +++ .../sources/integration-source/README.md | 13 ++++++ .../integration-source/aws_ddbstreams.md | 41 +++++++++++++++++++ .../sources/integration-source/aws_s3.md | 41 +++++++++++++++++++ .../sources/integration-source/aws_sqs.md | 40 ++++++++++++++++++ .../sources/integration-source/timer.md | 28 +++++++++++++ 6 files changed, 169 insertions(+) create mode 100644 docs/eventing/sources/integration-source/README.md create mode 100644 docs/eventing/sources/integration-source/aws_ddbstreams.md create mode 100644 docs/eventing/sources/integration-source/aws_s3.md create mode 100644 docs/eventing/sources/integration-source/aws_sqs.md create mode 100644 docs/eventing/sources/integration-source/timer.md diff --git a/config/nav.yml b/config/nav.yml index 06018bc68b..4cecc65b82 100644 --- a/config/nav.yml +++ b/config/nav.yml @@ -230,6 +230,12 @@ nav: - PingSource: - Creating a PingSource object: eventing/sources/ping-source/README.md - PingSource reference: eventing/sources/ping-source/reference.md + - IntegrationSource: + - About IntegrationSource: eventing/sources/integration-source/README.md + - AWS DDB Streams: eventing/sources/integration-source/aws_ddbstreams.md + - AWS S3: eventing/sources/integration-source/aws_s3.md + - AWS SQS: eventing/sources/integration-source/aws_sqs.md + - Generic Timer: eventing/sources/integration-source/timer.md - RabbitMQSource: eventing/sources/rabbitmq-source/README.md - RedisStreamSource: - About RedisStreamSource: eventing/sources/redis/README.md diff --git a/docs/eventing/sources/integration-source/README.md b/docs/eventing/sources/integration-source/README.md new file mode 100644 index 0000000000..c3fa66087e --- /dev/null +++ b/docs/eventing/sources/integration-source/README.md @@ -0,0 +1,13 @@ +# Knative Source for Apache Camel Kamelet integrations + +![stage](https://img.shields.io/badge/Stage-alpah-red?style=flat-square) +![version](https://img.shields.io/badge/API_Version-v1alpha1-red?style=flat-square) + +The `IntegrationSource` is a Knative Eventing custom resource supporting selected [_Kamelets_](https://camel.apache.org/camel-k/latest/kamelets/kamelets.html) from the [Apache Camel](https://camel.apache.org/) project. Kamelets allow users to connect to 3rd party system for improved connectivity, they can act as "sources" or as "sinks". Therefore the `IntegrationSource` allows to consume data from external systems and forward them into Knative Eventing. The integration source is part of the Knative Eventing core installation. + +## Supported Kamelet sources + +* [AWS DDB Streams](./aws_ddbstreams.md) +* [AWS S3](./aws_s3.md) +* [AWS SQS](./aws_sqs.md) +* [Generic timer](./timer.md) diff --git a/docs/eventing/sources/integration-source/aws_ddbstreams.md b/docs/eventing/sources/integration-source/aws_ddbstreams.md new file mode 100644 index 0000000000..f60611d035 --- /dev/null +++ b/docs/eventing/sources/integration-source/aws_ddbstreams.md @@ -0,0 +1,41 @@ +# AWS DynamoDB Streams + +The `IntegrationSource` supports the Amazon Web Services (AWS) DynamoDB Streams service, through its `aws.ddbStreams` property. + +## Amazon credentials + +For connecting to AWS the `IntegrationSource` uses Kubernetes `Secret`, present in the namespace of the resource. The `Secret` can be created like: + + ```bash + kubectl -n create secret generic my-secret --from-literal=aws.accessKey= --from-literal=aws.secretKey= + ``` + +## AWS DynamoDB Streams Example + +Below is an `IntegrationSource` to receive events from Amazon DynamoDB Streams. + + ```yaml + apiVersion: sources.knative.dev/v1alpha1 + kind: IntegrationSource + metadata: + name: integration-source-aws-ddb + namespace: knative-samples + spec: + aws: + ddbStreams: + table: "my-table" + region: "eu-north-1" + auth: + secret: + ref: + name: "my-secret" + sink: + ref: + apiVersion: eventing.knative.dev/v1 + kind: Broker + name: default + ``` + +Inside of the `aws.ddbStreams` object we define the name of the table and its region. The credentials for the AWS service are referenced from the `my-secret` Kubernetes `Secret` + +More details about the Apache Camel Kamelet [aws-ddb-streams-source](https://camel.apache.org/camel-kamelets/latest/aws-ddb-streams-source.html). diff --git a/docs/eventing/sources/integration-source/aws_s3.md b/docs/eventing/sources/integration-source/aws_s3.md new file mode 100644 index 0000000000..c4b8fb7db4 --- /dev/null +++ b/docs/eventing/sources/integration-source/aws_s3.md @@ -0,0 +1,41 @@ +# AWS S3 Source + +The `IntegrationSource` supports the Amazon Web Services (AWS) S3 service, through its `aws.s3` property. + +## Amazon credentials + +For connecting to AWS the `IntegrationSource` uses Kubernetes `Secret`, present in the namespace of the resource. The `Secret` can be created like: + + ```bash + kubectl -n create secret generic my-secret --from-literal=aws.accessKey= --from-literal=aws.secretKey= + ``` + +## AWS S3 Source Example + +Below is an `IntegrationSource` to receive data from an Amazon S3 Bucket. + + ```yaml + apiVersion: sources.knative.dev/v1alpha1 + kind: IntegrationSource + metadata: + name: integration-source-aws-s3 + namespace: knative-samples + spec: + aws: + s3: + arn: "arn:aws:s3:::my-bucket" + region: "eu-north-1" + auth: + secret: + ref: + name: "my-secret" + sink: + ref: + apiVersion: eventing.knative.dev/v1 + kind: Broker + name: default + ``` + +Inside of the `aws.s3` object we define the name of the bucket (or _arn_) and its region. The credentials for the AWS service are referenced from the `my-secret` Kubernetes `Secret` + +More details about the Apache Camel Kamelet [aws-s3-source](https://camel.apache.org/camel-kamelets/latest/aws-s3-source.html). diff --git a/docs/eventing/sources/integration-source/aws_sqs.md b/docs/eventing/sources/integration-source/aws_sqs.md new file mode 100644 index 0000000000..a0a9eadbe9 --- /dev/null +++ b/docs/eventing/sources/integration-source/aws_sqs.md @@ -0,0 +1,40 @@ +# AWS Simple Queue Service Source + +The `IntegrationSource` supports the Amazon Web Services (AWS) Simple Queue Service (SQS) service, through its `aws.sqs` property. + +## Amazon credentials + +For connecting to AWS the `IntegrationSource` uses Kubernetes `Secret`, present in the namespace of the resource. The `Secret` can be created like: + + ```bash + kubectl -n create secret generic my-secret --from-literal=aws.accessKey= --from-literal=aws.secretKey= + ``` + +## AWS SQS Source Example + +Below is an `IntegrationSource` to receive data from AWS SQS. + + ```yaml + apiVersion: sources.knative.dev/v1alpha1 + kind: IntegrationSource + metadata: + name: integration-source-aws-sqs + namespace: knative-samples + spec: + aws: + sqs: + arn: "arn:aws:s3:::my-queue" + region: "eu-north-1" + auth: + secret: + ref: + name: "my-secret" + sink: + ref: + apiVersion: eventing.knative.dev/v1 + kind: Broker + name: default + ``` +Inside of the `aws.sqs` object we define the name of the queue (or _arn_) and its region. The credentials for the AWS service are referenced from the `my-secret` Kubernetes `Secret` + +More details about the Apache Camel Kamelet [aws-sqs-source](https://camel.apache.org/camel-kamelets/latest/aws-sqs-source.html). diff --git a/docs/eventing/sources/integration-source/timer.md b/docs/eventing/sources/integration-source/timer.md new file mode 100644 index 0000000000..fd8132a837 --- /dev/null +++ b/docs/eventing/sources/integration-source/timer.md @@ -0,0 +1,28 @@ +# Timer Source + +The `IntegrationSource` supports the _Timer Kamelet_ for producing periodic messages with a custom payload, through its `timer` property. + +## Timer Source Example + +Produces periodic messages with a custom payload. + + ```yaml + apiVersion: sources.knative.dev/v1alpha1 + kind: IntegrationSource + metadata: + name: integration-source-timer + namespace: knative-samples + spec: + timer: + period: 2000 + message: "Hello, Eventing Core" + sink: + ref: + apiVersion: eventing.knative.dev/v1 + kind: Broker + name: default + ``` + +Inside of the `timer` object we define the `period` and the message that is send to the referenced `sink`. + +More details about the Apache Camel Kamelet [timer-source](https://camel.apache.org/camel-kamelets/latest/timer-source.html).