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

Externalize hotrod-client.properties with infinispan-client #4285

Closed
ricardozanini opened this issue Oct 1, 2019 · 9 comments
Closed

Externalize hotrod-client.properties with infinispan-client #4285

ricardozanini opened this issue Oct 1, 2019 · 9 comments
Labels
kind/enhancement New feature or request
Milestone

Comments

@ricardozanini
Copy link

Description
When deploying a quarkus native application on a Kubernetes cluster, we need a easy way to configure the HotRod Client using hotrod-client.properties. Right now, the extension only supports reading this configuration from classpath. On cloud environments would be impossible to have such file mapped to a configMap, for example.

One use case is: How do we set authentication options (like credentials) using this extension and without a hard coded hotrod-client.properties file in the classpath with property substitution? I don't want to rely on environment variables with user credentials inside the pod.

Also, this file has a bunch of options that advanced use cases might need:
https://docs.jboss.org/infinispan/9.4/apidocs/org/infinispan/client/hotrod/configuration/package-summary.html

Implementation ideas

So what's need is one property that tells the extension where the file is, for example: quarkus.infinispan-client.hotrod-client.file=/home/user/conf/hotrod-client.properties.

Then this file could be read in here:
https://github.com/quarkusio/quarkus/blob/master/extensions/infinispan-client/runtime/src/main/java/io/quarkus/infinispan/client/runtime/InfinispanClientProducer.java#L159

Users could easily set the hotrod properties in the configMap and then mount them on a container/pod.

Is it feasible/makes sense?

@mswiderski
Copy link
Contributor

@wburns would you mind to have a look on the suggestion here?

@wburns
Copy link
Member

wburns commented Oct 7, 2019

Currently the hotrod-client.properties file is read at compile time only at https://github.com/quarkusio/quarkus/blob/master/extensions/infinispan-client/deployment/src/main/java/io/quarkus/infinispan/client/deployment/InfinispanClientProcessor.java#L92. I think leaving this as it is probably good for a set of "default" values that are burned into the native image.

We could then add a runtime configuration option that overrides these values and applies the values at https://github.com/quarkusio/quarkus/blob/master/extensions/infinispan-client/runtime/src/main/java/io/quarkus/infinispan/client/runtime/InfinispanClientProducer.java#L65 before passing the properties further down. I don't see any issues with doing that.

@ricardozanini
Copy link
Author

Hi @wburns thanks for your reply!

We could then add a runtime configuration option that overrides these values

That's what we need. So reading those properties from an external hotrod file is the approach that we can take? Something like this:

https://github.com/kiegroup/kogito-runtimes/pull/176/files#diff-aae8338d8564c59f83a5aa8615950b5fR97

@wburns
Copy link
Member

wburns commented Oct 7, 2019

It seems fine to me, I am not sure what the stance is from the Quarkus guys though. @gsmet have an opinion?

@mswiderski
Copy link
Contributor

@gsmet any feedback? would like to tackle this by end of the week so it can be included for the next release

@wburns
Copy link
Member

wburns commented Oct 9, 2019

I would say just go ahead :)

@mswiderski
Copy link
Contributor

pull request created #4502

@ricardozanini
Copy link
Author

@wburns having @mswiderski PR merged, I understand that we can close this issue.

@gsmet
Copy link
Member

gsmet commented Nov 1, 2019

Oh, looks like I missed a couple of notifications a while ago, sorry about that :).

@gsmet gsmet added this to the 0.26.0 milestone Nov 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants