:_mod-docs-content-type: ASSEMBLY
[id="serverless-custom-event-sources"]
= Custom event sources
include::_attributes/common-attributes.adoc[]
:context: serverless-custom-event-sources

toc::[]

If you need to ingress events from an event producer that is not included in Knative, or from a producer that emits events which are not in the `CloudEvent` format, you can do this by creating a custom event source. You can create a custom event source by using one of the following methods:

* Use a `PodSpecable` object as an event source, by creating a sink binding.
* Use a container as an event source, by creating a container source.

// sinkbinding intro
include::modules/serverless-sinkbinding-intro.adoc[leveloffset=+1]
// YAML
include::modules/serverless-sinkbinding-yaml.adoc[leveloffset=+2]
// kn commands
include::modules/serverless-sinkbinding-kn.adoc[leveloffset=+2]
include::modules/specifying-sink-flag-kn.adoc[leveloffset=+3]
// ODC
include::modules/serverless-sinkbinding-odc.adoc[leveloffset=+2]
// Reference
include::modules/serverless-sinkbinding-reference.adoc[leveloffset=+2]

[id="serverless-custom-event-sources-containersource"]
== Container source

Container sources create a container image that generates events and sends events to a sink. You can use a container source to create a custom event source, by creating a container image and a `ContainerSource` object that uses your image URI.

// intro
include::modules/serverless-containersource-guidelines.adoc[leveloffset=+2]
// kn
include::modules/serverless-kn-containersource.adoc[leveloffset=+2]
// ODC
include::modules/serverless-odc-create-containersource.adoc[leveloffset=+2]
// Reference
include::modules/serverless-containersource-reference.adoc[leveloffset=+2]
