Using mixed PostgreSQL and Infinispan storage
The deployment of Keycloak can use a PostgreSQL database and an external infinispan Instance when deployed with the new map storage.
This mixed setup mirrors what the Legacy store: auth sessions, user sessions, login failures, and single use objects are stored via the Hot Rod protocol in an Infinispan instance, all other entities are stored via JPA in a PostgreSQL instance. All stores use the new map store implementation.
Enabling Infinispan
Using an external Infinispan instance is available in Keycloak’s new HotRod map storage.
It can be enabled via the following settings in the .env
file in the provision/kubernetes
folder:
KC_DATABASE=postgres+infinispan
KC_STORAGE=jpa+hotrod
See Customizing the deployment for a list of all configuration options.
After every change, re-run the task
command to apply the changes to the minikube instance.
Task will trigger the necessary scripts and will use the minimal steps to update the minikube.
Running rebuild.sh
is not required: It will destroy the complete instance and will take a lot longer to complete.
The deployment adds a new Infinispan pod to the minikube setup and removes all other storage pods that are no longer necessary. Every time the pod is restarted, the database is cleared.