Reputation: 9269
We have a Keycloak 15.1.1 deployment on Kubernetes with multiple replicas with the AWS RDS Postgres 13 Database backend. I did not find any upgrade guide or experience of other people regarding this setup or even with Kubernetes with Postgres using PVC upgrading Keycloak with multiple major version changes.
Does anyone have any experience with the Keycloak upgrade on Kubernetes?
I went through the change log and was able to run Keycloak locally using docker-compose only in HTTP mode as we terminate SSL at the reverse proxy.
From upgrade instructions from Keycloak documentation is the following strategy is the right one without losing any data
Update the docker image with a new image running only in HTTP mode in our helm charts
Initially start the new deployment with only a single replica so that the database schema changes are applied
kc.sh start --spi-connections-jpa-default-migration-strategy=update
When I tried to upgrade my local deployment with the above command, Keycloak was not accessible until the next restart.
Restart the deployment with more replicas with command
kc.sh start --optimized
Upvotes: 3
Views: 2175
Reputation: 9269
I got the answer from the Keycloak GitHub support forums https://github.com/keycloak/keycloak/discussions/14682.
Running kc.sh start automatically upgrades the DB on first install, and the first container running this command automatically locks the DB until migration is complete. So its not required to change my helm chart.
Upvotes: 1