Skip to content
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
d6d469b
Adding bitbucket source documentation.
nachocano Mar 7, 2019
5a0f9e5
Adding README example for bitbucket source.
nachocano Mar 7, 2019
6e3b410
Updating example.
nachocano Mar 7, 2019
170a4a4
Merge remote-tracking branch 'upstream/master'
nachocano Mar 7, 2019
2e79e48
Missed to generate the README
nachocano Mar 7, 2019
811bc18
Merge remote-tracking branch 'upstream/master'
nachocano Mar 20, 2019
eb41d97
removing stuff, and updating link to bitbucket source in sources.yaml
nachocano Apr 8, 2019
2e2d576
Merge remote-tracking branch 'upstream/master'
nachocano Apr 8, 2019
f072535
autogenerating README
nachocano Apr 8, 2019
cdd196f
removing bitbucket one here.
nachocano Apr 8, 2019
bdf2e56
update
nachocano May 7, 2019
fd50ed5
Merge remote-tracking branch 'upstream/master'
nachocano May 7, 2019
635afe1
Merge remote-tracking branch 'upstream/master'
nachocano May 8, 2019
31af4d0
Merge remote-tracking branch 'upstream/master'
nachocano May 14, 2019
d59ded4
Merge remote-tracking branch 'upstream/master'
nachocano May 17, 2019
af43942
Merge remote-tracking branch 'upstream/master'
nachocano May 21, 2019
fe45110
Merge remote-tracking branch 'upstream/master'
nachocano Jul 8, 2019
658d42c
Merge remote-tracking branch 'upstream/master'
nachocano Jul 25, 2019
1e38c66
Merge remote-tracking branch 'upstream/master'
nachocano Aug 6, 2019
0cd9a5c
updating broker/trigger based on filtering and new channel CRDs
nachocano Aug 7, 2019
0180cf5
changes after code review
nachocano Aug 7, 2019
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
54 changes: 24 additions & 30 deletions docs/eventing/broker-trigger.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ spec:
## Trigger

A Trigger represents a desire to subscribe to events from a specific Broker.
Basic filtering on the type and source of events is provided.
Exact match filtering on CloudEvents attributes as well as extensions are supported.

Example:

Expand All @@ -44,7 +44,7 @@ metadata:
name: my-service-trigger
spec:
filter:
sourceAndType:
attributes:
type: dev.knative.foo.bar
subscriber:
ref:
Expand All @@ -55,39 +55,38 @@ spec:

## Usage

### ClusterChannelProvisioner
### Channel

`Broker`s use their `spec.channelTemplate` to create their internal `Channel`s,
`Broker`s use their `spec.channelTemplateSpec` to create their internal [Channels](./channels/),
which dictate the durability guarantees of events sent to that `Broker`. If
`spec.channelTemplate` is not specified, then the
[default provisioner](https://www.knative.dev/docs/eventing/channels/default-channels/)
`spec.channelTemplateSpec` is not specified, then the
[default channel](./channels/default-channels.md)
for their namespace is used.

#### Setup

Have a `ClusterChannelProvisioner` installed and set as the
[default provisioner](https://www.knative.dev/docs/eventing/channels/default-channels/)
for the namespace you are interested in. For development, the
[`in-memory` `ClusterChannelProvisioner`](https://github.com/knative/eventing/tree/master/config/provisioners/in-memory-channel#deployment-steps)
Have a `Channel` CRD installed and set as the
default channel for the namespace you are interested in. For development, the
[InMemoryChannel](https://github.com/knative/eventing/tree/master/config/channels/in-memory-channel)
is normally used.

#### Changing

**Note** changing the `ClusterChannelProvisioner` of a running `Broker` will
**Note** changing the `Channel` of a running `Broker` will
lose all in-flight events.

If you want to change which `ClusterChannelProvisioner` is used by a given
`Broker`, then determine if the `spec.channelTemplate` is specified or not.
If you want to change which `Channel` is used by a given
`Broker`, then determine if the `spec.channelTemplateSpec` is specified or not.

If `spec.channelTemplate` is specified:
If `spec.channelTemplateSpec` is specified:

1. Delete the `Broker`.
1. Create the `Broker` with the updated `spec.channelTemplate`.
1. Create the `Broker` with the updated `spec.channelTemplateSpec`.

If `spec.channelTemplate` is not specified:
If `spec.channelTemplateSpec` is not specified:

1. Change the
[default provisioner](https://github.com/knative/docs/blob/master/docs/eventing/channels/default-channels.md#setting-the-default-channel-configuration)
[default channel](./channels/default-channels.md#setting-the-default-channel-configuration)
for the namespace that `Broker` is in.
1. Delete and recreate the `Broker`.

Expand Down Expand Up @@ -226,7 +225,7 @@ metadata:
namespace: default
spec:
filter:
sourceAndType:
attributes:
type: dev.knative.foo.bar
subscriber:
ref:
Expand All @@ -237,11 +236,7 @@ spec:

#### Defaulting

The Webhook will default certain unspecified fields. For example if
`spec.broker` is unspecified, it will default to `default`. If
`spec.filter.sourceAndType.type` or `spec.filter.sourceAndType.Source` are
unspecified, then they will default to the special value empty string, which
matches everything.
The Webhook will default the `spec.broker` field to `default`, if left unspecified.

The Webhook will default the YAML above to:

Expand All @@ -254,9 +249,8 @@ metadata:
spec:
broker: default # Defaulted by the Webhook.
filter:
sourceAndType:
attributes:
type: dev.knative.foo.bar
source: "" # Defaulted by the Webhook.
subscriber:
ref:
apiVersion: serving.knative.dev/v1alpha1
Expand All @@ -265,7 +259,7 @@ spec:
```

You can make multiple `Trigger`s on the same `Broker` corresponding to different
types, sources, and subscribers.
types, sources (or any other CloudEvents attribute), and subscribers.

### Source

Expand All @@ -285,10 +279,10 @@ While SSHed into a `Pod` and run:
curl -v "http://default-broker.default.svc.cluster.local/" \
-X POST \
-H "X-B3-Flags: 1" \
-H "CE-CloudEventsVersion: 0.1" \
-H "CE-EventType: dev.knative.foo.bar" \
-H "CE-EventTime: 2018-04-05T03:56:24Z" \
-H "CE-EventID: 45a8b444-3213-4758-be3f-540bf93f85ff" \
-H "CE-SpecVersion: 0.2" \
-H "CE-Type: dev.knative.foo.bar" \
-H "CE-Time: 2018-04-05T03:56:24Z" \
-H "CE-ID: 45a8b444-3213-4758-be3f-540bf93f85ff" \
-H "CE-Source: dev.knative.example" \
-H 'Content-Type: application/json' \
-d '{ "much": "wow" }'
Expand Down