@@ -145,4 +145,64 @@ spec:
145145EOF
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+
148208You can find out more about delivery spec details [here](https://knative.dev/docs/eventing/event-delivery/).
0 commit comments