Channel types and defaults

Knative provides the InMemoryChannel channel implementation by default. This default implementation is useful for developers who do not want to configure a specific implementation type, such as Apache Kafka or NATSS channels.

NOTE: InMemoryChannel channels should not be used in production environments.

The default channel implementation is specified in the default-ch-webhook ConfigMap in the knative-eventing namespace. For more information about modifying ConfigMaps, see Configuring the Eventing Operator custom resource.

In the following example, the cluster default channel implementation is InMemoryChannel, while the namespace default channel implementation for the example-namespace is KafkaChannel.

  1. apiVersion: v1
  2. kind: ConfigMap
  3. metadata:
  4. name: default-ch-webhook
  5. namespace: knative-eventing
  6. data:
  7. default-ch-config: |
  8. clusterDefault:
  9. apiVersion: messaging.knative.dev/v1
  10. kind: InMemoryChannel
  11. namespaceDefaults:
  12. example-namespace:
  13. apiVersion: messaging.knative.dev/v1beta1
  14. kind: KafkaChannel
  15. spec:
  16. numPartitions: 2
  17. replicationFactor: 1

Default channels can be configured for the cluster, a namespace on the cluster, or both.

NOTE: If a default channel implementation is configured for a namespace, this will overwrite the configuration for the cluster.