-
Notifications
You must be signed in to change notification settings - Fork 19
bitnamilegacy-to-official-keycloak #1193
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
Draft
sandeepbh5
wants to merge
29
commits into
main
Choose a base branch
from
bitnamilegacy-to-official-keycloak-02dec
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
+2,305
−1,386
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
f03d740 to
fb61c83
Compare
- Migrate from Bitnami Keycloak (26.1.3) to official Keycloak operator (26.5.0) - Add new keycloak-operator application with Kustomize patches for security compliance - Update platform-keycloak to use official Keycloak Operator and cloudnative-pg - Update keycloak-tenant-controller configuration to use new bootstrap credentials - Add Keycloak admin password configuration to multiple infrastructure components - Update trivy.yaml to suppress false positives in Keycloak operator permissions - Enable keycloak-operator in platform profile configuration - Fix tools scripts to use admin-cli instead of system-client for authentication - Update GitHub workflows and CI configurations for Keycloak upgrade compatibility This migration improves: - Native Keycloak operator for better Kubernetes integration - Upgraded Keycloak version to 26.5.0 with enhanced security features - Official support for cloudnative-pg PostgreSQL operator - Better secret management with native bootstrap password support
…spec - Simplified bootstrapAdmin configuration to only use 'user.secret: platform-keycloak' - Operator automatically reads 'username' and 'password' keys from secret per CRD spec - Updated secret key references from 'admin-password' to 'password' for consistency - Added clarifying comments about CRD-compliant bootstrap admin configuration This aligns with Keycloak operator CRD v2alpha1 spec which expects: - bootstrapAdmin.user.secret points to secret containing 'username' and 'password' keys - KC_BOOTSTRAP_ADMIN_USERNAME and KC_BOOTSTRAP_ADMIN_PASSWORD env vars for pod initialization
…-force protection - Enable useM2MToken: true to use Vault-stored M2M credentials - Consolidate app-orch-tenant-controller.tpl with complete configProvisioner config - Remove unnecessary keycloak admin fields that were causing continuous auth failures - Configure M2M client to use edge-manager-m2m-client credentials - Temporary: disable bruteForceProtected in Keycloak for fresh deployment validation - Will re-enable brute-force after bootstrap auto-creates edge-manager-m2m-client-secret
4993be3 to
85c272d
Compare
…on of special chars The KEYCLOAK_PASSWORD variable can contain special characters like $ which are interpreted by the shell when using double quotes. This causes the password to be truncated at the first $ character. Using single quotes prevents shell expansion while still allowing make variable substitution, ensuring the full password is passed to kubectl correctly.
…ands Use single quotes around variable values in --from-literal parameters to prevent shell interpretation of special characters like $ in passwords and tokens. This applies the same fix as commit e9ab49e (Keycloak password fix) to all other secret creation commands across: - on-prem-installers/cmd/onprem-gitea/after-install.sh - on-prem-installers/cmd/onprem-gitea/after-upgrade.sh - pod-configs/utils/aurora/reset-db-password.sh These scripts can pass passwords/tokens with special characters (generated by random generation functions), which would be corrupted if the shell interprets $ as the start of a variable reference. Single quotes prevent this interpretation while still allowing variable substitution by kubectl.
…sword CRITICAL: This is the ROOT CAUSE of the password corruption issue! The run_keycloak_admin_bootstrap() function was passing the admin password through bash -c with double-quote expansion: $(echo $KC_BOOTSTRAP_ADMIN_PASSWORD) This causes shell variable expansion when the password contains $ characters: - Example password: D$lGszY2GQo7tf - Bash interprets $l as a variable start - Password gets truncated/corrupted Changed from: 'export KC_BOOTSTRAP_ADMIN_PASSWORD="$(echo $KC_BOOTSTRAP_ADMIN_PASSWORD)"; ...' To: 'export KC_BOOTSTRAP_ADMIN_PASSWORD=$KC_BOOTSTRAP_ADMIN_PASSWORD; ...' The new syntax prevents bash from re-interpreting the password since it's inside a single-quoted string context within the exec command. The password is passed as an environment variable and not re-evaluated.
…ean up environment variable configuration
- Remove M2M secrets extractor Job, RBAC, and ServiceAccount from platform-keycloak.tpl - Job is now managed by keycloak-instance Helm chart (m2m-secrets-extractor-job.yaml) - Chart is sourced directly in platform-keycloak.yaml ArgoCD application - Cleaner separation of concerns: keycloak-instance chart owns Job lifecycle - Reduces duplication and improves maintainability
…k-instance chart - Change chart source from common/charts/keycloak-instance to orch-utils GitHub repository - Point to orch-util-changes-for-keycloak-update-v2 branch - Includes new M2M secrets extractor Job template with RBAC configuration
- Updated .golangci.yml to use correct linter names for golang 1.50.1: * Changed err113 to goerr113 * Changed mnd to gomnd * Removed unsupported linters: canonicalheader, fatcontext, intrange, musttag, perfsprint, tagalign - Updated go.mod to require Go 1.24.4 (matches .tool-versions) - Ran gofmt to fix formatting issues in mage/deploy.go - Ran go mod tidy to update dependencies
…atibility and re-add disabled linters - golang 1.24.9 is not supported by golangci-lint 1.64.7 (only supports <=1.23.x) - Re-add 8 disabled linters: canonicalheader, err113, fatcontext, intrange, mnd, musttag, perfsprint, tagalign - These linters were disabled because violations exist in unrelated code outside keycloak migration PR scope - Verified linting passes locally with these changes
Go 1.24.9 is incompatible with golangci-lint 1.64.7. Use Go 1.24.4 which is known to work. Also restore .golangci.yml configuration from main branch to match known good state.
- Remove serviceAccount field from app-orch-catalog.yaml configProvisioner - Update copy-keycloak-admin-to-infra.yaml to map password source key while maintaining admin-password target key for orch-infra services
…s | for oxm and onPrem failure
…timeout to 15 minutes
…proved ordering and reliability
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Any Newly Introduced Dependencies
How Has This Been Tested?
Coder
Checklist: