This type of deployment is for when you want to run Keycloak in a cluster across multiple data centers, most typically using data center sites that are in different geographic regions. When using this mode, each data center will have its own cluster of Keycloak servers.
Eache keycloak cluster connects to an infinispan server and this infinispan server is who sends data to the other cluster via a hotrod
connection to the others cluster's infinispan.
Keycloak will be deployed using the same configuration that for the high availability mode. With the addition of an init script and two more JAVA_OPTS
:
-Dremote.cache.host=infinispan-server-hotrod
-Dkeycloak.connectionsInfinispan.hotrodProtocolVersion=2.8
The first one sets the infinispan server address to where each keycloak will connect. The second one sets the protocol version.
Set the -Dremote.cache.host
parameter to point to the hot-rod port of your infinispan cluster.
⚠️ The Infinispan cluster shall be up and running prior booting up Keycloak.
Besides KeyCloak, an additional infinispan
cluster will be deployed:
- An "infinispan-server"
StatefulSet
with1
replica. - An "infinispan-headless"
headless service
for the StatefulSet. - An "infinispan-http"
Service
that exposes porttcp/8080
to access infinispan itself. - An "infinispan-server-hotrod"
Service
that exposes porttcp/11222
to access infinispan hot rod protocol. - An "infinispan"
ServiceAccount
withlist
andget
permissions on the namespace'spods
resource. This service account is needed in order to use theKUBE_PING
JGroups discovery method.
In the cloud-keycloak.xml
configuration file you can find the definition of the keycloaks caches.