$ oc -n <namespace> create serviceaccount eventing-broker-ingress
Knative Eventing uses the default
broker unless otherwise specified.
If you have cluster administrator permissions, you can create the default
broker automatically using namespace annotation.
All other users must create a broker using the manual process as described in this guide.
To create a broker, you must create a service account for each namespace, and give that service account the required RBAC permissions.
Knative Eventing installed, which includes the ClusterRole
.
Create the ServiceAccount
objects.
Create the eventing-broker-ingress
object by entering the following command:
$ oc -n <namespace> create serviceaccount eventing-broker-ingress
Create the eventing-broker-filter
object by entering the following command:
$ oc -n <namespace> create serviceaccount eventing-broker-filter
Give the objects that you have created RBAC permissions:
$ oc -n default create rolebinding eventing-broker-ingress \
--clusterrole=eventing-broker-ingress \
--serviceaccount=default:eventing-broker-ingress
$ oc -n default create rolebinding eventing-broker-filter \
--clusterrole=eventing-broker-filter \
--serviceaccount=default:eventing-broker-filter
Create a broker by creating and applying a YAML file containing the following:
apiVersion: eventing.knative.dev/v1beta1
kind: Broker
metadata:
namespace: default
name: default (1)
1 | This example uses the name default , but you can replace this with any other valid name. |
If you have cluster administrator permissions, you can create a broker automatically by annotating a namespace.
Knative Eventing installed.
Cluster administrator permissions for OpenShift Container Platform.
Annotate your namespace by entering the following commands:
$ oc label namespace default knative-eventing-injection=enabled (1) $ oc -n default get broker default
1 | Replace default with the desired namespace. |
The line shown in this example will automatically create a broker named default
in the default
namespace.
Brokers created due to annotation will not be removed if you remove the annotation. You must manually delete them. |