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
allow to configure dns_record_type with a system property #776
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With a brief look this looks good to me. Allowed workflow to run now.
n.b. maybe a bit unfortunate that we didn't name these jgroups.dns.query
instead of duplicating the prefix like we do now jgroups.dns.dns_query
, but let's keep this consistent as 'jgroups.dns.' + field name.
Hmm... adding the system property should not be required, although it certainly works, so no objections. |
In other words, no change and no release should be required... |
IIUC well, no - the whole point is so that you do not have to edit the XML as that's way more convoluted in a container rather than adding a property (this PR) and then simply adding |
Christian is already using a system prop ( |
@rhusar well said. I fully agree.
I'm confused: that was the Keycloak 18 legacy configuration. Wait. Is there a way to set org.jgroups.protocols.dns.DNS_PING#dns_record_type without touching the XML? Just with a system property or environment variable? |
Yes, in the config (XML or programmatic):
Default is |
Ok, that's exactly the config I was struggeling with. I spent two days reading and experimenting – and couldn't even see this in the logs:
It might be caused by JGroups being integrated to Infinispan, and Infinispan being integrated in Keycloak. I've tried to find people who were successful with this. Could you spot, what's wrong here in my config?
It looks simple but with this config, I don't see any output from the org.jgroups.protocols.dns.DefaultDNSResolver and I've tried a lot of variants. What am I missing? |
You need to extend the <stack name="dns-ping" extends="kubernetes">
<dns.DNS_PING dns_record_type="SRV"/>
</stack> |
Finally, I've found the road blocker for my efforts: the distributed cache configuration in Keycloak is part of the build time configuration and not the run time configuration. After putting this cache configuration file
into the docker image, running kc.sh build, I could configure it with
at run time like for Keycloak 18 – and it works. This was the discussion that finally helped me. |
My setup is a set of Keycloak 18.0.2 clusters in an environment with nomad and consul. We're using DNS_PING with SRV records for a long time now and the JGroups setup is pretty simple:
When migrating this to Keycloak 23.0.7, I found that the dns_record_type separated with a comma is not supported anymore. With the documentation I found on the internet and discussions and issue in the JGroups, Infinispan, Keycloak github projects, I failed to get SRV records running with something straight-forward like this:
When looking at org.jgroups.protocols.dns.DNS_PING I found that only a tiny tweak is necessary to reduce all this down to
This works fine for me since some days.
@belaban I'd be really happy if you include this in an upcoming 5.2.x release