1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 12:46:18 +01:00
Files
openshift-docs/modules/serverless-create-channel-kn.adoc
2023-10-30 10:13:25 -04:00

65 lines
1.8 KiB
Plaintext

// Module included in the following assemblies:
//
// * /serverless/develop/serverless-creating-channels.adoc
:_mod-docs-content-type: PROCEDURE
[id="serverless-create-channel-kn_{context}"]
= Creating a channel by using the Knative CLI
Using the Knative (`kn`) CLI to create channels provides a more streamlined and intuitive user interface than modifying YAML files directly. You can use the `kn channel create` command to create a channel.
.Prerequisites
* The {ServerlessOperatorName} and Knative Eventing are installed on the cluster.
* You have installed the Knative (`kn`) CLI.
* You have created a project or have access to a project with the appropriate roles and permissions to create applications and other workloads in {product-title}.
.Procedure
* Create a channel:
+
[source,terminal]
----
$ kn channel create <channel_name> --type <channel_type>
----
+
The channel type is optional, but where specified, must be given in the format `Group:Version:Kind`.
For example, you can create an `InMemoryChannel` object:
+
[source,terminal]
----
$ kn channel create mychannel --type messaging.knative.dev:v1:InMemoryChannel
----
+
.Example output
[source,terminal]
----
Channel 'mychannel' created in namespace 'default'.
----
.Verification
* To confirm that the channel now exists, list the existing channels and inspect the output:
+
[source,terminal]
----
$ kn channel list
----
+
.Example output
[source,terminal]
----
kn channel list
NAME TYPE URL AGE READY REASON
mychannel InMemoryChannel http://mychannel-kn-channel.default.svc.cluster.local 93s True
----
.Deleting a channel
// split into own module, out of scope for this PR
* Delete a channel:
+
[source,terminal]
----
$ kn channel delete <channel_name>
----