Knative Eventing Sugar Controller
The following command installs the Eventing Sugar Controller:
Automatic Broker Creation
One way to create a Broker is to manually apply a resource to a cluster using the default settings:
Copy the following YAML into a file:
metadata:
name: default
namespace: default
Apply the YAML file by running the command:
There might be cases where automated Broker creation is desirable, such as on namespace creation, or on Trigger creation. The Sugar controller enables those use-cases:
- When a Namespace is labeled with
eventing.knative.dev/injection=enabled
, the sugar controller will create a default Broker named “default” in that namespace. - When a Trigger is annotated with
eventing.knative.dev/injection=enabled
, the controller will create a Broker named by that Trigger in the Trigger’s Namespace.
When a Broker is deleted and the mentioned labels or annotations are in use, the Sugar Controller will automatically recreate a default Broker.
Creating a “default” Broker when creating a Namespace:
To automatically create a Broker after a namespace exists, label the Namespace:
If the Broker named “default” already exists in the Namespace, the Sugar Controller will do nothing.
Trigger Example
Create a “default” Broker in the Trigger’s Namespace when creating a Trigger:
If the Broker named “default” already exists in the Namespace, the Sugar Controller will do nothing and the Trigger will not own the existing Broker.