Creating an event source by using the Administrator perspective

If you have cluster administrator permissions, you can create an event source by using the Administrator perspective in the web console.

Prerequisites
  • The OpenShift Serverless Operator and Knative Eventing are installed on your OpenShift Container Platform cluster.

  • You have cluster administrator permissions for OpenShift Container Platform.

Procedure
  1. In the Administrator perspective of the OpenShift Container Platform web console, navigate to ServerlessEventing.

  2. In the Create list, select Event Source. You will be directed to the Event Sources page.

  3. 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.

Creating a broker by using the Administrator perspective

If you have cluster administrator permissions, you can create a broker by using the Administrator perspective in the web console.

Prerequisites
  • The OpenShift Serverless Operator and Knative Eventing are installed on your OpenShift Container Platform cluster.

  • You have cluster administrator permissions for OpenShift Container Platform.

Procedure
  1. In the Administrator perspective of the OpenShift Container Platform web console, navigate to ServerlessEventing.

  2. In the Create list, select Broker. You will be directed to the Create Broker page.

  3. Optional: Modify the YAML configuration for the broker.

  4. Click Create.

Creating a broker by labeling a namespace

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.

Prerequisites
  • The OpenShift Serverless Operator and Knative Eventing are installed on your OpenShift Container Platform cluster.

  • You have cluster administrator permissions for OpenShift Container Platform.

Procedure
  • Label a namespace with eventing.knative.dev/injection=enabled:

    $ oc label namespace <namespace> eventing.knative.dev/injection=enabled
Verification

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.

  1. Use the oc command to get the broker:

    $ oc -n <namespace> get broker <broker_name>
    Example command
    $ oc -n default get broker default
    Example output
    NAME      READY     REASON    URL                                                                     AGE
    default   True                http://broker-ingress.knative-eventing.svc.cluster.local/test/default   3m56s
  2. Navigate to the Topology view in the web console, and observe that the broker exists:

    View the broker in the web console Topology view

Deleting a broker that was created by injection

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.

Procedure
  1. 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.

  2. Delete the broker from the selected namespace:

    $ oc -n <namespace> delete broker <broker_name>
Verification
  • Use the oc command to get the broker:

    $ oc -n <namespace> get broker <broker_name>
    Example command
    $ oc -n default get broker default
    Example output
    No resources found.
    Error from server (NotFound): brokers.eventing.knative.dev "default" not found

Creating a trigger by using the Administrator perspective

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.

Prerequisites
  • 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.

Procedure
  1. In the Administrator perspective of the OpenShift Container Platform web console, navigate to ServerlessEventing.

  2. In the Broker tab, select the Options menu kebab for the broker that you want to add a trigger to.

  3. Click Add Trigger in the list.

  4. 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.

  5. Click Add.

Creating a channel by using the Administrator perspective

If you have cluster administrator permissions, you can create a channel by using the Administrator perspective in the web console.

Prerequisites
  • The OpenShift Serverless Operator and Knative Eventing are installed on your OpenShift Container Platform cluster.

  • You have cluster administrator permissions for OpenShift Container Platform.

Procedure
  1. In the Administrator perspective of the OpenShift Container Platform web console, navigate to ServerlessEventing.

  2. In the Create list, select Channel. You will be directed to the Channel page.

  3. Select the type of Channel object that you want to create from the Type drop-down.

    Currently only InMemoryChannel channel objects are supported by default. Kafka channels are available as a Technology Preview if you have installed Apache Kafka on OpenShift Serverless.

  4. Click Create.

Creating a subscription by using the Administrator perspective

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.

Prerequisites
  • 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.

Procedure
  1. In the Administrator perspective of the OpenShift Container Platform web console, navigate to ServerlessEventing.

  2. In the Channel tab, select the Options menu kebab for the channel that you want to add a subscription to.

  3. Click Add Subscription in the list.

  4. 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.

  5. Click Add.

Additional resources