Skip to content

Bring back ContainerSource? #2739

@nachocano

Description

@nachocano

Problem
In 0.12 we deprecated ContainerSource in favor of SinkBinding. Once 0.13 was cut, we removed ContainerSource #2693, according to our deprecation guidelines.
Thanks to @matzew that started the migration plan, I think we can now easily compare both solutions, and revisit whether we made the right call or not.

My opinion is that we should bring back ContainerSource as it provides a clearer UX for (non-advanced) Developers, whom don't know about core K8s constructs (nor need to learn about them).
IMO we made a step forward in adding SinkBinding and all its power, but two steps back when we decided to remove ContainerSource in lieu of the former.

From the migration doc we can clearly see both experiences:

1- ContainerSource

apiVersion: sources.eventing.knative.dev/v1alpha1
kind: ContainerSource
metadata:
  name: urbanobservatory-event-source
spec:
  image: quay.io/openshift-knative/knative-eventing-sources-websocketsource:latest
  args:
    - '--source=wss://api.usb.urbanobservatory.ac.uk/stream'
    - '--eventType=my.custom.event'
  sink:
    apiVersion: serving.knative.dev/v1
    kind: Service
    name: wss-event-display

vs.

2- SinkBinding + Deployment

apiVersion: sources.knative.dev/v1alpha2
kind: SinkBinding
metadata:
  name: bind-wss
spec:
  subject:
    apiVersion: apps/v1
    kind: Deployment
    selector:
      matchLabels:
        app: wss
  sink:
    ref:
      apiVersion: serving.knative.dev/v1
      kind: Service
      name: wss-event-display

AND

apiVersion: apps/v1
kind: Deployment
metadata:
  name: wss
  labels:
    app: wss
spec:
  selector:
    matchLabels:
      app: wss
  template:
    metadata:
      labels:
        app: wss
    spec:
      containers:
        - image: quay.io/openshift-knative/knative-eventing-sources-websocketsource:latest
          name: wss
          args:
            - '--source=wss://api.usb.urbanobservatory.ac.uk/stream'
            - '--eventType=my.custom.event'

I think most people would argue that option 1 is simpler to use, yet we removed it because SinkBinding covers more cases (bind to any PodSpecable). That should also be possible with a better impl of ContainerSource.
There were thoughts of moving ContainerSource to eventing-contrib. Although I think that is better than not having it at all (and at first I agreed to it), it comes with the problem that it needs its own controller and webhook, thus making it less compelling... And it also wouldn't have native CLI support

Persona:
Developer

Time Estimate (optional):
Decision by EOW (3/13)

Exit Criteria
A decision of whether to bring back ContainerSource to core or not.

Additional context (optional)
#2693
#2499

/cc @vaikas @grantr @lionelvillard as eventing WG leaders, and others.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions