Add events section

This commit is contained in:
Philipp Muens 2019-11-07 14:40:37 +01:00
parent 72d239f356
commit dff1ccc813
5 changed files with 151 additions and 0 deletions

View File

@ -0,0 +1,30 @@
<!--
title: Serverless Framework - Knative Events - AWS SQS
menuText: AWS SQS
menuOrder: 4
description: Setting up an AWS SQS event source with Knative via the Serverless Framework
layout: Doc
-->
<!-- DOCS-SITE-LINK:START automatically generated -->
### [Read this on the main serverless docs site](https://www.serverless.com/framework/docs/providers/knative/events/aws-sqs/)
<!-- DOCS-SITE-LINK:END -->
# 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
```

View File

@ -0,0 +1,29 @@
<!--
title: Serverless Framework - Knative Events - CronJob
menuText: CronJob
menuOrder: 5
description: Setting up a CronJob event source with Knative via the Serverless Framework
layout: Doc
-->
<!-- DOCS-SITE-LINK:START automatically generated -->
### [Read this on the main serverless docs site](https://www.serverless.com/framework/docs/providers/knative/events/cron/)
<!-- DOCS-SITE-LINK:END -->
# 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!"}'
```

View File

@ -0,0 +1,30 @@
<!--
title: Serverless Framework - Knative Events - Custom
menuText: Custom
menuOrder: 1
description: Setting up a Custom event source with Knative via the Serverless Framework
layout: Doc
-->
<!-- DOCS-SITE-LINK:START automatically generated -->
### [Read this on the main serverless docs site](https://www.serverless.com/framework/docs/providers/knative/events/custom/)
<!-- DOCS-SITE-LINK:END -->
# 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
```

View File

@ -0,0 +1,29 @@
<!--
title: Serverless Framework - Knative Events - Google Cloud PubSub
menuText: Google Cloud PubSub
menuOrder: 3
description: Setting up a Google Cloud PubSub event source with Knative via the Serverless Framework
layout: Doc
-->
<!-- DOCS-SITE-LINK:START automatically generated -->
### [Read this on the main serverless docs site](https://www.serverless.com/framework/docs/providers/knative/events/gcp-pub-sub/)
<!-- DOCS-SITE-LINK:END -->
# 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
```

View File

@ -0,0 +1,33 @@
<!--
title: Serverless Framework - Knative Events - Kafka
menuText: Kafka
menuOrder: 2
description: Setting up a Kafka event source with Knative via the Serverless Framework
layout: Doc
-->
<!-- DOCS-SITE-LINK:START automatically generated -->
### [Read this on the main serverless docs site](https://www.serverless.com/framework/docs/providers/knative/events/kafka/)
<!-- DOCS-SITE-LINK:END -->
# 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
```