Knative Sinks

A Knative Sink can be referenced in a producer path of the Camel Knative component, e.g.:

from('timer:tick')
  .setBody().constant('event')
  .to('knative:event/broker')

Or as the value of the sink field in a KameletBinding resource, e.g.:

apiVersion: camel.apache.org/v1alpha1
kind: KameletBinding
metadata:
  name: timer-source-binding
spec:
  source:
    ref:
      kind: Kamelet
      apiVersion: camel.apache.org/v1alpha1
      name: timer-source
    properties:
      message: Event
  sink:
    ref:
      kind: Broker
      apiVersion: eventing.knative.dev/v1
      name: broker
    properties:
      type: type

In the above examples, the Knative Sink is a Knative Broker. However, a Knative Sink can be any Kubernetes resource that’s addressable, i.e., whose URL can be retrieved by reading its status.address.url.

This is what the Camel K operator does to resolve the Sink URLs, so that events can be sent to. That requires the ServiceAccount that runs the operator to be granted permission to GET these resources, while it configures the integration runtime.

As the set of resources is arbitrary, and cannot be known a-priori, these permissions are automatically granted to camel-k-operator ServiceAccount, by relying on the Knative Addressable resolver aggregated ClusterRole.

For the above examples, that sink into an eventing.knative.dev/broker resource, this is already being configured by Knative, that aggregates the required permissions for its own resources by default.

However, if you integrate custom resources as sinks, the required permissions must be added manually, as documented in the Knative documentation.