Skip to content

Commit 77ec5cd

Browse files
authored
Merge pull request #44337 from abrennan89/abstracts2
SRVCOM-1728: Update abstracts for event source docs to use Jupiter guidelines, other misc. improvements
2 parents 0441b9f + 2242ca8 commit 77ec5cd

16 files changed

+86
-82
lines changed

modules/apiserversource-kn.adoc

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,26 @@
77
[id="apiserversource-kn_{context}"]
88
= Creating an API server source by using the Knative CLI
99

10-
You can use the following procedure to create an API server source by using the `kn` CLI.
10+
You can use the `kn source apiserver create` command to create an API server source by using the `kn` CLI. Using the `kn` CLI to create an API server source provides a more streamlined and intuitive user interface than modifying YAML files directly.
1111

1212
.Prerequisites
1313

1414
* The {ServerlessOperatorName} and Knative Eventing are installed on the cluster.
1515
* 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}.
16-
* You have installed the `oc` CLI.
17-
* You have installed the `kn` CLI.
16+
* You have installed the OpenShift (`oc`) CLI.
17+
* You have installed the Knative (`kn`) CLI.
1818
1919
.Procedure
2020

2121
include::snippets/serverless-service-account-apiserversource.adoc[]
2222

23-
. Create an API server source that uses a broker as a sink:
23+
. Create an API server source that has an event sink. In the following example, the sink is a broker:
2424
+
2525
[source,terminal]
2626
----
2727
$ kn source apiserver create <event_source_name> --sink broker:<broker_name> --resource "event:v1" --service-account <service_account_name> --mode Resource
2828
----
29+
// need to revisit these docs and give better tutorial examples with different sinks; out of scope for the current PR
2930

3031
. To check that the API server source is set up correctly, create a Knative service that dumps incoming messages to its log:
3132
+
@@ -34,7 +35,7 @@ $ kn source apiserver create <event_source_name> --sink broker:<broker_name> --r
3435
$ kn service create <service_name> --image quay.io/openshift-knative/knative-eventing-sources-event-display:latest
3536
----
3637

37-
. Create a trigger to filter events from the `default` broker to the service:
38+
. If you used a broker as an event sink, create a trigger to filter events from the `default` broker to the service:
3839
+
3940
[source,terminal]
4041
----

modules/apiserversource-yaml.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
[id="apiserversource-yaml_context"]
77
= Creating an API server source by using YAML files
88

9-
You can use the following procedure to create an API server source by using YAML files.
9+
Creating Knative resources by using YAML files uses a declarative API, which enables you to describe event sources declaratively and in a reproducible manner. To create an API server source by using YAML, you must create a YAML file that defines an `ApiServerSource` object, then apply it by using the `oc apply` command.
1010

1111
.Prerequisites
1212

1313
* The {ServerlessOperatorName} and Knative Eventing are installed on the cluster.
1414
* 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}.
1515
* You have created the `default` broker in the same namespace as the one defined in the API server source YAML file.
16-
* Install the OpenShift CLI (`oc`).
16+
* Install the OpenShift (`oc`) CLI.
1717
1818
.Procedure
1919

modules/odc-creating-apiserversource.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
[id="odc-creating-apiserversource_{context}"]
77
= Creating an API server source by using the web console
88

9-
You can use the following procedure to create an API server source by using the {product-title} web console.
9+
After Knative Eventing is installed on your cluster, you can create an API server source by using the web console. Using the {product-title} web console provides a streamlined and intuitive user interface to create an event source.
1010

1111
.Prerequisites
1212

1313
* You have logged in to the {product-title} web console.
1414
* The {ServerlessOperatorName} and Knative Eventing are installed on the cluster.
1515
* 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}.
16-
* You have installed the `oc` CLI.
16+
* You have installed the OpenShift (`oc`) CLI.
1717
1818
.Procedure
1919

modules/serverless-containersource-guidelines.adoc

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,9 @@
66
[id="serverless-containersource-guidelines_{context}"]
77
= Guidelines for creating a container image
88

9-
* Two environment variables are injected by the container source controller: `K_SINK` and `K_CE_OVERRIDES`. These variables are resolved from the `sink` and `ceOverrides` spec, respectively.
9+
Two environment variables are injected by the container source controller: `K_SINK` and `K_CE_OVERRIDES`. These variables are resolved from the `sink` and `ceOverrides` spec, respectively. Events are sent to the sink URI specified in the `K_SINK` environment variable. The message must be sent as a `POST` using the link:https://cloudevents.io/[`CloudEvent`] HTTP format.
1010

11-
* Event messages are sent to the sink URI specified in the `K_SINK` environment variable. The event message can be in any format; however, using the link:https://cloudevents.io/[`CloudEvent`] spec is recommended.
12-
13-
[id="serverless-containersource-guidelines-examples_{context}"]
14-
== Example container images
11+
.Example container images
1512

1613
The following is an example of a heartbeats container image:
1714

modules/serverless-containersource-reference.adoc

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
[id="serverless-containersource-reference_{context}"]
77
= Container source reference
88

9-
This topic provides reference information about the configurable fields for the
10-
`ContainerSource` object.
9+
You can use a container as an event source, by creating a `ContainerSource` object. You can configure multiple parameters when creating a `ContainerSource` object.
1110

1211
`ContainerSource` objects support the following fields:
1312

@@ -47,9 +46,7 @@ This topic provides reference information about the configurable fields for the
4746

4847
|===
4948

50-
[id="serverless-containersource-reference-template-parameter-example_{context}"]
51-
== Template parameter example
52-
49+
.Template parameter example
5350
[source,yaml]
5451
----
5552
apiVersion: sources.knative.dev/v1
@@ -75,7 +72,7 @@ spec:
7572
[id="serverless-containersource-reference-cloudevent-overrides_{context}"]
7673
== CloudEvent overrides
7774

78-
A `ceOverrides` definition provides overrides that control the CloudEvent's output format and modifications sent to the sink
75+
A `ceOverrides` definition provides overrides that control the CloudEvent's output format and modifications sent to the sink. You can configure multiple fields for the `ceOverrides` definition.
7976

8077
A `ceOverrides` definition supports the following fields:
8178

modules/serverless-kn-containersource.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66
:_content-type: REFERENCE
77
[id="serverless-kn-containersource_{context}"]
88
= Creating and managing container sources by using the Knative CLI
9+
// needs to be revised as separate procedure modules; out of scope for this PR
910

10-
You can use the following `kn` commands to create and manage container sources:
11+
You can use the `kn source container` commands to create and manage container sources by using the `kn` CLI. Using the `kn` CLI to create event sources provides a more streamlined and intuitive user interface than modifying YAML files directly.
1112

1213
.Create a container source
1314
[source,terminal]

modules/serverless-odc-create-containersource.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
[id="serverless-odc-create-containersource_{context}"]
77
= Creating a container source by using the web console
88

9-
You can create a container source by using the *Developer* perspective of the {product-title} web console.
9+
After Knative Eventing is installed on your cluster, you can create a container source by using the web console. Using the {product-title} web console provides a streamlined and intuitive user interface to create an event source.
1010

1111
.Prerequisites
1212

modules/serverless-pingsource-kn.adoc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@
77
[id="serverless-pingsource-kn_{context}"]
88
= Creating a ping source by using the Knative CLI
99

10-
You can use the following procedure to create a ping source by using the `kn` CLI.
10+
You can use the `kn source ping create` command to create a ping source by using the `kn` CLI. Using the `kn` CLI to create event sources provides a more streamlined and intuitive user interface than modifying YAML files directly.
1111

1212
.Prerequisites
1313

1414
* The {ServerlessOperatorName}, Knative Serving and Knative Eventing are installed on the cluster.
15-
* You have installed the `kn` CLI.
15+
* You have installed the Knative (`kn`) CLI.
1616
* 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}.
17+
* Optional: If you want to use the verification steps for this procedure, install the OpenShift (`oc`) CLI.
1718
1819
.Procedure
1920

@@ -108,6 +109,7 @@ Data,
108109
----
109110
110111
.Deleting the ping source
112+
// move to a separate procedure, out of scope for this PR
111113
112114
* Delete the ping source:
113115
+

modules/serverless-pingsource-odc.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
[id="serverless-pingsource-odc_{context}"]
77
= Creating a ping source by using the web console
88

9-
You can use the following procedure to create a ping source by using the {product-title} web console.
9+
After Knative Eventing is installed on your cluster, you can create a ping source by using the web console. Using the {product-title} web console provides a streamlined and intuitive user interface to create an event source.
1010

1111
.Prerequisites
1212

@@ -61,6 +61,7 @@ You can verify that the ping source was created and is connected to the sink by
6161
image::verify-pingsource-ODC.png[View the ping source and service in the Topology view]
6262

6363
.Deleting the ping source
64+
// move to separate procedure, out of scope for this PR
6465

6566
. Navigate to the *Topology* view.
6667
. Right-click the API server source and select *Delete Ping Source*.

modules/serverless-pingsource-yaml.adoc

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,41 @@
66
[id="serverless-pingsource-yaml_{context}"]
77
= Creating a ping source by using YAML
88

9-
The following sections describe how to create a basic ping source using YAML files.
9+
Creating Knative resources by using YAML files uses a declarative API, which enables you to describe event sources declaratively and in a reproducible manner. To create a serverless ping source by using YAML, you must create a YAML file that defines a `PingSource` object, then apply it by using `oc apply`.
10+
11+
.Example `PingSource` object
12+
[source,yaml]
13+
----
14+
apiVersion: sources.knative.dev/v1alpha2
15+
kind: PingSource
16+
metadata:
17+
name: test-ping-source
18+
spec:
19+
schedule: "*/2 * * * *" <1>
20+
jsonData: '{"message": "Hello world!"}' <2>
21+
sink: <3>
22+
ref:
23+
apiVersion: serving.knative.dev/v1
24+
kind: Service
25+
name: event-display
26+
----
27+
28+
<1> The schedule of the event specified using https://kubernetes.io/docs/tasks/job/automated-tasks-with-cron-jobs/#schedule[CRON expression].
29+
<2> The event message body expressed as a JSON encoded data string.
30+
<3> These are the details of the event consumer. In this example, we are using a Knative service named `event-display`.
1031

1132
.Prerequisites
1233

1334
* The {ServerlessOperatorName}, Knative Serving and Knative Eventing are installed on the cluster.
14-
* Install the OpenShift CLI (`oc`).
35+
* Install the OpenShift (`oc`) CLI.
1536
* 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}.
1637
1738
.Procedure
1839

1940
. To verify that the ping source is working, create a simple Knative
2041
service that dumps incoming messages to the service's logs.
2142

22-
.. Copy the example YAML into a file named `service.yaml`:
43+
.. Create a service YAML file:
2344
+
2445
[source,yaml]
2546
----
@@ -37,12 +58,12 @@ spec:
3758
+
3859
[source,terminal]
3960
----
40-
$ oc apply --filename service.yaml
61+
$ oc apply -f <filename>
4162
----
4263

4364
. For each set of ping events that you want to request, create a ping source in the same namespace as the event consumer.
4465

45-
.. Copy the example YAML into a file named `ping-source.yaml`:
66+
.. Create a YAML file for the ping source:
4667
+
4768
[source,yaml]
4869
----
@@ -63,14 +84,14 @@ spec:
6384
+
6485
[source,terminal]
6586
----
66-
$ oc apply --filename ping-source.yaml
87+
$ oc apply -f <filename>
6788
----
6889

6990
. Check that the controller is mapped correctly by entering the following command:
7091
+
7192
[source,terminal]
7293
----
73-
$ oc get pingsource.sources.knative.dev test-ping-source -oyaml
94+
$ oc get pingsource.sources.knative.dev <ping_source_name> -oyaml
7495
----
7596
+
7697
.Example output
@@ -140,12 +161,13 @@ Data,
140161
----
141162

142163
.Deleting the ping source
164+
// move to separate procedure; out of scope for this PR
143165

144166
* Delete the ping source:
145167
+
146168
[source,terminal]
147169
----
148-
$ oc delete -f <ping_source_yaml_filename>
170+
$ oc delete -f <filename>
149171
----
150172
+
151173
.Example command

0 commit comments

Comments
 (0)