We are trying to setup keycloak cluster with inbuilt infinispan HA enabled with k8 hosted on AWS. Somehow both DNS_PING and KUBE_PING works well in local setup but while deloying on AWS each node start it’s own infinispan cluster. Is there any specific setting needed for this to work in AWS? We do not want any aws specific settings as we have to deploy keycloak on onprem k8 cluster as well as aws k8 cluster. any lead would be appreciated.
If anyone facing issue with HA setup lands here while looking for solution, this is what worked for us:
- name: KC_CACHE_STACK
value: kubernetes
- name: JAVA_OPTS_APPEND
value: “-Djgroups.dns.query=..svc.cluster.local”
- name: JGROUPS_DISCOVERY_PROTOCOL
value: dns.DNS_PING
There is no need to set the JGROUPS_DISCOVERY_PROTOCOL explicitly. For DNS_PING you just need to set the KC_CACHE_STACK to kubernetes, DNS_PING is contained in the stack configuration.