Skip to content

Commit 2733cb8

Browse files
committed
SRVCOM-1288 + SRVCOM-1664: Clean up attributes, prereqs
1 parent 8679f61 commit 2733cb8

11 files changed

+95
-172
lines changed

_topic_maps/_topic_map.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3212,7 +3212,7 @@ Topics:
32123212
File: serverless-event-sinks
32133213
- Name: Event delivery
32143214
File: serverless-event-delivery
3215-
- Name: Using the API server source
3215+
- Name: Creating an API server source
32163216
File: serverless-apiserversource
32173217
- Name: Creating a ping source
32183218
File: serverless-pingsource

modules/apiserversource-kn-delete.adoc

Lines changed: 0 additions & 32 deletions
This file was deleted.

modules/apiserversource-kn.adoc

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,24 @@
1+
// Module included in the following assemblies:
2+
//
3+
// serverless/develop/serverless-apiserversource.adoc
4+
15
:_content-type: PROCEDURE
26
[id="apiserversource-kn_{context}"]
37
= Creating an API server source by using the Knative CLI
48

5-
This section describes the steps required to create an API server source using `kn` commands.
9+
You can use the following procedure to create an API server source by using the `kn` CLI.
610

711
.Prerequisites
812

9-
* You must have {ServerlessProductName}, the Knative Serving and Eventing components, and the `kn` CLI installed.
13+
* The {ServerlessOperatorName} and Knative Eventing are installed on the cluster.
14+
* 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}.
15+
* You have installed the `oc` CLI.
16+
* You have installed the `kn` CLI.
1017
1118
.Procedure
1219

20+
include::snippets/serverless-service-account-apiserversource.adoc[]
21+
1322
. Create an API server source that uses a broker as a sink:
1423
+
1524
[source,terminal]
@@ -120,3 +129,26 @@ Data,
120129
...
121130
}
122131
----
132+
133+
.Deleting the API server source
134+
135+
. Delete the trigger:
136+
+
137+
[source,terminal]
138+
----
139+
$ kn trigger delete <trigger_name>
140+
----
141+
142+
. Delete the event source:
143+
+
144+
[source,terminal]
145+
----
146+
$ kn source apiserver delete <source_name>
147+
----
148+
149+
. Delete the service account, cluster role, and cluster binding:
150+
+
151+
[source,terminal]
152+
----
153+
$ oc delete -f authentication.yaml
154+
----

modules/apiserversource-yaml-delete.adoc

Lines changed: 0 additions & 32 deletions
This file was deleted.

modules/apiserversource-yaml.adoc

Lines changed: 31 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,23 @@
11
// Module included in the following assemblies:
22
//
3-
// serverless/knative_eventing/serverless-listing-event-sources.adoc
3+
// * serverless/develop/serverless-apiserversource.adoc
44

55
:_content-type: PROCEDURE
66
[id="apiserversource-yaml_context"]
7-
= Using the API server source with the YAML method
7+
= Creating an API server source by using YAML files
88

9-
This guide describes the steps required to create an API server source using YAML files.
9+
You can use the following procedure to create an API server source by using YAML files.
1010

1111
.Prerequisites
1212

13-
* You will need to have a Knative Serving and Eventing installation.
14-
* You will need to have created the `default` broker in the same namespace as the one defined in the API server source YAML file.
13+
* The {ServerlessOperatorName} and Knative Eventing are installed on the cluster.
14+
* 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}.
15+
* You have created the `default` broker in the same namespace as the one defined in the API server source YAML file.
16+
* You have installed the `oc` CLI.
1517
1618
.Procedure
1719

18-
. Create a service account, role, and role binding for the API server source as a YAML file:
19-
+
20-
[NOTE]
21-
====
22-
If you want to re-use an existing service account, you can modify your existing `ServiceAccount` resource to include the required permissions instead of creating a new resource.
23-
====
24-
+
25-
[source,yaml]
26-
----
27-
apiVersion: v1
28-
kind: ServiceAccount
29-
metadata:
30-
name: events-sa
31-
namespace: default <1>
32-
33-
---
34-
apiVersion: rbac.authorization.k8s.io/v1
35-
kind: Role
36-
metadata:
37-
name: event-watcher
38-
namespace: default <1>
39-
rules:
40-
- apiGroups:
41-
- ""
42-
resources:
43-
- events
44-
verbs:
45-
- get
46-
- list
47-
- watch
48-
49-
---
50-
apiVersion: rbac.authorization.k8s.io/v1
51-
kind: RoleBinding
52-
metadata:
53-
name: k8s-ra-event-watcher
54-
namespace: default <1>
55-
roleRef:
56-
apiGroup: rbac.authorization.k8s.io
57-
kind: Role
58-
name: event-watcher
59-
subjects:
60-
- kind: ServiceAccount
61-
name: events-sa
62-
namespace: default <1>
63-
----
64-
<1> Change this namespace to the namespace that you have selected for installing the API server source.
65-
66-
. Apply the YAML file:
67-
+
68-
[source,terminal]
69-
----
70-
$ oc apply -f <filename>
71-
----
20+
include::snippets/serverless-service-account-apiserversource.adoc[]
7221

7322
. Create an API server source as a YAML file:
7423
+
@@ -243,3 +192,26 @@ Data,
243192
...
244193
}
245194
----
195+
196+
.Deleting the API server source
197+
198+
. Delete the trigger:
199+
+
200+
[source,terminal]
201+
----
202+
$ oc delete -f trigger.yaml
203+
----
204+
205+
. Delete the event source:
206+
+
207+
[source,terminal]
208+
----
209+
$ oc delete -f k8s-events.yaml
210+
----
211+
212+
. Delete the service account, cluster role, and cluster binding:
213+
+
214+
[source,terminal]
215+
----
216+
$ oc delete -f authentication.yaml
217+
----

modules/odc-creating-apiserversource.adoc

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,24 @@
11
// Module included in the following assemblies:
22
//
3-
// * serverless/event_sources/serverless-apiserversource.adoc
3+
// * serverless/develop/serverless-apiserversource.adoc
44

55
:_content-type: PROCEDURE
66
[id="odc-creating-apiserversource_{context}"]
7-
= Creating an API server source event source using the Developer perspective
7+
= Creating an API server source by using the web console
8+
9+
You can use the following procedure to create an API server source by using the {product-title} web console.
10+
11+
.Prerequisites
12+
13+
* You have logged in to the {product-title} web console.
14+
* The {ServerlessOperatorName} and Knative Eventing are installed on the cluster.
15+
* 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.
817
918
.Procedure
1019

20+
include::snippets/serverless-service-account-apiserversource.adoc[]
21+
1122
. In the *Developer* perspective, navigate to *+Add**Event Source*. The *Event Sources* page is displayed.
1223
. Optional: If you have multiple providers for your event sources, select the required provider from the *Providers* list to filter the available event sources from the provider.
1324
. Select *ApiServerSource* and then click *Create Event Source*. The *Create Event Source* page is displayed.
@@ -34,3 +45,10 @@ image::toplogy-odc-apiserver.png[ApiServerSource Topology view]
3445
====
3546
If a URI sink is used, modify the URI by right-clicking on *URI sink* -> *Edit URI*.
3647
====
48+
49+
.Deleting the API server source
50+
51+
. Navigate to the *Topology* view.
52+
. Right-click the API server source and select *Delete ApiServerSource*.
53+
+
54+
image::delete-apiserversource-odc.png[Delete the ApiServerSource]

modules/odc-deleting-apiserversource.adoc

Lines changed: 0 additions & 14 deletions
This file was deleted.

modules/specifying-sink-flag-kn.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Module included in the following assemblies:
22
//
33
// * serverless/develop/serverless-event-sinks.adoc
4+
// * serverless/develop/serverless-apiserversource.adoc
45

56
:_content-type: REFERENCE
67
[id="specifying-sink-flag-kn_{context}"]
Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
:_content-type: ASSEMBLY
22
[id="serverless-apiserversource"]
3-
= Using the API server source
3+
= Creating an API server source
44
include::modules/common-attributes.adoc[]
55
include::modules/serverless-document-attributes.adoc[]
66
:context: serverless-apiserversource
@@ -9,29 +9,10 @@ toc::[]
99

1010
The API server source is an event source that can be used to connect an event sink, such as a Knative service, to the Kubernetes API server. The API server source watches for Kubernetes events and forwards them to the Knative Eventing broker.
1111

12-
[id="prerequisites_serverless-apiserversource"]
13-
== Prerequisites
14-
15-
* You must have a current installation of xref:../../serverless/install/install-serverless-operator.adoc#serverless-install-web-console_install-serverless-operator[{ServerlessProductName}], including Knative Serving and Eventing, in your {product-title} cluster. This can be installed by a cluster administrator.
16-
* Event sources need a service to use as an event _sink_. The sink is the service or application that events are sent to from the event source.
17-
* You must create or update a service account, role and role binding for the event source.
18-
19-
[NOTE]
20-
====
21-
Some of the following procedures require you to create YAML files.
22-
23-
If you change the names of the YAML files from those used in the examples, you must ensure that you also update the corresponding CLI commands.
24-
====
25-
26-
// service account
27-
include::modules/serverless-service-ac-event-sources.adoc[leveloffset=+1]
2812
// dev console
2913
include::modules/odc-creating-apiserversource.adoc[leveloffset=+1]
30-
include::modules/odc-deleting-apiserversource.adoc[leveloffset=+1]
3114
// kn commands
3215
include::modules/apiserversource-kn.adoc[leveloffset=+1]
3316
include::modules/specifying-sink-flag-kn.adoc[leveloffset=+2]
34-
include::modules/apiserversource-kn-delete.adoc[leveloffset=+1]
3517
// YAML
3618
include::modules/apiserversource-yaml.adoc[leveloffset=+1]
37-
include::modules/apiserversource-yaml-delete.adoc[leveloffset=+1]

serverless/reference/kn-eventing-ref.adoc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,5 @@ You can use the following commands to list, create, and manage Knative event sou
1717
include::modules/serverless-list-source-types-kn.adoc[leveloffset=+2]
1818
include::modules/serverless-kn-containersource.adoc[leveloffset=+2]
1919
include::modules/apiserversource-kn.adoc[leveloffset=+2]
20-
include::modules/apiserversource-kn-delete.adoc[leveloffset=+2]
2120
include::modules/serverless-pingsource-kn.adoc[leveloffset=+2]
2221
include::modules/serverless-kafka-source-kn.adoc[leveloffset=+2]

modules/serverless-service-ac-event-sources.adoc renamed to snippets/serverless-service-account-apiserversource.adoc

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
1-
// Module included in the following assemblies:
1+
// Snippet included in the following modules:
22
//
3-
// serverless/knative_eventing/serverless-listing-event-sources.adoc
3+
// * /modules/apiserversource-yaml.adoc
4+
// * /modules/odc-creating-apiserversource.adoc
5+
// * /modules/apiserversource-kn.adoc
46

5-
:_content-type: PROCEDURE
6-
[id="serverless-service-ac-event-sources_context"]
7-
= Creating a service account, role, and role binding for event sources
7+
:_content-type: SNIPPET
88

9-
.Procedure
10-
11-
. Create a service account, role, and role binding for the event source as a YAML file:
12-
+
139
[NOTE]
1410
====
1511
If you want to re-use an existing service account, you can modify your existing `ServiceAccount` resource to include the required permissions instead of creating a new resource.
1612
====
13+
14+
. Create a service account, role, and role binding for the event source as a YAML file:
1715
+
1816
[source,yaml]
1917
----

0 commit comments

Comments
 (0)