-
Notifications
You must be signed in to change notification settings - Fork 71
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
Use secrets with KameletBindings #549
Comments
You can do something like this: |
Exactly the solution I needed, works flawlessly! Thank you. Is there a possibility including this in the documentation? I'm using Kamelets in an Enterprise context and this seems like a common use case because:
|
It's also possible to use auto-secrets in KameletBindings, like you do in java routes. The place you put the configuration name is in the special # ...
sink:
ref:
kind: Kamelet
apiVersion: camel.apache.org/v1alpha1
name: my-company-log-sink
properties:
id: mynamedconfig # The special "id" property links the binding to the secret you defined above We should document this. There's an example in the e2e tests: https://github.com/apache/camel-k/tree/92c860599760f8d74c63c5f71e689e0a7b374438/e2e/yaks/common/kamelet-binding-autoload The only problem of the solution described by @oscerd is that those properties become global in the KameletBinding, so any Kamelet in the binding that has e.g. and "authorizationToken" parameter gets the global value, while the secret autoload strategy does not suffer from this issue. |
I forgot to mention what @nicolaferraro said, we need to document it a bit better. |
@nicolaferraro This is an even better solution. This way I can configure every sink and source separately. For instance when I have a telegram sink and source that need to be connected. Just to bundle the solution into one reply, how to use auto-secrets in KamelBindings:
|
According the the Kamelets User Documentation, a way (3rd one) to configure your Kamelets is to
kubectl create secret generic my-company-log-sink.mynamedconfig --from-file=mynamedconfig.properties
kubectl label secret my-company-log-sink.mynamedconfig camel.apache.org/kamelet=my-company-log-sink camel.apache.org/kamelet.configuration=mynamedconfig
Right now, I have to hard-code needed (confidential) properties into the KameletBinding:
my-binding.kamelet.yaml
Is there also a way of referencing the config in a KameletBinding? I don't want to use java routes only to be able to use secret-based configuration. Something like this:
my-binding.kamelet.yaml
The text was updated successfully, but these errors were encountered: