diff --git a/docs/eventing/sources/sinkbinding/getting-started.md b/docs/eventing/sources/sinkbinding/getting-started.md index 0468f3bc2af..faac94feea1 100644 --- a/docs/eventing/sources/sinkbinding/getting-started.md +++ b/docs/eventing/sources/sinkbinding/getting-started.md @@ -1,4 +1,4 @@ -# Create a SinkBinding object +# Creating a SinkBinding object ![API version v1](https://img.shields.io/badge/API_Version-v1-red?style=flat-square) @@ -88,7 +88,7 @@ create a Knative service. For example: ```bash - $ kn service create hello --image gcr.io/knative-releases/knative.dev/eventing-contrib/cmd/event_display + $ kn service create event-display --image gcr.io/knative-releases/knative.dev/eventing-contrib/cmd/event_display ``` === "YAML" @@ -224,11 +224,11 @@ Create a `SinkBinding` object that directs events from your subject to the sink. selector: matchLabels: : - sink: - ref: - apiVersion: serving.knative.dev/v1 - kind: Service - name: + sink: + ref: + apiVersion: serving.knative.dev/v1 + kind: Service + name: EOF ``` Where: diff --git a/docs/eventing/sources/sinkbinding/reference.md b/docs/eventing/sources/sinkbinding/reference.md index 9b82167d12c..58bd07ba9e0 100644 --- a/docs/eventing/sources/sinkbinding/reference.md +++ b/docs/eventing/sources/sinkbinding/reference.md @@ -1,5 +1,7 @@ # SinkBinding reference +![API version v1](https://img.shields.io/badge/API_Version-v1-red?style=flat-square) + This topic provides reference information about the configurable fields for the SinkBinding object. @@ -47,13 +49,19 @@ resulting in `"http://mysink.default.svc.cluster.local/extra/path"`. ```yaml -sink: - ref: - apiVersion: v1 - kind: Service - namespace: default - name: mysink - uri: /extra/path +apiVersion: sources.knative.dev/v1 +kind: SinkBinding +metadata: + name: bind-heartbeat +spec: + ... + sink: + ref: + apiVersion: v1 + kind: Service + namespace: default + name: mysink + uri: /extra/path ``` !!! contract @@ -86,20 +94,31 @@ A `subject` definition supports the following fields: Given the following YAML, the `Deployment` named `mysubject` in the `default` namespace is selected: - ```yaml +```yaml +apiVersion: sources.knative.dev/v1 +kind: SinkBinding +metadata: + name: bind-heartbeat +spec: subject: apiVersion: apps/v1 kind: Deployment namespace: default name: mysubject - ``` + ... +``` #### Example: Subject parameter using matchLabels Given the following YAML, any `Job` with the label `working=example` in the `default` namespace is selected: - ```yaml +```yaml +apiVersion: sources.knative.dev/v1 +kind: SinkBinding +metadata: + name: bind-heartbeat +spec: subject: apiVersion: batch/v1beta1 kind: Job @@ -107,14 +126,20 @@ Given the following YAML, any `Job` with the label `working=example` in the selector: matchLabels: working: example - ``` + ... +``` #### Example: Subject parameter using matchExpression Given the following YAML, any `Pod` with the label `working=example` OR `working=sample` in the ` default` namespace is selected: - ```yaml +```yaml +apiVersion: sources.knative.dev/v1 +kind: SinkBinding +metadata: + name: bind-heartbeat +spec: subject: apiVersion: v1 kind: Pod @@ -126,7 +151,8 @@ Given the following YAML, any `Pod` with the label `working=example` OR values: - example - sample - ``` + ... +``` ### CloudEvent Overrides @@ -149,19 +175,24 @@ A `ceOverrides` definition supports the following fields: #### Example: CloudEvent Overrides ```yaml -ceOverrides: - extensions: - extra: this is an extra attribute - additional: 42 +apiVersion: sources.knative.dev/v1 +kind: SinkBinding +metadata: + name: bind-heartbeat +spec: + ... + ceOverrides: + extensions: + extra: this is an extra attribute + additional: 42 ``` !!! contract This results in the `K_CE_OVERRIDES` environment variable being set on the `subject` as follows: - -```json -{ "extensions": { "extra": "this is an extra attribute", "additional": "42" } } -``` + ```{ .json .no-copy } + { "extensions": { "extra": "this is an extra attribute", "additional": "42" } } + ``` [kubernetes-overview]: https://kubernetes.io/docs/concepts/overview/working-with-objects/kubernetes-objects/#required-fields diff --git a/mkdocs.yml b/mkdocs.yml index 854fd2fe872..419cc6a6ed2 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -155,7 +155,7 @@ nav: - PingSource: eventing/sources/ping-source/README.md - SinkBinding: - Overview: eventing/sources/sinkbinding/README.md - - Create a SinkBinding object: eventing/sources/sinkbinding/getting-started.md + - Creating a SinkBinding object: eventing/sources/sinkbinding/getting-started.md - SinkBinding reference: eventing/sources/sinkbinding/reference.md - Camel source: eventing/sources/apache-camel-source/README.md - Kafka source: eventing/sources/kafka-source/README.md