Skip to content

feat(lifecycle-keycloak): refactor and unify db auth and support templateable secrets#51

Merged
binlab merged 1 commit intomainfrom
feat/unified-keycloak-db-auth
May 2, 2026
Merged

feat(lifecycle-keycloak): refactor and unify db auth and support templateable secrets#51
binlab merged 1 commit intomainfrom
feat/unified-keycloak-db-auth

Conversation

@binlab
Copy link
Copy Markdown
Contributor

@binlab binlab commented May 1, 2026

Description

Overview

This PR unifies the database authentication configuration for Keycloak, providing a consistent approach for both internal databases (umbrella chart) and external instances. The focus is on enabling flexible use of external secrets and removing legacy workarounds previously required by the operator.

Changes

  • charts/lifecycle-keycloak/templates/keycloak-instance.yaml:
    • Flow Unification: Introduced the db-username environment variable, allowing the database username to be passed consistently for both external and internal databases.
    • Template Support: The existingSecret field is now processed via tpl, enabling dynamic secret name generation.
    • Key Flexibility: Removed the hardcoded POSTGRES_USER_PASSWORD key. The password key is now retrieved from .Values.keycloakPostgres.auth.secretKeys.userPasswordKey, allowing the use of custom keys in existing secrets.
    • Workaround Removal: Removed usernameSecret as the database username is non-sensitive information and is now handled via environment variables.
  • charts/lifecycle-keycloak/templates/postgres-secret.yaml:
    • Removed POSTGRES_USERNAME from stringData as this parameter should no longer be stored within a secret.

Rationale

These changes make the chart more "cloud-native" and easier to integrate into complex infrastructures where database parameters may change dynamically or be provided by external secret management systems (e.g., External Secrets Operator).

@binlab binlab merged commit 16220dc into main May 2, 2026
1 check passed
@binlab binlab deleted the feat/unified-keycloak-db-auth branch May 2, 2026 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants