-
Notifications
You must be signed in to change notification settings - Fork 44
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
[BUG] Keycloak state (users) are not persisted on atlas-server stop/start #123
Comments
There is an |
We can also provide documentation that shows how to connect the keycloak server to an external database to allow persistence of users through restarts. |
@kyledef I was considering actually using a db like in CI as the solution if we are okay with having another container up on atlas server start. |
I'm suggesting to provide instruction for the end user to be able to add their own database container to the system. I don't think the overhead of an additional container makes sense for people who don't need the authentication. For now it could placed in the documentation as "enabling authentication" or "adding users". Let's avoid adding a new container to the atlas installer. |
I second the approach from @kyledef to remove the number of moving parts. |
@amackillop any thoughts on an expected timeline for this task? Do you have any huge roadblocks? |
No roadblocks. Just trying to decide on a path. I like the idea of reducing moving parts for non auth users but It would be nice to go all the way with this ie don't spin up keycloak at all. But with auth, we can spin up both containers if it is easy to make that delineation work. I don't particularly like the UX of having to do your own db setup. Another solution would be to utilize the keycloak API to add users via the CLI. Then the export script could be run automatically and keep things persistent. That is building on top of a hack though, I'd like to get rid of the import thing all together. On that note though, CLI for auth may still be a nice UX and can abstract away keycloak all together from the user if we can cover the necessary actions that a user would do on the keycloak admin page. |
Anyway I think I can take care of this in 2 weeks. @mohammedri Branch: https://github.com/dessa-oss/atlas/tree/amackillop/keycloak-persist-users |
I landed on a simple solution that ends up reducing complexity. Don't know why I didn't think of it before. Instead of using the atlas.json file to load the initial state of keycloak, I just mounted the embedded H2 database directory to a place in foundations home. If we ship atlas with some initial db files then it will initialize correctly and persist users for free. We also get to remove all the docker code plus the configuration and simply use the base Keycloak explicitly advises against using the embeded db "in production" due to performance issues but I don't think that is an issue for us at this time. |
Work in progress PR: #135 |
Closed by: #161 |
Merged. We went with mounting the H2 DB files in foundations home. |
Any info regarding the release of the next build which includes #161? |
Describe the bug
Any user created in keycloak admin will not be persisted if keycloak is restarted. Currently the state is read from
atlas.json
but in ideal setup we would persist any change that can then be used when services is started up again.To Reproduce
Steps to reproduce the behavior:
atlas-server start -p
atlas-server stop
atlas-server start -p
Expected behavior
Internally the keycloak container uses an internal h2 database, but we can also persist to another container.
The text was updated successfully, but these errors were encountered: