Skip to content

Commit

Permalink
With 0.15 the MTChannelBasedBroker is the new default broker (#2533)
Browse files Browse the repository at this point in the history
Signed-off-by: Matthias Wessendorf <[email protected]>
  • Loading branch information
matzew authored Jun 2, 2020
1 parent 416416b commit 8b6dc70
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 254 deletions.
4 changes: 2 additions & 2 deletions docs/eventing/broker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ There can be different classes of Brokers providing different kinds
of semantics around durability of events, performance, etc. The Broker that is
part of the Knative Eventing repo is used for these examples, it uses Knative
[Channels](../channels/) for delivering events. You can read more details about
[Channel Based Broker](./channel-based-broker.md). Simple example showing a `Broker`
[MT Channel Based Broker](./mt-channel-based-broker.md). Simple example showing a `Broker`
where the configuration is specified in a `ConfigMap` config-br-default-channel,
which uses `InMemoryChannel`:

Expand Down Expand Up @@ -112,7 +112,7 @@ have the extension `myextension` with the value `my-extension-value`.
### Broker setup

We assume that you have installed a Broker in namespace `default`. If you haven't done that
yet, [install it from here](./channel-based-broker.md).
yet, [install it from here](./mt-channel-based-broker.md).

### Subscriber

Expand Down
252 changes: 0 additions & 252 deletions docs/eventing/broker/channel-based-broker.md

This file was deleted.

60 changes: 60 additions & 0 deletions docs/eventing/broker/mt-channel-based-broker.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,4 +145,64 @@ spec:
EOF
```

## Creating Broker by Annotation

The easiest way to get Broker installed, is to annotate your namespace
(replace `default` with the desired namespace):

```shell
kubectl label namespace default knative-eventing-injection=enabled
```

This will automatically create a `Broker` named `default` in the `default`
namespace. As per above configuration, it would be configured to use Kafka
channels.

```shell
kubectl -n default get broker default
```

_NOTE_ `Broker`s created due to annotation will not be removed if you remove the
annotation. For example, if you annotate the namespace, which will then create
the `Broker` as described above. If you now remove the annotation, the `Broker`
will not be removed, you have to manually delete it.

For example, to delete the injected Broker from the foo namespace:

```shell
kubectl -n foo delete broker default
```

## Creating Broker by Trigger Annotation

Besides the annotation of the namespace, there is an alternative approach to annotate
one of the Triggers, with `knative-eventing-injection: enabled`:

```yaml
apiVersion: eventing.knative.dev/v1beta1
kind: Trigger
metadata:
annotations:
knative-eventing-injection: enabled
name: testevents-trigger0
namespace: default
spec:
broker: default
filter:
attributes:
type: dev.knative.sources.ping
subscriber:
ref:
apiVersion: serving.knative.dev/v1
kind: Service
name: broker-display
```
However, this approach only works _if_ the `Trigger` is coupled to the default `Broker`, and takes only effect
when there is no default `Broker` already present.

Deleting the `Trigger` does not delete the `Broker`. With this approach the same rules from the
[namespace annotation](./#installing-broker-by-annotation) apply here.


You can find out more about delivery spec details [here](https://knative.dev/docs/eventing/event-delivery/).

0 comments on commit 8b6dc70

Please sign in to comment.