Event sources¶
An event source is a Kubernetes custom resource (CR), created by a developer or cluster administrator, that acts as a link between an event producer and an event sink. A sink can be a k8s service, including Knative Services, a Channel, or a Broker that receives events from an event source.
Event sources are created by instantiating a CR from a Source object. The Source object defines the arguments and parameters needed to instantiate a CR.
All Sources are part of the sources
category.
You can list existing event sources on your cluster by entering the kn command:
kn source list
You can list existing event sources on your cluster by entering the command:
kubectl get sources
Note
Event Sources that import events from other messaging technologies such as Kafka or RabbitMQ are not responsible for setting Optional Attributes such as the datacontenttype
. This is a responsibility of the original event producer; the Source just appends attributes if they exist.
Knative Sources¶
Name | Status | Maintainer | Description |
---|---|---|---|
APIServerSource | Stable | Knative | Brings Kubernetes API server events into Knative. The APIServerSource fires a new event each time a Kubernetes resource is created, updated or deleted. |
Apache CouchDB | Alpha | Knative | Brings Apache CouchDB messages into Knative. |
Apache Kafka | Stable | Knative | Brings Apache Kafka messages into Knative. The KafkaSource reads events from an Apache Kafka Cluster, and passes these events to a sink so that they can be consumed. See the Kafka Source example for more details. |
CephSource | Beta | Knative | The Ceph source converts bucket notifications from Ceph format into CloudEvents format, and inject them into Knative. Conversion logic follow the one described for AWS S3 bucket notifications. |
ContainerSource | Stable | Knative | The ContainerSource instantiates container image(s) that can generate events until the ContainerSource is deleted. This may be used, for example, to poll an FTP server for new files or generate events at a set time interval. Given a spec.template with at least a container image specified, the ContainerSource keeps a Pod running with the specified image(s). K_SINK (destination address) and KE_CE_OVERRIDES (JSON CloudEvents attributes) environment variables are injected into the running image(s). It is used by multiple other Sources as underlying infrastructure. Refer to the Container Source example for more details. |
GitHub | Beta | Knative | Registers for events of the specified types on the specified GitHub organization or repository, and brings those events into Knative. The GitHubSource fires a new event for selected GitHub event types. See the GitHub Source example for more details. |
GitLab | Beta | Knative | Registers for events of the specified types on the specified GitLab repository, and brings those events into Knative. The GitLabSource creates a webhooks for specified event types, listens for incoming events, and passes them to a consumer. See the GitLab Source example for more details. |
KogitoSource | Alpha | Knative | An implementation of the Kogito Runtime custom resource managed by the Kogito Operator. |
PingSource | Stable | Knative | Produces events with a fixed payload on a specified Cron schedule. See the Ping Source example for more details. |
RabbitMQ | Stable | Knative | Brings RabbitMQ messages into Knative. |
RedisSource | Beta | Knative | Brings Redis Stream into Knative. |
SinkBinding | Stable | Knative | The SinkBinding can be used to author new event sources using any of the familiar compute abstractions that Kubernetes makes available (e.g. Deployment, Job, DaemonSet, StatefulSet), or Knative abstractions (e.g. Service, Configuration). SinkBinding provides a framework for injecting K_SINK (destination address) and K_CE_OVERRIDES (JSON cloudevents attributes) environment variables into any Kubernetes resource which has a spec.template that looks like a Pod (aka PodSpecable). See the SinkBinding example for more details. |
Third-Party Sources¶
Name | Status | Maintainer | Description |
---|---|---|---|
Apache Camel | Stable | Apache Software Foundation | Enables use of Apache Camel components for pushing events into Knative. Camel sources are now provided via Kamelets as part of the Apache Camel K project. |
Debezium | Alpha | Debezium | Consume database changes as CloudEvents in Knative. (knative configuration) |
Direktiv | Alpha | Direktiv | Receive events from Direktiv. |
DockerHubSource | Alpha | None | Retrieves events from Docker Hub Webhooks and transforms them into CloudEvents for consumption in Knative. |
VMware | Alpha | VMware | Brings vSphere events into Knative. |
Additional resources¶
- If your code needs to send events as part of its business logic and doesn't fit the model of a Source, consider feeding events directly to a Broker.
- For more information about using
kn
Source related commands, see thekn source
reference documentation.