Skip to content

Commit 8b6dc70

Browse files
authored
With 0.15 the MTChannelBasedBroker is the new default broker (#2533)
Signed-off-by: Matthias Wessendorf <[email protected]>
1 parent 416416b commit 8b6dc70

File tree

3 files changed

+62
-254
lines changed

3 files changed

+62
-254
lines changed

docs/eventing/broker/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ There can be different classes of Brokers providing different kinds
1313
of semantics around durability of events, performance, etc. The Broker that is
1414
part of the Knative Eventing repo is used for these examples, it uses Knative
1515
[Channels](../channels/) for delivering events. You can read more details about
16-
[Channel Based Broker](./channel-based-broker.md). Simple example showing a `Broker`
16+
[MT Channel Based Broker](./mt-channel-based-broker.md). Simple example showing a `Broker`
1717
where the configuration is specified in a `ConfigMap` config-br-default-channel,
1818
which uses `InMemoryChannel`:
1919

@@ -112,7 +112,7 @@ have the extension `myextension` with the value `my-extension-value`.
112112
### Broker setup
113113

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

117117
### Subscriber
118118

docs/eventing/broker/channel-based-broker.md

-252
This file was deleted.

docs/eventing/broker/mt-channel-based-broker.md

+60
Original file line numberDiff line numberDiff line change
@@ -145,4 +145,64 @@ spec:
145145
EOF
146146
```
147147

148+
## Creating Broker by Annotation
149+
150+
The easiest way to get Broker installed, is to annotate your namespace
151+
(replace `default` with the desired namespace):
152+
153+
```shell
154+
kubectl label namespace default knative-eventing-injection=enabled
155+
```
156+
157+
This will automatically create a `Broker` named `default` in the `default`
158+
namespace. As per above configuration, it would be configured to use Kafka
159+
channels.
160+
161+
```shell
162+
kubectl -n default get broker default
163+
```
164+
165+
_NOTE_ `Broker`s created due to annotation will not be removed if you remove the
166+
annotation. For example, if you annotate the namespace, which will then create
167+
the `Broker` as described above. If you now remove the annotation, the `Broker`
168+
will not be removed, you have to manually delete it.
169+
170+
For example, to delete the injected Broker from the foo namespace:
171+
172+
```shell
173+
kubectl -n foo delete broker default
174+
```
175+
176+
## Creating Broker by Trigger Annotation
177+
178+
Besides the annotation of the namespace, there is an alternative approach to annotate
179+
one of the Triggers, with `knative-eventing-injection: enabled`:
180+
181+
```yaml
182+
apiVersion: eventing.knative.dev/v1beta1
183+
kind: Trigger
184+
metadata:
185+
annotations:
186+
knative-eventing-injection: enabled
187+
name: testevents-trigger0
188+
namespace: default
189+
spec:
190+
broker: default
191+
filter:
192+
attributes:
193+
type: dev.knative.sources.ping
194+
subscriber:
195+
ref:
196+
apiVersion: serving.knative.dev/v1
197+
kind: Service
198+
name: broker-display
199+
```
200+
201+
However, this approach only works _if_ the `Trigger` is coupled to the default `Broker`, and takes only effect
202+
when there is no default `Broker` already present.
203+
204+
Deleting the `Trigger` does not delete the `Broker`. With this approach the same rules from the
205+
[namespace annotation](./#installing-broker-by-annotation) apply here.
206+
207+
148208
You can find out more about delivery spec details [here](https://knative.dev/docs/eventing/event-delivery/).

0 commit comments

Comments
 (0)