-
Notifications
You must be signed in to change notification settings - Fork 27
feat: make Keycloak demo users configurable via createDemoUsers setting #100
base: main
Are you sure you want to change the base?
Conversation
- Demo users (alan, dennis, lynn, margaret, mary) are now only created when opencloud.createDemoUsers=true - This aligns with the OpenCloud createDemoUsers setting for consistency - Updated README to clarify that the setting affects both OpenCloud and Keycloak users - Default is false, so demo users are not created by default
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR makes Keycloak demo user creation configurable through the existing opencloud.createDemoUsers setting, ensuring consistent behavior between OpenCloud and Keycloak components. Previously, demo users were always created in Keycloak regardless of this setting.
- Adds conditional template logic to control demo user creation in Keycloak realm configuration
- Updates documentation to clarify that the setting affects both OpenCloud and Keycloak users
- Aligns Helm chart behavior with the opencloud-compose approach for consistency
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| charts/opencloud/files/keycloak/opencloud-realm.json.gotmpl | Added conditional templating to include/exclude demo users based on createDemoUsers setting |
| charts/opencloud/README.md | Updated parameter description to clarify scope includes both OpenCloud and Keycloak users |
- Added detailed instructions for creating production users in Keycloak - Listed available OpenCloud roles and their purposes - Added security warning about demo users with hardcoded passwords - Clarified that demo users should never be used in production
|
Thanks for the review @copilot! The current implementation is intentional and produces valid JSON in both cases:
The "admin" user here is not the Keycloak system admin (which is in the master realm), but a demo user in the openCloud realm. As documented in the updated README, this demo user has a hardcoded password and should not be used in production. For production use, administrators should:
This aligns with the opencloud-compose approach where the production realm has an empty users array. |
- Changed opencloud.createDemoUsers to opencloud.demoUsers.enabled - Follows consistent pattern with other enable/disable settings - Updates all references in templates, values.yaml, and documentation - Breaking change acceptable as we're in 0.x.x version
Summary
This PR makes the Keycloak demo users configurable through the
opencloud.demoUsers.enabledsetting, providing consistency across the stack and alignment with the opencloud-compose approach.Changes
charts/opencloud/files/keycloak/opencloud-realm.json.gotmplto conditionally include demo usersdemoUsers.enabledaffects both OpenCloud and Keycloak usersopencloud.createDemoUserstoopencloud.demoUsers.enabledfor consistency with other enable/disable patternsDetails
Current behavior
Demo users (alan, dennis, lynn, margaret, mary) are always created in Keycloak, regardless of the OpenCloud setting.
New behavior
opencloud.demoUsers.enabled: false(default): No demo users in Keycloakopencloud.demoUsers.enabled: true: Demo users are created in KeycloakThis aligns the Keycloak behavior with the OpenCloud setting for consistency.
Configuration Change
The configuration has been renamed for better consistency:
Alignment with opencloud-compose
The opencloud-compose repository already provides this flexibility through separate realm files:
opencloud-realm.dist.json- Production realm without demo usersopencloud-realm-autoprovisioning.dist.json- Development realm with demo usersThis PR brings the same capability to the Helm chart, but using a single template file with conditional logic instead of maintaining two separate files. This approach:
Testing
Tested locally with helm template:
Related Issues
Discovered during Rackspace deployment where demo users were unexpectedly present in production setup.
Breaking Change Notice
This PR includes a breaking change:
opencloud.createDemoUsershas been renamed toopencloud.demoUsers.enabled. Since we're in 0.x.x version, breaking changes are acceptable per semver conventions.Checklist
helm lint