-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Add kn channel docs #26282
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add kn channel docs #26282
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| // Module included in the following assemblies: | ||
| // | ||
| // * serverless/event_workflows/serverless-channels.adoc | ||
|
|
||
| [id="serverless-create-channel-kn_{context}"] | ||
| = Creating a channel using the Knative CLI | ||
|
|
||
| You can create a channel with the cluster default configuration by using the `kn` CLI. | ||
|
|
||
| .Prerequisites | ||
|
|
||
| To create channels using the `kn` CLI, ensure that: | ||
|
|
||
| * The {ServerlessOperatorName} and Knative Eventing are installed on your {product-title} cluster. | ||
| * You have installed the `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:v1beta1:InMemoryChannel | ||
| ---- | ||
| + | ||
| .Example output | ||
| [source,terminal] | ||
| ---- | ||
| Channel 'mychannel' created in namespace 'default'. | ||
| ---- | ||
|
|
||
| .Verification steps | ||
|
|
||
| * 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 | ||
| ---- | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| // Module included in the following assemblies: | ||
| // | ||
| // * serverless/event_workflows/serverless-channels.adoc | ||
|
|
||
| [id="serverless-creating-subscriptions-kn_{context}"] | ||
| = Creating subscriptions using the Knative CLI | ||
|
|
||
| You can create a subscription to connect a channel to a sink by using the `kn` CLI. | ||
|
|
||
| .Prerequisites | ||
|
|
||
| To create subscriptions using the `kn` CLI, ensure that: | ||
|
|
||
| * The {ServerlessOperatorName} and Knative Eventing are installed on your {product-title} cluster. | ||
| * You have installed the `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 subscription to connect a sink to a channel. | ||
| + | ||
| [source,terminal] | ||
| ---- | ||
| $ kn subscription create <subscription_name> \ | ||
| --channel <Group:Version:Kind>:<channel_name> \ | ||
|
||
| --sink <sink_prefix>:<sink_name> \ | ||
| --sink-reply <sink_prefix>:<sink_name> \ | ||
|
||
| --sink-dead-letter <sink_prefix>:<sink_name> | ||
| ---- | ||
| + | ||
| .Example command | ||
| [source,terminal] | ||
| ---- | ||
| $ kn subscription create mysubscription --channel mychannel --sink ksvc:event-display | ||
| ---- | ||
| + | ||
| .Example output | ||
| [source,terminal] | ||
| ---- | ||
| Subscription 'mysubscription' created in namespace 'default'. | ||
| ---- | ||
|
|
||
| .Verification steps | ||
|
|
||
| * To confirm that the channel is connected to the event sink, or _subscriber_, by a subscription, list the existing subscriptions and inspect the output: | ||
| + | ||
| [source,terminal] | ||
| ---- | ||
| $ kn subscription list | ||
| ---- | ||
| + | ||
| .Example output | ||
| [source,terminal] | ||
| ---- | ||
| NAME CHANNEL SUBSCRIBER REPLY DEAD LETTER SINK READY REASON | ||
| mysubscription Channel:mychannel ksvc:event-display True | ||
| ---- | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| // Module included in the following assemblies: | ||
| // | ||
| // * serverless/event_workflows/serverless-channels.adoc | ||
|
|
||
| [id="serverless-delete-channel-kn_{context}"] | ||
| = Deleting a channel using the Knative CLI | ||
|
|
||
| You can delete a channel with the cluster default configuration by using the `kn` CLI. | ||
|
|
||
| .Procedure | ||
|
|
||
| * Delete a channel: | ||
| + | ||
| [source,terminal] | ||
| ---- | ||
| $ kn channel delete <channel_name> | ||
| ---- |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we have also the possibility to define prefixes on our own in the configuration file (is this correct @navidshaikh ?), plus there is one predefined prefix
imc:for an InMemoryChannel.@abrennan89 do we already have a section where we describe the configuration file for
kn? If yes, I would add this, if not, we need a JIRA for adding this to the docs, too. I can deliver draft input for this.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should also explain what happens when now type is given: In this case a default type is selected which is configured clusterwide.