Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Pepo48
Copy link
Contributor

@Pepo48 Pepo48 commented Mar 20, 2025

Closes: #35901

Copy link
Contributor

@shawkins shawkins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Pepo48 this looks good. Just some additional thoughts.

* When using the default {project_name} image, the Operator by default uses a matching image of the corresponding {project_name} version, resulting in *unintended {project_name} upgrades* when the Operator is upgraded.
* Even when using custom images, major Operator upgrades can introduce compatibility issues with your existing Keycloak CR configuration.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally it's only on major releases. There could be a word of caution on minor releases as well because of operator logic changes.

*Potential risks:*
* Unexpected downtime during automatic upgrades
* Database schema migrations that cannot be easily rolled back
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In particular based upon recent issues, you cannot even reliably simply roll back micro version changes - that is once 26.x.n is applied, if you want to go back to 26.x.(n -1) then you need to restore from a database snapshot, rather than just going back 1 micro in operator / keycloak versions.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could possibly reword it as:

Suggested change
* Database schema migrations that cannot be easily rolled back
* No option to downgrade to the previous {project_name} version due to database schema migrations

@Pepo48 @shawkins WDYT?

1. Schedule maintenance windows for upgrades
2. Test upgrades in a non-production environment first
3. Prepare rollback plans in case of issues
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May need to elaborate here - or at least link to the general recommendations on changing versions, which mention backing up the database.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do not have specific backup instructions in the upgrading guide. Still, we might improve the wording, something like:

Suggested change
3. Prepare rollback plans in case of issues
3. Back up the database to allow downgrading to the previous {project_version} in case of issues

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shawkins do you have specific section/guide to link here in mind?

Copy link
Contributor

@vmuzikar vmuzikar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Pepo48 Thank you for the PR! Added some comments.

*Potential risks:*
* Unexpected downtime during automatic upgrades
* Database schema migrations that cannot be easily rolled back
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could possibly reword it as:

Suggested change
* Database schema migrations that cannot be easily rolled back
* No option to downgrade to the previous {project_name} version due to database schema migrations

@Pepo48 @shawkins WDYT?

1. Schedule maintenance windows for upgrades
2. Test upgrades in a non-production environment first
3. Prepare rollback plans in case of issues
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do not have specific backup instructions in the upgrading guide. Still, we might improve the wording, something like:

Suggested change
3. Prepare rollback plans in case of issues
3. Back up the database to allow downgrading to the previous {project_version} in case of issues

@Pepo48 Pepo48 marked this pull request as ready for review April 1, 2025 11:11
@Pepo48 Pepo48 requested review from a team as code owners April 1, 2025 11:11
@Pepo48
Copy link
Contributor Author

Pepo48 commented Apr 1, 2025

@shawkins @vmuzikar guys, thanks for the review, hopefully I addressed all the suggestions. I made it in a separate commit for an easier comparison.

The PR is now out of the draft state.

@Pepo48 Pepo48 force-pushed the issue-35901 branch 2 times, most recently from 0ea1ef2 to 2317ca0 Compare April 9, 2025 14:50
Copy link
Contributor

@vmuzikar vmuzikar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Pepo48 Thanks for the update.

Added two last comments but mostly about a misspelled var.

Copy link
Contributor

@vmuzikar vmuzikar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks.

@shawkins Do you want to give it another look?

@shawkins
Copy link
Contributor

@shawkins Do you want to give it another look?

Looks good to me. It makes me wonder in general how this should be done - will we eventually need some mechanism for pre / post / rollback update hooks - something like additional images the user could specify in the CR where they could handle the database snapshot / restoration if needed.

@shawkins shawkins self-requested a review April 10, 2025 11:29
@vmuzikar vmuzikar merged commit 6d6f966 into keycloak:main Apr 10, 2025
54 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document how Keycloak is upgraded when Operator is upgraded via OLM

3 participants