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

Skip to content

Conversation

@Pepo48
Copy link
Contributor

@Pepo48 Pepo48 commented Jul 3, 2024

Closes: #30011

Signed-off-by: Peter Zaoral [email protected]

@Pepo48 Pepo48 force-pushed the issue-30011 branch 3 times, most recently from ca95f75 to 4858789 Compare July 4, 2024 13:05
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 draft. I think it's a good start.

@Pepo48 Pepo48 force-pushed the issue-30011 branch 3 times, most recently from 4c9dc9e to 0c9a072 Compare July 9, 2024 22:17

This command creates a temporary admin user with the username `tmpadm` and the password `tmpadmpass`.

NOTE: The command can be executed even before the {project_name} first ever start. However, it leaves the {project_name} server in a state, where the temporary admin account will be the only account that exists in the master realm - the default admin will not be created. If the intention is to recover a lost admin access, the default admin should exist within the master realm prior to the command execution. Also, it is strongly recommended to use the dedicated command with the very sane options that the {project_name} server is started with (e.g. `db` options).
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It'd be also good to add a section for bootstrapping at server startup. Explaining the difference from the dedicated command (that on startup master realm must on exist, making the dedicated command the only suitable option for recovery).

I tried to address this one via a note.
@shawkins wdyt?

@Pepo48 Pepo48 requested a review from shawkins July 9, 2024 22:26
@Pepo48
Copy link
Contributor Author

Pepo48 commented Jul 9, 2024

I tried to incorporate every suggestion mentioned above. For now the changes are in a separate commit in order to make it easier to see the differences. I will do the squash later.

cc: @shawkins

Edit: I also tried to adjust the punctuation, articles and wording.

@Pepo48 Pepo48 force-pushed the issue-30011 branch 6 times, most recently from b52cfef to 906a107 Compare July 14, 2024 07:35
@Pepo48 Pepo48 marked this pull request as ready for review July 14, 2024 07:35
@Pepo48 Pepo48 requested review from a team as code owners July 14, 2024 07:35
shawkins
shawkins previously approved these changes Jul 15, 2024
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.

I tried to incorporate every suggestion mentioned above. For now the changes are in a separate commit in order to make it easier to see the differences. I will do the squash later.

cc: @shawkins

Edit: I also tried to adjust the punctuation, articles and wording.

Thanks @Pepo48 it looks good. Just a conflict to clear up and it should be set.

@Pepo48
Copy link
Contributor Author

Pepo48 commented Jul 16, 2024

Just a conflict to clear up and it should be set.

@shawkins thanks for the review. The conflict happened in the release notes - I merged both of our inputs together into one section.

@shawkins shawkins requested review from shawkins and vmuzikar July 16, 2024 13:41
shawkins
shawkins previously approved these changes Jul 16, 2024
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.

Just a conflict to clear up and it should be set.

@shawkins thanks for the review. The conflict happened in the release notes - I merged both of our inputs together into one section.

Looks good. Do you want to wait for @vmuzikar to also review?


This command creates a temporary admin user with the username `tmpadm` and the password `tmpadmpass`.

NOTE: The command can be executed even before the first-ever start of {project_name}. However, this will leave the {project_name} server in a state where the temporary admin account is the only account that exists in the master realm and the default admin will not be created. The initial admin creation happens only when the master realm is created. If the intention is to recover lost admin access, the default admin must exist in the master realm prior to executing the command (see <@links.server id="configuration" anchor="create-initial-admin"/>). Additionally, it is strongly recommended to use the dedicated command with the same options that the {project_name} server is started with (e.g., `db` options).
Copy link
Contributor

Choose a reason for hiding this comment

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

IMHO the db options would not only be "strongly recommended", but "required" as it would otherwise not write to the correct database and it will not work.

At the same time I am not sure if all of the options I use on the start command will also work on the boostrap commands (like: setting a HTTP port).

Copy link
Contributor

@shawkins shawkins Jul 17, 2024

Choose a reason for hiding this comment

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

This is a somewhat confusing area in general for us #29200 - we do some configuration exclusions for the CLI, but those same options will still work via the other config sources (the operator effectively uses this for export because almost everything is set via an env variable). Only a handful of options have hard-coded overrides when running a non-server command.

Copy link
Contributor

Choose a reason for hiding this comment

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

I tried to clarify the cases with #29200 (comment) - as there are potentially 3 different ways users could be invoking non-server commands which have some nuance that we trying to address here quickly with this recommendation.

@ahus1
Copy link
Contributor

ahus1 commented Jul 17, 2024

@Pepo48 - I pushed one commit to make the external link check pass. I also found that anchors in the IDs don't work, so I updated the Freemarker makros to support it. It is already part of the scaling guide, but not yet in main.

If you consider this documentation ready-to-be-merged, please ask Andrew Munro for a review from the technical writer's perspective to make sure the wording aligns with all the other docs.

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 updates. Nice work! Added some comments.

@vmuzikar
Copy link
Contributor

@Pepo48 Could you also please address this comment in this PR since #30711 was merged sooner than this?

@Pepo48 Pepo48 force-pushed the issue-30011 branch 2 times, most recently from 5be0072 to b865903 Compare July 24, 2024 17:24
@Pepo48
Copy link
Contributor Author

Pepo48 commented Jul 24, 2024

@Pepo48 Could you also please address this comment in this PR since #30711 was merged sooner than this?

Addressed by adding a new section with the link to the operator's advanced configuration.

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 another update. Added some last thoughts, mostly nitpics.

@Pepo48 Pepo48 force-pushed the issue-30011 branch 3 times, most recently from b22291c to 3e74501 Compare July 29, 2024 08:27
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 latest changes. Overall LGTM, added some last minor comments.

@ahus1 @shawkins @mhajas Do you want to re-review as well?

I'd like to merge this rather sooner than later. Not sure we need to wait for a review from @andymunro (as he's quite busy). We could incorporate his review changes as a follow up. WDYT?


If a master realm has already been created for you cluster, then the spec.boostrapAdmin is effectively ignored. If you need to create a recovery admin account, then you'll need to run the CLI command against a Pod directly.

For more information on how to bootstrap a temporary admin user or service account and recover lost admin access, refer to the link:{bootstrapadminrecovery_link}[{bootstrapadminrecovery_name}] guide.
Copy link
Contributor

Choose a reason for hiding this comment

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

This does not seem to render correctly?
image

Copy link
Contributor Author

@Pepo48 Pepo48 Jul 29, 2024

Choose a reason for hiding this comment

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

Some of these are not rendered for me when building the docs locally, yet they're used and seems to work fine when deployed. What's the general approach here? Should we use a hard-coded links or should we alway try to use variables and link anchors, especially when cross-referencing.

Am I actually allowed to define and use new document attributes for this specific case?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure. Possibly @ahus1 has some input?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess for the guide itself I can replace it with <@links.server id="bootstrap-admin-recovery"/>. But what about the release notes then?

Copy link
Contributor

Choose a reason for hiding this comment

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

Release notes seem to work fine for my local build.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For me as well. The question is whether it's fine to use it that way.

Copy link
Contributor

Choose a reason for hiding this comment

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

For me as well. The question is whether it's fine to use it that way.

For release note and upgrading guide, sure from my PoV. For Operator guide, I'm not sure – locally it doesn't work.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@vmuzikar are the rest of the links in the operator's advanced configuration guide rendered correctly for your local build?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, other links render fine for me.

@mhajas
Copy link
Contributor

mhajas commented Jul 29, 2024

@vmuzikar, I went through the changes quickly and it looks good. Still, I am not 100% confident to approve so I will leave it for the others to add final approvals. If you would like me to have a proper look let me know.

Pepo48 and others added 3 commits July 29, 2024 18:23
Closes: keycloak#30011

Co-authored-by: Alexander Schwartz <[email protected]>
Signed-off-by: Peter Zaoral <[email protected]>
Co-authored-by: Václav Muzikář <[email protected]>
Signed-off-by: Peter Zaoral <[email protected]>
Signed-off-by: Peter Zaoral <[email protected]>
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 After the latest changes, LGTM! Thank you!

@shawkins @ahus1 Do you want to review as well?

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.

LGTM, thank you @Pepo48

@ahus1
Copy link
Contributor

ahus1 commented Jul 30, 2024

@vmuzikar - no further comments from me. IMHO this is really a big change, and people will need to adjust. For example on the Keycloak Benchmark Project, we had the KEYCLOAK_ADMIN/KEYCLOAK_ADMIN_PASSWORD env variables set, and now the Operator created a different admin account. Only once I put my env variables into KC_BOOTSTRAP_ADMIN_USERNAME/KC_BOOTSTRAP_ADMIN_PASSWORD it worked as before. Yes, I know this is non-standard, still people might fall into similar traps they have built for themselves in the past.

Please reach out to the community to try this out (blog post, user mailing list, GitHub discussion) so the community can adjust.

@ahus1 ahus1 merged commit 07cfdac into keycloak:main Jul 30, 2024
@Pepo48 Pepo48 deleted the issue-30011 branch August 20, 2024 19:09
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 admin bootstrapping and recovery

5 participants