Sink

A sink is an Addressable resource that acts as a link between the Eventing mesh and an entity or system.

We can connect any source to a sink, such as PingSource and KafkaSink objects:

  1. apiVersion: sources.knative.dev/v1beta1
  2. kind: PingSource
  3. metadata:
  4. name: test-ping-source
  5. spec:
  6. schedule: "*/1 * * * *"
  7. jsonData: '{"message": "Hello world!"}'
  8. sink:
  9. ref:
  10. apiVersion: eventing.knative.dev/v1alpha1
  11. kind: KafkaSink
  12. name: my-kafka-sink

We can connect a Trigger object to a sink, so that we can filter events, before sending them to a sink:

  1. apiVersion: eventing.knative.dev/v1
  2. kind: Trigger
  3. metadata:
  4. name: my-service-trigger
  5. spec:
  6. broker: default
  7. filter:
  8. attributes:
  9. type: dev.knative.foo.bar
  10. myextension: my-extension-value
  11. subscriber:
  12. ref:
  13. apiVersion: eventing.knative.dev/v1alpha1
  14. kind: KafkaSink
  15. name: my-kafka-sink

Knative Sinks

NameMaintainerDescription
KafkaSinkKnativeSend events to a Kafka topic
RedisSinkKnativeSend events to a Redis Stream