mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-07 09:46:53 +01:00
37 lines
1.5 KiB
Plaintext
37 lines
1.5 KiB
Plaintext
// Module included in the following assemblies:
|
|
//
|
|
// * serverless/event_workflows/serverless-channels.adoc
|
|
|
|
[id="serverless-channels-creating-intro_{context}"]
|
|
= Creating channels
|
|
|
|
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 example above, two objects are created: a generic backing channel and an `InMemoryChannel` channel.
|
|
If you are using a different default channel implementation, for example, Apache Kafka, a generic backing channel and `KafkaChannel` channel are 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.
|