Adding trigger annotations (#4331)

* adding trigger annotations

* Update docs/eventing/broker/triggers/README.md

Co-authored-by: Samia Nneji <snneji@vmware.com>

* Update docs/eventing/broker/triggers/README.md

Co-authored-by: Samia Nneji <snneji@vmware.com>

* Update docs/eventing/broker/triggers/README.md

Co-authored-by: Samia Nneji <snneji@vmware.com>

* Update docs/eventing/broker/triggers/README.md

Co-authored-by: Samia Nneji <snneji@vmware.com>

* Update docs/eventing/broker/triggers/README.md

Co-authored-by: Samia Nneji <snneji@vmware.com>

* updating based on recommendations

* dedup

* trailing whitespace removal

Co-authored-by: Samia Nneji <snneji@vmware.com>
This commit is contained in:
salaboy 2021-10-13 15:11:49 +01:00 committed by GitHub
parent 95303b95fa
commit b696f460ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 28 additions and 0 deletions

View File

@ -99,3 +99,31 @@ This example filters events from the `default` broker that are of type
kubectl apply -f <filename>.yaml
```
Where `<filename>` is the name of the file you created in the previous step.
## Trigger annotations
You can modify a Trigger's behavior by setting the following two annotations:
- `eventing.knative.dev/injection`: if set to `enabled`, Eventing automatically creates a Broker for a Trigger if it doesn't exist. The Broker is created in the namespace where the Trigger is created. This annotation only works if you have the [Sugar Controller](../../sugar/README.md) enabled, which is optional and not enabled by default.
- `knative.dev/dependency`: this annotation is used to mark the sources that the Trigger depends on. If one of the dependencies is not ready, the Trigger will not be ready.
The following YAML is an example of a Trigger with a dependency:
```yaml
apiVersion: eventing.knative.dev/v1
kind: Trigger
metadata:
name: my-service-trigger
annotations:
knative.dev/dependency: '{"kind":"PingSource","name":"test-ping-source","apiVersion":"sources.knative.dev/v1"}'
spec:
broker: default
filter:
attributes:
type: dev.knative.foo.bar
myextension: my-extension-value
subscriber:
ref:
apiVersion: serving.knative.dev/v1
kind: Service
name: my-service
```