Keycloak 10.0.0 in a Kubernets Cluster - random issues

I have two problems with Keycloak in a Kubernets cluster. We have 6 pods from Keycloak witch have a connection to a DB cluster.

We configure for user custom attributes. We mapping a few attributes to the client (we write the Attributes in the Token and the InfoUser).
In the Database i can see the Attributes, but we get not in all Token-Request or UserInfo-Request this attribute´s. We get or get not this - randomly and i can’t say why. All Keycloaks use the same database.

The other thing is, that the Keycloak Pod has sometimes Failure like this:

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.sun.mail.util.SocketFetcher     
to method
WARNING: Please consider reporting this to the maintainers of com.sun.mail.util.SocketFetcher
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access 
WARNING: All illegal access operations will be denied in a future release


WARN [org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory] (ConnectionValidator)  
IJ030027: Destroying connection that is not valid, due to the following exception:  
org.mariadb.jdbc.MariaDbConnection@5ab3dd35: java.sql.SQLNonTransientConnectionException: 
(conn=8011472) unexpected end of stream, read 0 bytes from 4 (socket was closed by server)
at org.mariadb.jdbc//org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.get(

at org.mariadb.jdbc//org.mariadb.jdbc.MariaDbStatement.executeExceptionEpilogue(

Your Keycloak instances not only have to use the same DB (obviously!), but they also have to run in clustered mode. Do they build a cluster? Do they recognize each other?

Further information:
(besides JDBC_Ping, there’s also a KUBE_Ping available)


yes the Server use the same database, while i have only this database.

I follow the tut from to configure this cluster. I can add with rancher a new pod and can see in the logs that´s the server read the other nodes out from the database and sync the sessions, token´s and something else.

But now, I saw the mariadb errors and see that the pot´s restart often.

Was is the recommended option for Kubernets Cluster this Keycloak? JDBC_Ping or KUBE_Ping?

Thanks :slight_smile: