Skip to content

Commit 6c5c9d8

Browse files
authored
Merge pull request #19667 from abrennan89/broker
Added details about creating brokers for Serverless GA
2 parents 889fe4e + 4ff5257 commit 6c5c9d8

File tree

4 files changed

+101
-4
lines changed

4 files changed

+101
-4
lines changed

_topic_map.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1234,15 +1234,15 @@ Topics:
12341234
File: odo-architecture
12351235
- Name: Installing odo
12361236
File: installing-odo
1237-
- Name: Using odo in a restricted environment
1237+
- Name: Using odo in a restricted environment
12381238
Dir: using_odo_in_a_restricted_environment
1239-
Topics:
1239+
Topics:
12401240
- Name: About odo in a restricted environment
1241-
File: about-odo-in-a-restricted-environment
1241+
File: about-odo-in-a-restricted-environment
12421242
- Name: Pushing the odo init image to the restricted cluster registry
12431243
File: pushing-the-odo-init-image-to-the-restricted-cluster-registry
12441244
- Name: Creating and deploying a component to the disconnected cluster
1245-
File: creating-and-deploying-a-component-to-the-disconnected-cluster
1245+
File: creating-and-deploying-a-component-to-the-disconnected-cluster
12461246
- Name: Creating a single-component application with odo
12471247
File: creating-a-single-component-application-with-odo
12481248
- Name: Creating a multicomponent application with odo
@@ -1503,6 +1503,7 @@ Topics:
15031503
File: installing-openshift-serverless
15041504
- Name: Using Knative Client
15051505
File: knative-client
1506+
### Serving
15061507
- Name: Knative Serving
15071508
Dir: knative_serving
15081509
Topics:
@@ -1520,13 +1521,16 @@ Topics:
15201521
File: cluster-logging-serverless
15211522
- Name: Splitting traffic between revisions
15221523
File: splitting-traffic-between-revisions
1524+
### Eventing
15231525
### - Name: Knative Eventing
15241526
### Dir: knative_eventing
15251527
### Topics:
15261528
### - Name: How Knative Eventing works
15271529
### File: serverless-knative-eventing
15281530
### - Name: Using Knative Eventing sources
15291531
### File: serverless-kn-source
1532+
### - Name: Using the broker
1533+
### File: serverless-using-brokers
15301534
### Monitoring
15311535
- Name: Monitoring OpenShift Serverless components
15321536
File: monitoring-serverless
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * serverless/knative_eventing/serverless-using-brokers.adoc
4+
5+
[id="serverless-creating-broker-admin_{context}"]
6+
= Creating a broker for your namespace automatically using namespace annotation
7+
8+
If you have cluster administrator permissions, you can create a broker automatically by annotating a namespace.
9+
10+
.Prerequisites
11+
* Knative Eventing installed.
12+
* Cluster administrator permissions for {product-title}.
13+
14+
.Procedure
15+
16+
. Annotate your namespace:
17+
+
18+
----
19+
$ oc label namespace default knative-eventing-injection=enabled <1>
20+
$ oc -n default get broker default
21+
----
22+
<1> Replace `default` with the desired namespace.
23+
+
24+
The line shown in this example will automatically create a broker named `default` in the `default` namespace.
25+
26+
[id="serverless-deleting-broker-admin_{context}"]
27+
= Deleting a broker that was created using namespace annotation
28+
29+
. Delete the injected broker from the selected namespace (in this example, the `default` namespace):
30+
+
31+
----
32+
$ oc -n default delete broker default
33+
----
34+
35+
[NOTE]
36+
====
37+
Brokers created due to annotation will not be removed if you remove the annotation. You must manually delete them.
38+
====
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * serverless/knative_eventing/serverless-using-brokers.adoc
4+
5+
[id="serverless-creating-broker_{context}"]
6+
= Creating a broker
7+
8+
To create a broker, you must create a `ServiceAccount` for each namespace and give that `ServiceAccount` the required RBAC permissions.
9+
10+
.Prerequisites
11+
* Knative Eventing installed, which includes the `ClusterRole`.
12+
13+
.Procedure
14+
. Create the `ServiceAccount` objects:
15+
+
16+
----
17+
$ oc -n default create serviceaccount eventing-broker-ingress
18+
$ oc -n default create serviceaccount eventing-broker-filter
19+
----
20+
21+
. Give those objects RBAC permissions:
22+
+
23+
----
24+
$ oc -n default create rolebinding eventing-broker-ingress \
25+
--clusterrole=eventing-broker-ingress \
26+
--serviceaccount=default:eventing-broker-ingress
27+
$ oc -n default create rolebinding eventing-broker-filter \
28+
--clusterrole=eventing-broker-filter \
29+
--serviceaccount=default:eventing-broker-filter
30+
----
31+
32+
. Create the broker:
33+
+
34+
----
35+
cat << EOF | oc apply -f -
36+
apiVersion: eventing.knative.dev/v1beta1
37+
kind: Broker
38+
metadata:
39+
namespace: default
40+
name: default <1>
41+
EOF
42+
----
43+
<1> This example uses the name `default`, but you can replace this with any other valid name.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[id="serverless-using-brokers"]
2+
= Using brokers with Knative Eventing
3+
include::modules/common-attributes.adoc[]
4+
include::modules/serverless-document-attributes.adoc[]
5+
:context: serverless-using-brokers
6+
7+
toc::[]
8+
9+
Knative Eventing uses the `default` broker unless otherwise specified. However, this section describes how you can create your own broker.
10+
11+
include::modules/serverless-creating-broker.adoc[leveloffset=+1]
12+
include::modules/serverless-creating-broker-admin.adoc[leveloffset=+1]

0 commit comments

Comments
 (0)