Cross Datacenter Keycloak clusters on 2 Kubernetes clusters

Hi there,

I’ve deployed my Keycloak cluster on a K8s Cluster in mode Standalone Clustered.

Every Keycloak pod already have Wildfly CLI script on the pod startup for Infinispan distributed cache under the covers for saving data related to the current authentication session and user session.
The following script is mounted on the container’s /opt/jboss/startup-scripts/ folder:

embed-server --server-config=standalone-ha.xml --std-out=echo
batch

echo * Setting CACHE_OWNERS to "${env.CACHE_OWNERS}" in all cache-containers

/subsystem=infinispan/cache-container=keycloak/distributed-cache=sessions:write-attribute(name=owners, value=${env.CACHE_OWNERS:1})
/subsystem=infinispan/cache-container=keycloak/distributed-cache=authenticationSessions:write-attribute(name=owners, value=${env.CACHE_OWNERS:1})
/subsystem=infinispan/cache-container=keycloak/distributed-cache=actionTokens:write-attribute(name=owners, value=${env.CACHE_OWNERS:1})
/subsystem=infinispan/cache-container=keycloak/distributed-cache=offlineSessions:write-attribute(name=owners, value=${env.CACHE_OWNERS:1})
/subsystem=infinispan/cache-container=keycloak/distributed-cache=clientSessions:write-attribute(name=owners, value=${env.CACHE_OWNERS:1})
/subsystem=infinispan/cache-container=keycloak/distributed-cache=offlineClientSessions:write-attribute(name=owners, value=${env.CACHE_OWNERS:1})
/subsystem=infinispan/cache-container=keycloak/distributed-cache=loginFailures:write-attribute(name=owners, value=${env.CACHE_OWNERS:1})

run-batch
stop-embedded-server

In order to ensure the HA, I deployed an other new K8s cluster and deploy a new Keycloak cluster on it.

Do you have any recommend for deploying the Infinispan cluster on each K8s cluster?

Thank you.

Not use if that helps, but maybe you can get any insight from this helm chart: helm-charts/charts/keycloak at master · codecentric/helm-charts · GitHub