Skip to content

Create a default Broker upon Trigger creation by default #2970

@antoineco

Description

@antoineco

This echoes a thread started on Slack (#eventing, April 10th)

Problem

We've had multiple discussion, especially in knative/docs#2325 and #2946, about making the automatic injection of a (MT-)Broker per namespace the default.

To sum up the current state of the discussion:

  • pro
    Creating a MT-Broker is super cheap and makes the developer's experience simpler, because at the end of the days people want to use Triggers, and Triggers are only useful with an existing Broker.
  • contra
    A cluster is rarely composed of Eventing namespaces only, and users don't expect objects to be magically injected everywhere on their behalf.

I think we all agree we'd rather not be creating Brokers manually whenever we want to use some Triggers. We want to keep the developer experience as simple as possible by letting users focus on Triggers, unless they explicitly express the desire to manage Brokers on their own.

Therefore I would like to suggest that a Trigger can be created without explicitly referencing a Broker and without the need to define any extra label, in which case the mutation webhook injects broker: default inside the Trigger's spec and the Trigger reconciler creates that default Broker if it's missing.

@grantr pointed out this feature already exists since #2034, so we would simply have to reverse the requirement on the knative-eventing-injection label to make it opt-out instead of opt-in.

Persona:

Event consumer (developer)

Exit Criteria

A developer can create a Trigger without explicitly creating a Broker beforehand. This action should cascade into the creation of a default Broker with sane defaults within the same namespace as the Trigger.

Time Estimate (optional):

A day.

Additional context (optional)

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/eventingThe Eventing api groupkind/proposalIssues or PRs related to proposals.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions