Skip to content

feat(lifecycle-keycloak): refactor secrets generation for GitOps/ArgoCD compatibility#46

Open
binlab wants to merge 1 commit intomainfrom
feat/refactor-lifecycle-keycloak-secrets
Open

feat(lifecycle-keycloak): refactor secrets generation for GitOps/ArgoCD compatibility#46
binlab wants to merge 1 commit intomainfrom
feat/refactor-lifecycle-keycloak-secrets

Conversation

@binlab
Copy link
Copy Markdown
Contributor

@binlab binlab commented Apr 21, 2026

Description

This PR refactors the generation of secrets within the lifecycle-keycloak Helm chart to ensure full compatibility with GitOps tools like ArgoCD. Previously, the use of randAlphaNum combined with Helm hooks (pre-install) and .Release.IsInstall conditions caused persistent issues where secrets were either pruned during synchronization or continually overwritten during each helm template evaluation by ArgoCD (resulting in OutOfSync states).

By introducing an idempotent approach (similar to Bitnami charts) via a new lifecycle-keycloak.getValueFromSecret helper, we now:

  1. Look up existing secret values deployed in the cluster and retain them, preventing unnecessary differences in ArgoCD.
  2. Remove .Release.IsInstall constraints, ensuring the secret manifests are consistently evaluated, rendered, and maintained across regular upgrades.
  3. Remove problematic helm.sh/hook annotations, allowing ArgoCD to manage these secrets correctly as standard, tracked resources.

Changes Made

  • Added lifecycle-keycloak.getValueFromSecret helper in _helpers.tpl to fetch existing secret values directly from the cluster state.
  • Refactored bootstrap-admin-secret.yaml, github-idp-secret.yaml, keycloak-idp-secrets.yaml, lifecycle-ui-secret.yaml, and postgres-secret.yaml to use the new helper and remove hooks/.Release.IsInstall.
  • Bumped chart version in Chart.yaml and README.md to 0.8.0 (minor bump due to significant GitOps refactoring).

Verification

  • Validated all updated templates format correctly with getValueFromSecret.
  • Confirmed that Helm hook annotations and strict install conditionals have been systematically replaced to provide standard state management compatibility.

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.

1 participant