1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-06 06:46:26 +01:00
Files
openshift-docs/modules/serverless-inmemorychannel.adoc
2020-09-30 19:09:02 +00:00

59 lines
2.1 KiB
Plaintext

// Module included in the following assemblies:
//
// * serverless/event_workflows/serverless-channels.adoc
[id="serverless-inmemorychannel_{context}"]
= Using the default development channel configuration
When you install Knative Eventing, the following `default-ch-webhook` config map is created automatically in the `knative-eventing` namespace:
[source,yaml]
----
apiVersion: v1
kind: ConfigMap
metadata:
name: default-ch-webhook
namespace: knative-eventing
data:
default-ch-config: |
clusterDefault:
apiVersion: messaging.knative.dev/v1
kind: InMemoryChannel
namespaceDefaults:
some-namespace:
apiVersion: messaging.knative.dev/v1
kind: InMemoryChannel
----
This config map can specify either a cluster-wide default channel implementation, or a namespace-specific default channel implementation.
Configuring a namespace-specific default overrides any cluster-wide settings.
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.
.Example `Channel` object with `spec.channelTemplate` properties
[source,yaml]
----
apiVersion: messaging.knative.dev/v1
kind: Channel
metadata:
name: example-channel
namespace: default
spec:
channelTemplate:
apiVersion: messaging.knative.dev/v1
kind: InMemoryChannel
----
The channel controller then creates the backing channel instance based on the `spec.channelTemplate` configuration.
[NOTE]
====
The `spec.channelTemplate` properties cannot be changed after creation, because they are set by the default channel mechanism rather than by the user.
====
When this mechanism is used, two objects are created: a generic channel, and an `InMemoryChannel` channel.
The generic channel acts as a proxy that copies its subscriptions to the `InMemoryChannel` channel, and sets its status to reflect the status of the backing `InMemoryChannel` channel.
Because the channel in this example is created in the default namespace, the channel uses the cluster default, which is InMemoryChannel.