Configure distributed cache with keycloak 18


I have been working on migrating keycloak wildfly to keycloak quarkus in a kubernetes environment.
Currently I’m looking at configuring distributed caches with kubernetes/openshift/rancher.
In particular I’ve set the environment variable KC_CACHE_STACK to kubernetes, and I added the command line argument “-Djgroups.dns.query=headless-service” as explained in the documentation and so far so good.
Now I’d like to know if this configuration will work with openshift/rancher, does anyone have tested these configurations ?

I’ve been searching on internet, found some interesting posts, but I couldn’t find information pertaining to the problem (in particular I only have a kubernetes cluster to test).

Tested with rancher. Works fine.

1 Like

Hi, thank you very much for your confirmation.


Hi, anyone can confirm that the configuration works with openshift ?

Hello I am new with k8s and keycloak. Could you please share how can I get the headless-service-FQDN on k8s?

Answer is not trivial and is worth a global question.

If you create a headless service called foo on namespace bar, the FQDN would be

1 Like