diff --git a/images/create-sub-ODC.png b/images/create-sub-ODC.png new file mode 100644 index 0000000000..54a81308a8 Binary files /dev/null and b/images/create-sub-ODC.png differ diff --git a/images/serverless-verify-source-channel.png b/images/serverless-verify-source-channel.png new file mode 100644 index 0000000000..0fea95ba5f Binary files /dev/null and b/images/serverless-verify-source-channel.png differ diff --git a/images/sink-pingsource-channel.png b/images/sink-pingsource-channel.png new file mode 100644 index 0000000000..13cb3365e4 Binary files /dev/null and b/images/sink-pingsource-channel.png differ diff --git a/images/verify-channel-odc.png b/images/verify-channel-odc.png new file mode 100644 index 0000000000..43a36617d7 Binary files /dev/null and b/images/verify-channel-odc.png differ diff --git a/images/verify-pingsource-ODC.png b/images/verify-pingsource-ODC.png new file mode 100644 index 0000000000..dac0464b36 Binary files /dev/null and b/images/verify-pingsource-ODC.png differ diff --git a/images/verify-subscription-odc.png b/images/verify-subscription-odc.png new file mode 100644 index 0000000000..c621e6d34f Binary files /dev/null and b/images/verify-subscription-odc.png differ diff --git a/modules/kn-trigger-list.adoc b/modules/kn-trigger-list.adoc index 4c1d70bb06..18f5ebd653 100644 --- a/modules/kn-trigger-list.adoc +++ b/modules/kn-trigger-list.adoc @@ -17,7 +17,7 @@ $ kn trigger list ---- + -.Example output: +.Example output [source,terminal] ---- NAME BROKER SINK AGE CONDITIONS READY REASON diff --git a/modules/serverless-connect-channel-source-odc.adoc b/modules/serverless-connect-channel-source-odc.adoc new file mode 100644 index 0000000000..c5bd21f724 --- /dev/null +++ b/modules/serverless-connect-channel-source-odc.adoc @@ -0,0 +1,32 @@ +// Module included in the following assemblies: +// +// * serverless/event_workflows/serverless-channels.adoc + +[id="serverless-connect-channel-source-odc_{context}"] += Connect an event source to a channel using {product-title} web console + +You can create multiple event source types in {product-title} that can be connected to channels. + +.Prerequisites +To connect an event source to a channel using the *Developer* perspective, ensure that: + +* The {ServerlessOperatorName}, Knative Serving, and Knative Eventing are installed on your {product-title} cluster. +* You have logged in to the web console. +* You are in the *Developer* perspective. +* 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}. +* You have created a channel by following the documentation on _Creating a channel using {product-title} web console_. + +.Procedure +. Create an event source of any type, by following the documentation on _Getting started with event sources_. +. In the *Sink* section of the *Event Sources* form view, select *Resource*. Then use the drop-down to select your channel. ++ +image::sink-pingsource-channel.png[Use your channel as the Resource] +. Click *Create*. + +.Verification steps +You can verify that the event source was created and is connected to the sink by viewing the *Topology* page. + +. In the *Developer* perspective, navigate to *Topology*. +. View the event source and click on the connected channel to see the channel details in the side panel. ++ +image::serverless-verify-source-channel.png[View the source and connected channel] diff --git a/modules/serverless-create-channel-odc.adoc b/modules/serverless-create-channel-odc.adoc new file mode 100644 index 0000000000..2b13e59c4a --- /dev/null +++ b/modules/serverless-create-channel-odc.adoc @@ -0,0 +1,33 @@ +// Module included in the following assemblies: +// +// * serverless/event_workflows/serverless-channels.adoc + +[id="serverless-create-channel-odc_{context}"] += Creating a channel using the Developer perspective + +You can create a channel with the cluster default configuration by using the {product-title} web console. + +.Prerequisites +To create channels using the *Developer* perspective ensure that: + +* The {ServerlessOperatorName}, Knative Serving, and Knative Eventing are installed on your {product-title} cluster. +* You have logged in to the web console. +* You are in the *Developer* perspective. +* 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 + +. In the *Developer* perspective, navigate to *+Add* -> *Channel*. +. Select the type of `Channel` object that you want to create from the *Type* drop-down. ++ +[NOTE] +==== +Currently only InMemoryChannel type `Channel` objects are supported. +==== +. Click *Create*. + +.Verification steps + +* Confirm that the channel now exists by navigating to the *Topology* page. ++ +image::verify-channel-odc.png[View the channel in the Topology view] diff --git a/modules/serverless-create-inmemorychannel-yaml.adoc b/modules/serverless-create-inmemorychannel-yaml.adoc new file mode 100644 index 0000000000..f4a219755f --- /dev/null +++ b/modules/serverless-create-inmemorychannel-yaml.adoc @@ -0,0 +1,37 @@ +// Module included in the following assemblies: +// +// * serverless/event_workflows/serverless-channels.adoc + +[id="serverless-create-inmemorychannel-yaml_{context}"] += Creating a development channel using YAML + +You can create a channel by using YAML with the cluster default configuration. + +.Prerequisites +To create channels ensure that: + +* The {ServerlessOperatorName}, Knative Serving, and Knative Eventing are installed on your {product-title} cluster. +* 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` object. +.. Create a YAML file and copy the following sample code into it: ++ + +[source,yaml] +---- +apiVersion: messaging.knative.dev/v1 +kind: Channel +metadata: + name: example-channel + namespace: default +---- + +.. Apply the YAML file: ++ + +[source,terminal] +---- +$ oc apply -f +---- diff --git a/modules/serverless-create-inmemorychannel.adoc b/modules/serverless-create-inmemorychannel.adoc deleted file mode 100644 index a447f24e12..0000000000 --- a/modules/serverless-create-inmemorychannel.adoc +++ /dev/null @@ -1,31 +0,0 @@ -// Module included in the following assemblies: -// -// * serverless/event_workflows/serverless-channels.adoc - -[id="serverless-create-inmemorychannel_{context}"] -= Creating a development channel - -.Procedure - -You can create a channel using the cluster default configuration by completing the following procedure. - -. Create a `Channel` object. -.. Create a YAML file and copy the following sample code into it: -+ - -[source,yaml] ----- -apiVersion: messaging.knative.dev/v1 -kind: Channel -metadata: - name: example-channel - namespace: default ----- - -.. Apply the YAML file by entering: -+ - -[source,terminal] ----- -$ oc apply -f ----- diff --git a/modules/serverless-creating-subscriptions-odc.adoc b/modules/serverless-creating-subscriptions-odc.adoc new file mode 100644 index 0000000000..f1046131bd --- /dev/null +++ b/modules/serverless-creating-subscriptions-odc.adoc @@ -0,0 +1,34 @@ +// Module included in the following assemblies: +// +// * serverless/event_workflows/serverless-channels.adoc + +[id="serverless-creating-subscriptions-odc_{context}"] += Connecting a channel to a sink using subscriptions in the Developer perspective + +.Prerequisites +To create subscriptions using the *Developer* perspective, ensure that: + +* The {ServerlessOperatorName}, Knative Serving, and Knative Eventing are installed on your {product-title} cluster. +* You have logged in to the web console. +* You are in the *Developer* perspective. +* 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}. +* You have created an event sink, such as a Knative service, and a channel. + +.Procedure +. Navigate to the *Topology* page. +. Create a subscription using one of the following methods: +.. Hover over the channel that you want to create a subscription for, and drag the arrow. The *Add Subscription* option is displayed. ++ +image::create-sub-ODC.png[Create a subscription for the channel] ++ +... Select your sink as a subscriber from the drop-down list. +... Click *Add*. +.. If the service is available in the *Topology* view under the same namespace or project as the channel, click on the channel that you want to create a subscription for, and drag the arrow directly to a service to immediately create a subscription from the channel to that service. + + +.Verification steps +* After the subscription has been created, you can see it represented as a line that connects the channel to the service in the *Topology* view: ++ +image::verify-subscription-odc.png[Subscription in the Topology view] ++ +You can view the event source, channel, and subscriptions for the sink by clicking on the service. diff --git a/modules/serverless-creating-subscriptions.adoc b/modules/serverless-creating-subscriptions-yaml.adoc similarity index 93% rename from modules/serverless-creating-subscriptions.adoc rename to modules/serverless-creating-subscriptions-yaml.adoc index a22723231d..6d51f343ca 100644 --- a/modules/serverless-creating-subscriptions.adoc +++ b/modules/serverless-creating-subscriptions-yaml.adoc @@ -3,8 +3,8 @@ // // * serverless/event_workflows/serverless-channels.adoc -[id="serverless-creating-subscriptions_{context}"] -= Creating a subscription +[id="serverless-creating-subscriptions-yaml_{context}"] += Connecting a channel to a sink using subscriptions with YAML You can create a `Subscription` object to connect a channel to a sink. In the following procedure, the example sink is a Knative service named `error-handler`. diff --git a/modules/serverless-pingsource-odc.adoc b/modules/serverless-pingsource-odc.adoc new file mode 100644 index 0000000000..96b338387b --- /dev/null +++ b/modules/serverless-pingsource-odc.adoc @@ -0,0 +1,56 @@ +// Module included in the following assemblies: +// +// * serverless/event_workflows/serverless-pingsource.adoc + +[id="serverless-pingsource-odc_{context}"] += Creating a PingSource using the Developer Perspective + +You can create and verify a basic PingSource from the {product-title} web console. + +.Prerequisites +To create a PingSource using the *Developer* perspective, ensure that: + +* The {ServerlessOperatorName}, Knative Serving, and Knative Eventing are installed on your {product-title} cluster. +* You have logged in to the web console. +* You are in the *Developer* perspective. +* 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 + +. To verify that the PingSource is working, create a simple Knative +service that dumps incoming messages to the logs of the service. +.. In the *Developer* perspective, navigate to *+Add* -> *YAML*. +.. Copy the example YAML: ++ + +[source,yaml] +---- +apiVersion: serving.knative.dev/v1 +kind: Service +metadata: + name: event-display +spec: + template: + spec: + containers: + - image: quay.io/openshift-knative/knative-eventing-sources-event-display:latest +---- + +.. Click *Create*. + +. Create a PingSource in the same namespace as the service created in the previous step, or any other sink that you want to send events to. +.. In the *Developer* perspective, navigate to *+Add* -> *Event Source*. +.. Select *Ping Source*. +.. Enter a value for *Schedule*. In this example, the value is `*/2 * * * *`, which creates a PingSource that sends a message every two minutes. +.. Optional: You can enter a value for *Data*, which is the message payload. +.. Select a *Sink*. This can be either a *Resource* or a *URI*. In this example, the `event-display` service created in the previous step is used as the *Resource* sink. +.. Click *Create*. + +.Verfication steps + +You can verify that the PingSource was created and is connected to the sink by viewing the *Topology* page. + +. In the *Developer* perspective, navigate to *Topology*. +. View the PingSource and sink. ++ +image::verify-pingsource-ODC.png[View the PingSource and service in the Topology view] diff --git a/modules/serverless-supported-channel-types.adoc b/modules/serverless-supported-channel-types.adoc new file mode 100644 index 0000000000..e96b9b3cb6 --- /dev/null +++ b/modules/serverless-supported-channel-types.adoc @@ -0,0 +1,14 @@ +// Module included in the following assemblies: +// +// * serverless/event_workflows/serverless-channels.adoc + +[id="serverless-supported-channel-types_{context}"] += Supported channel types + +Currently, {ServerlessProductName} only supports `InMemoryChannel` type channels for development use, as part of the Knative Eventing Technology Preview. + +The following are limitations of InMemoryChannel type channels: + +* No event persistence is available. If a pod goes down, events on that pod are lost. +* InMemoryChannel type channels do not implement event ordering, so two events that are received in the channel at the same time can be delivered to a subscriber in any order. +* If a subscriber rejects an event, there are no re-delivery attempts. Instead, the rejected event is sent to a `deadLetterSink` if this sink exists, or is dropped. diff --git a/serverless/event_sources/serverless-pingsource.adoc b/serverless/event_sources/serverless-pingsource.adoc index 1607bc5a93..b30f539edc 100644 --- a/serverless/event_sources/serverless-pingsource.adoc +++ b/serverless/event_sources/serverless-pingsource.adoc @@ -32,5 +32,6 @@ spec: <2> The event message body expressed as a JSON encoded data string. <3> These are the details of the event consumer. In this example, we are using a Knative service named `event-display`. +include::modules/serverless-pingsource-odc.adoc[leveloffset=+1] include::modules/serverless-pingsource-kn.adoc[leveloffset=+1] include::modules/serverless-pingsource-yaml.adoc[leveloffset=+1] diff --git a/serverless/event_workflows/serverless-channels.adoc b/serverless/event_workflows/serverless-channels.adoc index 841ee768de..1d43cb2d96 100644 --- a/serverless/event_workflows/serverless-channels.adoc +++ b/serverless/event_workflows/serverless-channels.adoc @@ -15,20 +15,14 @@ Channels are custom resources that define a single event-forwarding and persiste After events have been sent to a channel, these events can be sent to multiple Knative services, or other sinks, by using a subscription. -The default configuration for channel instances is defined in the `default-ch-webhook` ConfigMap. Developers can create their own channels directly by instantiating a supported `Channel` object. -[id="serverless-channels-supported-types"] -== Supported channel types +include::modules/serverless-supported-channel-types.adoc[leveloffset=+1] +// include::modules/serverless-inmemorychannel.adoc[leveloffset=+2] +// comment out for now - this information isn't necessary while only default channel type is available, and should be moved to an admin guide anyway. +include::modules/serverless-create-channel-odc.adoc[leveloffset=+1] +include::modules/serverless-connect-channel-source-odc.adoc[leveloffset=+2] +include::modules/serverless-creating-subscriptions-odc.adoc[leveloffset=+2] -Currently, {ServerlessProductName} only supports `InMemoryChannel` kind channels for development use, as part of the Knative Eventing Technology Preview. - -The following are limitations of InMemoryChannel type channels: - -* No event persistence is available. If a Pod goes down, events on that Pod are lost. -* InMemoryChannel type channels do not implement event ordering, so two events that are received in the channel at the same time can be delivered to a subscriber in any order. -* If a subscriber rejects an event, there are no re-delivery attempts. Instead, the rejected event is sent to a `deadLetterSink` if this sink exists, or is otherwise dropped. - -include::modules/serverless-inmemorychannel.adoc[leveloffset=+2] -include::modules/serverless-create-inmemorychannel.adoc[leveloffset=+1] -include::modules/serverless-creating-subscriptions.adoc[leveloffset=+1] +include::modules/serverless-create-inmemorychannel-yaml.adoc[leveloffset=+1] +include::modules/serverless-creating-subscriptions-yaml.adoc[leveloffset=+2]