From 3da423f5241108d2e4ab44e2dde7f8b0fe1128e2 Mon Sep 17 00:00:00 2001 From: Matthias Wessendorf Date: Tue, 26 Nov 2024 11:30:26 +0100 Subject: [PATCH] Adding initial doc for IntegrationSink Signed-off-by: Matthias Wessendorf --- config/nav.yml | 5 +++ docs/eventing/sinks/README.md | 1 + .../eventing/sinks/integration-sink/README.md | 12 +++++++ .../eventing/sinks/integration-sink/aws_s3.md | 36 +++++++++++++++++++ .../sinks/integration-sink/aws_sqs.md | 35 ++++++++++++++++++ .../eventing/sinks/integration-sink/logger.md | 23 ++++++++++++ 6 files changed, 112 insertions(+) create mode 100644 docs/eventing/sinks/integration-sink/README.md create mode 100644 docs/eventing/sinks/integration-sink/aws_s3.md create mode 100644 docs/eventing/sinks/integration-sink/aws_sqs.md create mode 100644 docs/eventing/sinks/integration-sink/logger.md diff --git a/config/nav.yml b/config/nav.yml index 4cecc65b82..0d1c70b64b 100644 --- a/config/nav.yml +++ b/config/nav.yml @@ -250,6 +250,11 @@ nav: - About sinks: eventing/sinks/README.md - JobSink: eventing/sinks/job-sink.md - Apache Kafka Sink: eventing/sinks/kafka-sink.md + - IntegrationSink: + - About IntegrationSink: eventing/sinks/integration-sink/README.md + - AWS S3 Sink: eventing/sinks/integration-sink/aws_s3.md + - AWS SQS Sink: eventing/sinks/integration-sink/aws_sqs.md + - Generic Logger Sink: eventing/sinks/integration-sink/logger.md - Flows: - About flows: eventing/flows/README.md - Parallel: eventing/flows/parallel.md diff --git a/docs/eventing/sinks/README.md b/docs/eventing/sinks/README.md index 9d84c343aa..f6f71c21fd 100644 --- a/docs/eventing/sinks/README.md +++ b/docs/eventing/sinks/README.md @@ -132,6 +132,7 @@ The `svc` in `http://event-display.svc.cluster.local` determines that the sink i | Name | Maintainer | Description | |----------------------------------------------------------------------------------| -- |--------------------------------------| +| [IntegrationSink](./integration-sink/README.md) | Knative | Send events to generic event sink | | [JobSink](job-sink.md) | Knative | Trigger long-running background jobs | | [KafkaSink](kafka-sink.md) | Knative | Send events to a Kafka topic | | [RedisSink](https://github.com/knative-extensions/eventing-redis/tree/main/sink) | Knative | Send events to a Redis Stream | diff --git a/docs/eventing/sinks/integration-sink/README.md b/docs/eventing/sinks/integration-sink/README.md new file mode 100644 index 0000000000..610a05312f --- /dev/null +++ b/docs/eventing/sinks/integration-sink/README.md @@ -0,0 +1,12 @@ +# Knative Sink 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 `IntegrationSink` 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 `IntegrationSink` allows to send data to external systems out of Knative Eventing in the format of CloudEvents. The integration sink is part of the Knative Eventing core installation. + +## Supported Kamelet sinks + +* [AWS S3](./aws_s3.md) +* [AWS SQS](./aws_sqs.md) +* [Generic logger](./logger.md) diff --git a/docs/eventing/sinks/integration-sink/aws_s3.md b/docs/eventing/sinks/integration-sink/aws_s3.md new file mode 100644 index 0000000000..c7264d09f4 --- /dev/null +++ b/docs/eventing/sinks/integration-sink/aws_s3.md @@ -0,0 +1,36 @@ +# AWS S3 Sink + +The `IntegrationSink` supports the Amazon Web Services (AWS) S3 service, through its `aws.s3` property. + +## Amazon credentials + +For connecting to AWS the `IntegrationSink` uses Kubernetes `Secret`, present in the namespace of the reSink. The `Secret` can be created like: + + ```bash + kubectl -n create secret generic my-secret --from-literal=aws.accessKey= --from-literal=aws.secretKey= + ``` + +## AWS S3 Sink Example + +Below is an `IntegrationSink` to send data to an Amazon S3 Bucket: + + ```yaml + apiVersion: Sinks.knative.dev/v1alpha1 + kind: IntegrationSink + metadata: + name: integration-sink-aws-s3 + namespace: knative-samples + spec: + aws: + s3: + arn: "arn:aws:s3:::my-bucket" + region: "eu-north-1" + auth: + secret: + ref: + name: "my-secret" + ``` + +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-sink](https://camel.apache.org/camel-kamelets/latest/aws-s3-sink.html). diff --git a/docs/eventing/sinks/integration-sink/aws_sqs.md b/docs/eventing/sinks/integration-sink/aws_sqs.md new file mode 100644 index 0000000000..06889de379 --- /dev/null +++ b/docs/eventing/sinks/integration-sink/aws_sqs.md @@ -0,0 +1,35 @@ +# AWS Simple Queue Service Sink + +The `IntegrationSink` supports the Amazon Web Services (AWS) Simple Queue Service (SQS) service, through its `aws.sqs` property. + +## Amazon credentials + +For connecting to AWS the `IntegrationSink` uses Kubernetes `Secret`, present in the namespace of the reSink. The `Secret` can be created like: + + ```bash + kubectl -n create secret generic my-secret --from-literal=aws.accessKey= --from-literal=aws.secretKey= + ``` + +## AWS SQS Sink Example + +Below is an `IntegrationSink` to send data to AWS SQS: + + ```yaml + apiVersion: Sinks.knative.dev/v1alpha1 + kind: IntegrationSink + metadata: + name: integration-sink-aws-sqs + namespace: knative-samples + spec: + aws: + sqs: + arn: "arn:aws:s3:::my-queue" + region: "eu-north-1" + auth: + secret: + ref: + name: "my-secret" + ``` +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-sink](https://camel.apache.org/camel-kamelets/latest/aws-sqs-sink.html). diff --git a/docs/eventing/sinks/integration-sink/logger.md b/docs/eventing/sinks/integration-sink/logger.md new file mode 100644 index 0000000000..45e51b1414 --- /dev/null +++ b/docs/eventing/sinks/integration-sink/logger.md @@ -0,0 +1,23 @@ +# Log Sink + +The `IntegrationSink` supports the _Log Sink Kamelet_ that logs all data that it receives, through its `log` property. This sink useful for debugging purposes. + +## Log Sink Example + +Below is an `IntegrationSink` that logs all data that it receives: + + ```yaml + apiVersion: Sinks.knative.dev/v1alpha1 + kind: IntegrationSink + metadata: + name: integration-log-sink + namespace: knative-samples + spec: + log: + showHeaders: true + level: INFO + ``` + +Inside of the `log` object we define the logging `level` and define to also show (HTTP) headers it received. + +More details about the Apache Camel Kamelet [timer-sink](https://camel.apache.org/camel-kamelets/latest/timer-sink.html).