$ oc -n default create serviceaccount eventing-broker-ingress $ oc -n default create serviceaccount eventing-broker-filter
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 ServiceAccount
for each namespace and give that ServiceAccount
the required RBAC permissions.
Knative Eventing installed, which includes the ClusterRole
.
Create the ServiceAccount
objects:
$ oc -n default create serviceaccount eventing-broker-ingress $ oc -n default create serviceaccount eventing-broker-filter
Give those objects 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 the broker:
cat << EOF | oc apply -f - apiVersion: eventing.knative.dev/v1beta1 kind: Broker metadata: namespace: default name: default (1) EOF
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. |