From dff1ccc813202e804aec135ccd099d5909cd9cbe Mon Sep 17 00:00:00 2001 From: Philipp Muens Date: Thu, 7 Nov 2019 14:40:37 +0100 Subject: [PATCH] Add events section --- docs/providers/knative/events/aws-sqs.md | 30 ++++++++++++++++++ docs/providers/knative/events/cron.md | 29 +++++++++++++++++ docs/providers/knative/events/custom.md | 30 ++++++++++++++++++ docs/providers/knative/events/gcp-pub-sub.md | 29 +++++++++++++++++ docs/providers/knative/events/kafka.md | 33 ++++++++++++++++++++ 5 files changed, 151 insertions(+) create mode 100644 docs/providers/knative/events/aws-sqs.md create mode 100644 docs/providers/knative/events/cron.md create mode 100644 docs/providers/knative/events/custom.md create mode 100644 docs/providers/knative/events/gcp-pub-sub.md create mode 100644 docs/providers/knative/events/kafka.md diff --git a/docs/providers/knative/events/aws-sqs.md b/docs/providers/knative/events/aws-sqs.md new file mode 100644 index 000000000..fecd02e23 --- /dev/null +++ b/docs/providers/knative/events/aws-sqs.md @@ -0,0 +1,30 @@ + + + + +### [Read this on the main serverless docs site](https://www.serverless.com/framework/docs/providers/knative/events/aws-sqs/) + + + +# AWS SQS + +Functions can used as sinks for [Knative Eventing](https://knative.dev/docs/eventing) event sources such as AWS SQS. + +Here's how to setup a function as an event sink for the AWS SQS event source: + +```yaml +functions: + myFunction: + handler: gcr.io/knative-releases/github.com/knative/eventing-contrib/cmd/event_display:latest + events: + - awsSqs: + secretName: aws-credentials + secretKey: credentials + queue: QUEUE_URL +``` diff --git a/docs/providers/knative/events/cron.md b/docs/providers/knative/events/cron.md new file mode 100644 index 000000000..7f9281df8 --- /dev/null +++ b/docs/providers/knative/events/cron.md @@ -0,0 +1,29 @@ + + + + +### [Read this on the main serverless docs site](https://www.serverless.com/framework/docs/providers/knative/events/cron/) + + + +# CronJob + +Functions can used as sinks for [Knative Eventing](https://knative.dev/docs/eventing) event sources such as CronJob. + +Here's how to setup a function as an event sink for the CronJob event source: + +```yaml +functions: + myFunction: + handler: gcr.io/knative-releases/github.com/knative/eventing-contrib/cmd/event_display:latest + events: + - cron: + schedule: '* * * * *' + data: '{"message": "Hello world from a Cron event source!"}' +``` diff --git a/docs/providers/knative/events/custom.md b/docs/providers/knative/events/custom.md new file mode 100644 index 000000000..13cbcaf76 --- /dev/null +++ b/docs/providers/knative/events/custom.md @@ -0,0 +1,30 @@ + + + + +### [Read this on the main serverless docs site](https://www.serverless.com/framework/docs/providers/knative/events/custom/) + + + +# Kafka + +Functions can use as sinks for [Knative Eventing](https://knative.dev/docs/eventing) event sources such as custom Triggers. Such Triggers will listen to events originating from your `default` Broker of your Knative installation. + +Here's how to setup a function as an event sink for a custom Trigger event source: + +```yaml +functions: + myFunction: + handler: gcr.io/knative-releases/github.com/knative/eventing-contrib/cmd/event_display:latest + events: + - custom: + filter: # this attribute is used to filter events based on CloudEvents attributes + attributes: + type: greeting +``` diff --git a/docs/providers/knative/events/gcp-pub-sub.md b/docs/providers/knative/events/gcp-pub-sub.md new file mode 100644 index 000000000..ddbc1c3fe --- /dev/null +++ b/docs/providers/knative/events/gcp-pub-sub.md @@ -0,0 +1,29 @@ + + + + +### [Read this on the main serverless docs site](https://www.serverless.com/framework/docs/providers/knative/events/gcp-pub-sub/) + + + +# Google Cloud PubSub + +Functions can be used as sinks for [Knative Eventing](https://knative.dev/docs/eventing) event sources such as Google Cloud PubSub. + +Here's how to setup a function as an event sink for the Google Cloud PubSub event source: + +```yaml +functions: + myFunction: + handler: gcr.io/knative-releases/github.com/knative/eventing-contrib/cmd/event_display:latest + events: + - gcpPubSub: + project: my-project + topic: my-topic +``` diff --git a/docs/providers/knative/events/kafka.md b/docs/providers/knative/events/kafka.md new file mode 100644 index 000000000..a4f99149e --- /dev/null +++ b/docs/providers/knative/events/kafka.md @@ -0,0 +1,33 @@ + + + + +### [Read this on the main serverless docs site](https://www.serverless.com/framework/docs/providers/knative/events/kafka/) + + + +# Kafka + +Functions can used as sinks for [Knative Eventing](https://knative.dev/docs/eventing) event sources such as Kafka. + +Here's how to setup a function as an event sink for the Kafka event source: + +```yaml +functions: + myFunction: + handler: gcr.io/knative-releases/github.com/knative/eventing-contrib/cmd/event_display:latest + events: + - kafka: + consumerGroup: ${env:KAFKA_CONSUMER_GROUP_NAME} + bootstrapServers: + - server1 + - server2 + topics: + - my-topic +```