Skip to content

Commit 2c0ee56

Browse files
authored
Merge pull request #25315 from abrennan89/mastercode
[Serverless] Update code block format for commands
2 parents 72bcce0 + 8c730a5 commit 2c0ee56

File tree

41 files changed

+316
-111
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+316
-111
lines changed

modules/apiserversource-kn.adoc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ This section describes the steps required to create an ApiServerSource using `kn
99

1010
.Prerequisites
1111

12-
* You must have the `kn` CLI installed.
12+
* You must have {ServerlessProductName}, the Knative Serving and Eventing components, and the `kn` CLI installed.
1313

1414
.Procedure
1515

@@ -21,7 +21,7 @@ This section describes the steps required to create an ApiServerSource using `kn
2121
$ kn source apiserver create <event_source_name> --sink broker:<broker_name> --resource "event:v1" --service-account <service_account_name> --mode Resource
2222
----
2323

24-
. Create a Knative service that dumps incoming messages to its log:
24+
. To check that the ApiServerSource is set up correctly, create a Knative service that dumps incoming messages to its log:
2525
+
2626

2727
[source,terminal]
@@ -37,20 +37,21 @@ $ kn service create <service_name> --image quay.io/openshift-knative/knative-eve
3737
$ kn trigger create <trigger_name> --sink svc:<service_name>
3838
----
3939

40+
4041
. Create events by launching a Pod in the default namespace:
4142
+
4243

4344
[source,terminal]
4445
----
45-
$ oc create deployment hello-node --image=quay.io/openshift-knative/knative-eventing-sources-event-display
46+
$ oc create deployment hello-node --image quay.io/openshift-knative/knative-eventing-sources-event-display:latest
4647
----
4748

4849
. Check that the controller is mapped correctly by inspecting the output generated by the following command:
4950
+
5051

5152
[source,terminal]
5253
----
53-
$ kn source apiserver describe testevents
54+
$ kn source apiserver describe <source_name>
5455
----
5556

5657
+
@@ -59,7 +60,7 @@ $ kn source apiserver describe testevents
5960

6061
[source,terminal]
6162
----
62-
Name: testevents
63+
Name: mysource
6364
Namespace: default
6465
Annotations: sources.knative.dev/creator=developer, sources.knative.dev/lastModifier=developer
6566
Age: 3m
@@ -101,10 +102,9 @@ $ oc get pods
101102
$ oc logs $(oc get pod -o name | grep event-display) -c user-container
102103
----
103104

104-
+
105-
.Example output
106105
+
107106

107+
.Example output
108108
[source,terminal]
109109
----
110110
☁️ cloudevents.Event

modules/creating-serverless-apps-kn.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ The following procedure describes how you can create a basic serverless applicat
1313

1414
.Procedure
1515

16-
. Create the Knative service by entering the following command:
16+
* Create a Knative service:
1717
+
1818

1919
[source,terminal]
2020
----
21-
$ kn service create <service-name> --image <image> --env <key=value>
21+
$ kn service create <service_name> --image <image> --env <key=value>
2222
----
2323

2424
+

modules/interacting-serverless-apps-http2-gRPC.adoc

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ $ oc -n knative-serving-ingress get svc kourier
2525
----
2626

2727
+
28-
.Example output:
28+
.Example output
2929
+
3030

3131
[source,terminal]
@@ -35,15 +35,11 @@ kourier LoadBalancer 172.30.51.103 a83e86291bcdd11e993af02b7a65e514-335442
3535
----
3636

3737
+
38-
The public address is surfaced in the `EXTERNAL-IP` field.
39-
In this case, it would be `a83e86291bcdd11e993af02b7a65e514-33544245.us-east-1.elb.amazonaws.com`.
38+
The public address is surfaced in the `EXTERNAL-IP` field, and in this case is `a83e86291bcdd11e993af02b7a65e514-33544245.us-east-1.elb.amazonaws.com`.
4039

4140
. Manually set the host header of your HTTP request to the application’s host, but direct the request itself against the public address of the ingress gateway.
4241
+
43-
The following example uses the information obtained from the steps in _Verifying your serverless application deployment_:
44-
+
4542

46-
.Example command
4743
[source,terminal]
4844
----
4945
$ curl -H "Host: hello-default.example.com" a83e86291bcdd11e993af02b7a65e514-33544245.us-east-1.elb.amazonaws.com

modules/kn-trigger-describe.adoc

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,20 @@ The `kn trigger describe` command prints information about a trigger.
99

1010
.Procedure
1111

12-
To print information about a trigger, enter the following command:
12+
* Enter the command:
13+
+
14+
15+
[source,terminal]
1316
----
14-
$ kn trigger describe <TRIGGER-NAME>
17+
$ kn trigger describe <trigger_name>
1518
----
1619

17-
Example output:
20+
+
21+
.Example output
22+
+
1823

24+
[source,terminal]
1925
----
20-
$ kn trigger describe ping
2126
Name: ping
2227
Namespace: default
2328
Labels: eventing.knative.dev/broker=default

modules/kn-trigger-filtering.adoc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,18 @@
55
[id="kn-trigger-filtering_{context}"]
66
= Filtering events using triggers
77

8-
In the following trigger example, only events with attribute `type: dev.knative.samples.helloworld` will reach the event consumer.
8+
In the following trigger example, only events with the attribute `type: dev.knative.samples.helloworld` will reach the event sink.
99

10+
[source,terminal]
1011
----
11-
$ kn trigger create foo --broker default --filter type=dev.knative.samples.helloworld --sink svc:mysvc
12+
$ kn trigger create <trigger_name> --broker <broker_name> --filter type=dev.knative.samples.helloworld --sink svc:<service_name>
1213
----
1314

1415
You can also filter events using multiple attributes. The following example shows how to filter events using the type, source, and extension attributes.
1516

17+
[source,terminal]
1618
----
17-
$ kn trigger create foo --broker default --sink svc:mysvc \
19+
$ kn trigger create <trigger_name> --broker <broker_name> --sink svc:<service_name> \
1820
--filter type=dev.knative.samples.helloworld \
1921
--filter source=dev.knative.samples/helloworldsource \
2022
--filter myextension=my-extension-value

modules/kn-trigger-list.adoc

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,33 @@
88
The `kn trigger list` command prints a list of available triggers.
99

1010
.Procedure
11-
12-
* To print a list of available triggers, enter the following command:
11+
. Print a list of available triggers:
1312
+
13+
14+
[source,terminal]
1415
----
1516
$ kn trigger list
1617
----
18+
1719
+
18-
Example output:
20+
.Example output:
1921
+
22+
23+
[source,terminal]
2024
----
21-
$ kn trigger list
2225
NAME BROKER SINK AGE CONDITIONS READY REASON
2326
email default svc:edisplay 4s 5 OK / 5 True
2427
ping default svc:edisplay 32s 5 OK / 5 True
2528
----
2629

27-
* To print a list of triggers in JSON format, enter the following command:
30+
[id="kn-trigger-list-json_{context}"]
31+
= Listing triggers using `kn` in JSON format
32+
33+
.Procedure
34+
. Print a list of triggers in JSON format:
2835
+
36+
37+
[source,terminal]
2938
----
3039
$ kn trigger list -o json
3140
----

modules/kn-trigger-update.adoc

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,27 @@
55
[id="kn-trigger-update_{context}"]
66
= Updating a trigger using `kn`
77

8-
You can use the `kn trigger update` command with certain flags to quickly update attributes of a trigger.
8+
You can use the `kn trigger update` command with certain flags to update attributes for a trigger.
99

10-
.Procedure
10+
.Example
1111

12-
To update a trigger, enter the following command:
13-
----
14-
$ kn trigger update NAME --filter KEY=VALUE --sink SINK [flags]
15-
----
12+
. Update a trigger to filter exact event attributes that match incoming events, such as `type=knative.dev.event`:
1613

17-
You can update a trigger to filter exact event attributes that match incoming events, such as `type=knative.dev.event`. For example:
14+
[source,terminal]
1815
----
19-
$ kn trigger update mytrigger --filter type=knative.dev.event
16+
$ kn trigger update <trigger_name> --filter type=knative.dev.event
2017
----
2118

22-
You can also remove a filter attribute from a trigger.
23-
For example, you can remove the filter attribute with key `type`:
19+
. Remove the filter attribute with key `type`:
20+
21+
[source,terminal]
2422
----
25-
$ kn trigger update mytrigger --filter type-
23+
$ kn trigger update <trigger_name> --filter type-
2624
----
2725

28-
The following example shows how to update the sink of a trigger to `svc:new-service`:
26+
. Update the sink of a trigger to use a service named `event-display`:
27+
28+
[source,terminal]
2929
----
30-
$ kn trigger update mytrigger --sink svc:new-service
30+
$ kn trigger update <trigger_name> --sink svc:event-display
3131
----

modules/knative-serving-concurrent-autoscaling-requests.adoc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
[id="knative-serving-concurrent-autoscaling-requests_{context}"]
66
= Configuring concurrent requests for Knative Serving autoscaling
77

8-
You can specify the number of concurrent requests that should be handled by each instance of an application (revision container) by adding the `target` annotation or the `containerConcurrency` field in the revision template.
8+
You can specify the number of concurrent requests that should be handled by each instance of a revision container, or application, by adding the `target` annotation or the `containerConcurrency` field in the revision template.
99

10-
Here is an example of `target` being used in a revision template:
10+
.Example revision template YAML using target annotation
1111

1212
[source,yaml]
1313
----
@@ -25,7 +25,8 @@ spec:
2525
- image: myimage
2626
----
2727

28-
Here is an example of `containerConcurrency` being used in a revision template:
28+
.Example revision template YAML using containerConcurrency annotation
29+
2930
[source,yaml]
3031
----
3132
apiVersion: serving.knative.dev/v1
@@ -57,7 +58,7 @@ If the `containerConcurrency` value is less than the `target` value, the `target
5758

5859
The default target for the number of concurrent requests is `100`, but you can override this value by adding or modifying the `autoscaling.knative.dev/target` annotation value in the revision template.
5960

60-
Here is an example of how this annotation is used in the revision template to set the target to `50`.
61+
Here is an example of how this annotation is used in the revision template to set the target to `50`:
6162

6263
[source,yaml]
6364
----

modules/odc-creating-apiserversource.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
.Verification steps
2121

22-
. After you have created the ApiServerSource, you will see it connected to the service it is sinked to in the **Topology** view.
22+
* After you have created the ApiServerSource, you will see it connected to the service it is sinked to in the **Topology** view.
2323
+
2424
image::toplogy-odc-apiserver.png[ApiServerSource Topology view]
2525

modules/serverless-about-collecting-data.adoc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,14 @@
66
= About collecting {ServerlessProductName} data
77

88
You can use the `oc adm must-gather` CLI command to collect information about your cluster, including features and objects associated with {ServerlessProductName}.
9+
To collect {ServerlessProductName} data with `must-gather`, you must specify the {ServerlessProductName} image.
910

10-
To collect {ServerlessProductName} data with `must-gather`, you must specify the {ServerlessProductName} image:
11+
.Procedure
1112

13+
* Enter the command:
14+
+
15+
16+
[source,terminal]
1217
----
1318
$ oc adm must-gather --image=registry.redhat.io/openshift-serverless-1/svls-must-gather-rhel8
1419
----

0 commit comments

Comments
 (0)