$ oc label namespace <namespace> eventing.knative.dev/injection=enabled
If you have cluster administrator permissions on a OpenShift Container Platform cluster, you can create Knative Eventing components with OpenShift Serverless in the Administrator perspective of the web console or by using the kn
and oc
CLIs.
If you have cluster administrator permissions, you can create an event source by using the Administrator perspective in the web console.
The OpenShift Serverless Operator and Knative Eventing are installed on your OpenShift Container Platform cluster.
You have cluster administrator permissions for OpenShift Container Platform.
In the Administrator perspective of the OpenShift Container Platform web console, navigate to Serverless → Eventing.
In the Create list, select Event Source. You will be directed to the Event Sources page.
Select the event source type that you want to create.
See Getting started with event sources for more information on which event source types are supported and can be created using by OpenShift Serverless.
If you have cluster administrator permissions, you can create a broker by using the Administrator perspective in the web console.
The OpenShift Serverless Operator and Knative Eventing are installed on your OpenShift Container Platform cluster.
You have cluster administrator permissions for OpenShift Container Platform.
In the Administrator perspective of the OpenShift Container Platform web console, navigate to Serverless → Eventing.
In the Create list, select Broker. You will be directed to the Create Broker page.
Optional: Modify the YAML configuration for the broker.
Click Create.
If you have cluster administrator permissions, you can create the default
broker automatically by labeling a namespace.
Brokers created using this method will not be removed if you remove the label. You must manually delete them. |
The OpenShift Serverless Operator and Knative Eventing are installed on your OpenShift Container Platform cluster.
You have cluster administrator permissions for OpenShift Container Platform.
Label a namespace with eventing.knative.dev/injection=enabled
:
$ oc label namespace <namespace> eventing.knative.dev/injection=enabled
You can verify that the broker has been created successfully by using the oc
CLI, or by observing it in the Topology view in the web console.
Use the oc
command to get the broker:
$ oc -n <namespace> get broker <broker_name>
$ oc -n default get broker default
NAME READY REASON URL AGE
default True http://broker-ingress.knative-eventing.svc.cluster.local/test/default 3m56s
Navigate to the Topology view in the web console, and observe that the broker exists:
Brokers created by injection, by using a namespace label or trigger annotation, are not deleted permanently if a developer removes the label or annotation. A user with cluster administrator permissions must manually delete these brokers.
Remove the eventing.knative.dev/injection=enabled
label from the namespace:
$ oc label namespace <namespace> eventing.knative.dev/injection-
Removing the annotation prevents Knative from recreating the broker after you delete it.
Delete the broker from the selected namespace:
$ oc -n <namespace> delete broker <broker_name>
Use the oc
command to get the broker:
$ oc -n <namespace> get broker <broker_name>
$ oc -n default get broker default
No resources found.
Error from server (NotFound): brokers.eventing.knative.dev "default" not found
If you have cluster administrator permissions and have created a broker, you can create a trigger to connect your broker to a subscriber by using the Administrator perspective in the web console.
The OpenShift Serverless Operator and Knative Eventing are installed on your OpenShift Container Platform cluster.
You have cluster administrator permissions for OpenShift Container Platform.
You have created a broker.
You have created a Knative service to use as a subscriber.
In the Administrator perspective of the OpenShift Container Platform web console, navigate to Serverless → Eventing.
In the Broker tab, select the Options menu for the broker that you want to add a trigger to.
Click Add Trigger in the list.
In the Add Trigger dialogue box, select a Subscriber for the trigger. The subscriber is the Knative service that will receive events from the broker.
Click Add.
If you have cluster administrator permissions, you can create a channel by using the Administrator perspective in the web console.
The OpenShift Serverless Operator and Knative Eventing are installed on your OpenShift Container Platform cluster.
You have cluster administrator permissions for OpenShift Container Platform.
In the Administrator perspective of the OpenShift Container Platform web console, navigate to Serverless → Eventing.
In the Create list, select Channel. You will be directed to the Channel page.
Select the type of Channel
object that you want to create from the Type drop-down.
Currently only |
Click Create.
If you have cluster administrator permissions and have created a channel, you can create a subscription to connect your broker to a subscriber by using the Administrator perspective in the web console.
The OpenShift Serverless Operator and Knative Eventing are installed on your OpenShift Container Platform cluster.
You have cluster administrator permissions for OpenShift Container Platform.
You have created a channel.
You have created a Knative service to use as a subscriber.
In the Administrator perspective of the OpenShift Container Platform web console, navigate to Serverless → Eventing.
In the Channel tab, select the Options menu for the channel that you want to add a subscription to.
Click Add Subscription in the list.
In the Add Subscription dialogue box, select a Subscriber for the subscription. The subscriber is the Knative service that will receive events from the channel.
Click Add.
For information about using Apache Kafka components, see Using Apache Kafka with OpenShift Serverless.