Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: upgrade keycloak to 21 and support initial realm import #3624

Merged
merged 22 commits into from
Feb 7, 2024

Conversation

shreddedbacon
Copy link
Member

@shreddedbacon shreddedbacon commented Dec 14, 2023

General Checklist

  • Affected Issues have been mentioned in the Closing issues section
  • Documentation has been written/updated
  • PR title is ready for inclusion in changelog

Database Migrations

  • If your PR contains a database migation, it MUST be the latest in date order alphabetically

This updates Keycloak to version 21, which is based on quarkus. This gets us into a better position to move to Keycloak version 23.

It also changes the startup of Keycloak to use a realm import script that gets Keycloak to a point of the latest changes. This is only called if the lagoon realm does not currently exist. This way a fresh install of Lagoon will be up and running much quicker than having to perform all the migrations from the dawn of time.

This significantly speeds up Keycloak startup time.

This currently uses a realm export of the changes done in what would be Lagoon 2.17.0, but may need to be updated periodically if there are any changes. As such, whatever version this would be merged into of Lagoon would need a release note to say that users cannot upgrade to this version, and they must upgrade to the version prior before they can update to the version this is released in. As the whole point of this is to eliminate the dawn of time migrations that take place, as these run even on existing installations just in a no-op form, but still takes time before it gets to the more current migrations.

Future migrations can be added to this though that perform migrations the same way older migrations took place, but it would mean that it could get to the same position again where the migrations take too long.

I propose that every migration also gets added/updated into to the realm import. This way the initial realm import on brand new installs will always be up to date, and the migrations can periodically be cleaned up using the same method of you need to update to version X before you update to version Y. We should also track these upgrade paths better.

@shreddedbacon shreddedbacon added this to the 2.18.0 milestone Jan 17, 2024
@shreddedbacon shreddedbacon changed the title wip: upgrade keycloak to 21 and support initial realm import refactor: upgrade keycloak to 21 and support initial realm import Jan 24, 2024
@rocketeerbkw
Copy link
Member

Discussed in meetings, good to merge and let us test in our clusters to ensure we got the right env var changes for quarkus 👍

@tobybellwood tobybellwood merged commit d0983ad into main Feb 7, 2024
1 check passed
@shreddedbacon shreddedbacon deleted the keycloak-21-realm-import branch February 7, 2024 05:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants