Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for sinkbinding #1637

Merged
merged 7 commits into from Aug 7, 2020
Merged

Conversation

nicolaferraro
Copy link
Member

@nicolaferraro nicolaferraro commented Jul 24, 2020

Fix #1548

Requires: apache/camel-k-runtime#411

Tasks:

  • Add sinkbinding option in knative trait
  • Implement scenario 2 in the issue
  • E2E tests
  • Regen docs

Release Note

Standard integrations can now create a sinkbinding to be listed as Knative sources

@nicolaferraro nicolaferraro added kind/feature New feature or request status/wip Work in progress labels Jul 24, 2020
@heiko-braun
Copy link

@nicolaferraro do you have an example of a sinkbinding declaration with a regular integration?

@nicolaferraro nicolaferraro removed the status/wip Work in progress label Aug 6, 2020
@nicolaferraro nicolaferraro marked this pull request as ready for review August 6, 2020 08:20
@nicolaferraro
Copy link
Member Author

@nicolaferraro do you have an example of a sinkbinding declaration with a regular integration?

@heiko-braun this is an (working) integration that results as a regular Knative source:

apiVersion: camel.apache.org/v1
kind: Integration
metadata:
  name: source
spec:
  flows:
  - from:
      uri: timer:tick
      parameters:
        period: "1000"
      steps:
      - set-body:
          constant: Hello SinkBinding !!!
      - transform:
          simple: ${body.toUpperCase()}
      - to: log:info
        # the following line may also be split into k/v format (to be implemented)
      - to: knative:channel/messages?apiVersion=messaging.knative.dev/v1beta1&kind=InMemoryChannel
  traits:
    knative:
      configuration:
        sinkBinding: true # we may default it to true in the future to avoid this setting

A future simplified version may look like:

apiVersion: camel.apache.org/v1
kind: Integration
metadata:
  name: source
spec:
  flows:
  - from:
      uri: timer:tick
      parameters:
        period: "1000"
      steps:
      - set-body:
          constant: Hello SinkBinding !!!
      - transform:
          simple: ${body.toUpperCase()}
      - to: log:info
      - to:
          uri: knative:endpoint
          parameters:
            apiVersion: messaging.knative.dev/v1beta1
            kind: InMemoryChannel
            name: messages

Which is very close to the equivalent CamelSource (current working implementation):

apiVersion: sources.knative.dev/v1alpha1
kind: CamelSource
metadata:
  name: source
spec:
  source:
    flow:
      from:
        uri: timer:tick
        parameters:
          period: "1000"
        steps:
        - set-body:
            constant: Hello Old CamelSource !!!
        - transform:
            simple: ${body.toUpperCase()}
        - to: log:info
  sink:
    ref:
      apiVersion: messaging.knative.dev/v1beta1
      kind: InMemoryChannel
      name: messages

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use sinkbinding in operator
3 participants