1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 12:46:18 +01:00
Files
openshift-docs/serverless/develop/serverless-creating-channels.adoc
2022-02-09 13:07:11 -06:00

50 lines
2.3 KiB
Plaintext

:_content-type: ASSEMBLY
[id="serverless-creating-channels"]
= Creating and deleting channels
include::modules/common-attributes.adoc[]
include::modules/serverless-document-attributes.adoc[]
:context: serverless-creating-channels
toc::[]
Developers can create channels by instantiating a supported `Channel` object.
After you create a `Channel` object, a mutating admission webhook adds a set of `spec.channelTemplate` properties for the `Channel` object based on the default channel implementation.
For example, for an `InMemoryChannel` default implementation, the `Channel` object looks as follows:
[source,yaml]
----
apiVersion: messaging.knative.dev/v1
kind: Channel
metadata:
name: example-channel
namespace: default
spec:
channelTemplate:
apiVersion: messaging.knative.dev/v1
kind: InMemoryChannel
----
[NOTE]
====
The `spec.channelTemplate` properties cannot be changed after creation, because they are set by the default channel mechanism rather than by the user.
====
The channel controller then creates the backing channel instance based on the `spec.channelTemplate` configuration.
When this mechanism is used with the preceding example, two objects are created: a generic backing channel and an `InMemoryChannel` channel. If you are using a different default channel implementation, the `InMemoryChannel` is replaced with one that is specific to your implementation. For example, with Knative Kafka, the `KafkaChannel` channel is created.
The backing channel acts as a proxy that copies its subscriptions to the user-created channel object, and sets the user-created channel object status to reflect the status of the backing channel.
include::modules/serverless-create-channel-odc.adoc[leveloffset=+1]
include::modules/serverless-create-channel-kn.adoc[leveloffset=+1]
include::modules/serverless-create-default-channel-yaml.adoc[leveloffset=+1]
include::modules/serverless-create-kafka-channel-yaml.adoc[leveloffset=+1]
// deleting channels
include::modules/serverless-delete-channel-kn.adoc[leveloffset=+1]
[id="next-steps_serverless-creating-channels"]
== Next steps
* After you have created a channel, see xref:../../serverless/develop/serverless-subs.adoc#serverless-subs[Using subscriptions] for information about creating and using subscriptions for event delivery.