I’ve a question regarding Keycloak and IaC approach:
We consider to use KC as our SSO solution, but we’ve met some difficulties with it. Our solution is hosted in kubernetes and all our infrastructure including settings is stored as code.
I’ve managed to get KC working in cluster mode in K8s. But there are problems with storing realm configuration. Initially I used realm export/import as approach to store configuration, it didn’t work well with KC 7.0 (for example roles assigned to clients doesn’t work after import). With upgrade to KC 8+ import stopped working at all (with exception: java.lang.RuntimeException: Script upload is disabled) which is confusing as I don’t upload any scripts.
And an idea that I’m missing something came to my mind.
So the question is: Are there any recommended approaches to store/restore/apply patches KC realm configuration?
The basic scenarios are:
- Start of a new environment for tests, etc. (KC realm should be completely restored)
- Apply configuration (apply patch) on running and configured KC realm: update of staging / live environment.
- Creating of the configuration patch/complete config when changes required.
And all of that with IaC