Keycloak 17 Container with DNS Ping Clustering


Does anyone have documentation on how to configure clustering for Keycloak 17 running in Docker container? I am specifically interested in using DNS ping. Previously in version 15 I was doing this:

docker run -d -p 8080:8080 \
    -e \

Thanks in advance.

JGroups discovery protocol was one of the things that changed quite a bit in the new distribution. See the new guide here: Keycloak - Server - Configuring distributed caches

If you end up needing to write your own Infinispan config file, there a discussion here about it. Even though JDBC_PING is discussed, you can use the same method for any custom configuration: Use of JDBC_PING with Keycloak 17 (Quarkus distro)

If you are trying to create the cluster on Kubernetes, the below properties will help you.


A headless Kubernetes service should be created pointing to the Keycloak pod set and its DNS name should be set as an environment variable by name ‘jgroups.dns.query’.

For example:

  • name: jgroups.dns.query
1 Like