I am noticing authentication session syncing issue when multiple keycloaks (ver 20 quarkus) are running in a cluster. I could not find any official documentation or example on how-to set up a cluster. So far I have collected the followings env variables by doing google search.
What is “keycloak-headless” represent? Is it the keycloak cluster service name? Anyway, the ^ setup is not working. A pointer to how-to doc or some example will help.
Thank you @gsmith and @dasniko ! Yes, I have seen this and I picked up the 3 new env variables (mentioned above) from this article . But, not able to make it work in kubernetes.
Is this setup does not work when keyclok is running in dev mode (kc.sh start-dev)?
The value “keycloak” in below refers to what? Is it the STS (stateful-service) name that points to multiple keycloak pods keycloak-1, keycloak-2 ? command: start-dev -Djgroups.dns.query=keycloak
Disclaimer: I have not enough knowledge about K8s…
keycloak is the service name, under which the nodes are registered in the DNS. DNS_PING queries the DNS (hence the name) for all IPs which are registered under that name. With these IPs, the nodes can create a cluster.
Probably you have to start additional, so called “headless” services for getting it to work, but that’s something K8s specific… (see disclaimer)
keycloak-1 and keycloak-2 are the two hostnames of the nodes which are running, so that Nginx knows, where to spread the traffic to.
Note: My gist is a working example for a Docker Compose approach under Docker Swarm mode. Depending on your environment, you have to make adjustments which are not necessarily Keycloak related, but environment/infrastructure related!