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

proposal: add Service Binding proposal (#1445) #1864

Merged
merged 3 commits into from
Jan 20, 2021

Conversation

johnpoth
Copy link
Member

Proposal for #1445

Thanks !

Release Note

NONE

Conversely, the drawback of implementing the second approach is that more work is needed as Camel-k would have to retrieve and inject the binding information.
The advantage would be that Camel-k retains full control of the ``Integration``'s `Deployment/Cron/Knative` resource and we can delay the startup until the binding information is available.

For these reasons, it seems that the second approach is preferred in the context of Camel-k.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assuming the camel-k operator is installed at global scope, using this approach would require the camel-k operator to have basically have access to any resource in any namespaces ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for reviewing! It would require the camel-k operator to have read access to the ServiceBinding and it's corresponding Secret. It would also need to have rights to create a ServiceBinding

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does the camel-k operator really need to access the secret ? I mean, the operator should add the service binding secret among the list of the secrets the integration needs, nothing more right ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no it doesn't, I added it for convenience to create property mappings like {DB_PORT} instead of {secret:name/DB_PORT}. Doesn't camel-k already have rights to read Secrets ?
Nevertheless I think we can achieve this by adding the logic in camel-k-runtime via a customizer and avoid camel-k reading the Secret.
Ideally though, I think we would want to add some prefix to the property to avoid clashes like {binding:name/DB_PORT} where the user could elegantly choose the name

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, you can tell camel-k to mount a secret and make its content available as properties

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally though, I think we would want to add some prefix to the property to avoid clashes like {binding:name/DB_PORT} where the user could elegantly choose the name

I'm not very sure about this one as the main goal is to be able to auto configure components without the user intervention, on quarkus one of the option that has been taken into account is to have a binding aware config source that is in charge to translate binding parameters to the related quarkus property and I think we should do something similar for components.

If users want to directly reference binding parameters, they should use the same syntax as for secrets {secret:$name/$property} as it is already namespaced.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the main goal is to be able to auto configure components without the user intervention

The Camel Dream 👍

on quarkus one of the option that has been taken into account is to have a binding aware config source that is in charge to translate binding parameters to the related quarkus property

This sounds promising, do you have a Camel or a Quarkus example I could look at ? I wasn't aware this was possible

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reference issue is here: quarkusio/quarkus#13617

As side note, for some components we may benefit directly from the work done in Quarkus as example, if the jdbc set-up is auto-magically done by a Quarkus extension, then we can consume it as we do as today without having anything to change (same could happen for kafka, infinispan, jms, etc.)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's definitely something we want to leverage 👍 I'll start hacking on this

@nicolaferraro nicolaferraro merged commit 9b6f068 into apache:master Jan 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants