Skip to content

Migrate Keycloak from Bitnami chart to Codecentric KeycloakX#520

Open
jlav wants to merge 13 commits into
mainfrom
jl/migrate-keycloakx
Open

Migrate Keycloak from Bitnami chart to Codecentric KeycloakX#520
jlav wants to merge 13 commits into
mainfrom
jl/migrate-keycloakx

Conversation

@jlav
Copy link
Copy Markdown
Contributor

@jlav jlav commented Apr 6, 2026

Description

Migrate the Keycloak Helm chart dependency from Bitnami to the Codecentric KeycloakX chart, using the official quay.io/keycloak/keycloak:26.5.5 image.

Why: Bitnami has changed their licensing model. Their charts and images now require a paid subscription, and only the latest tag is available for development purposes. We are currently using legacy versions of their images (bitnamilegacy/keycloak). This migration moves us to the official upstream Keycloak image and a community-maintained chart that doesn't have these licensing restrictions.

Helm Chart Checklist

  • I have updated the version field in Chart.yaml for each modified chart
  • I have tested the chart upgrade path from the previous version
  • I have verified backwards compatibility with existing values.yaml configurations
  • I have updated the chart's README.md if there are any breaking changes or new required values

Test Results

Fresh install on Replicated embedded cluster (instance-2) with external PostgreSQL — PASS.

Home screen:
home-screen

Test conversation:
test-conversation

Additional Notes

jlav added 13 commits April 3, 2026 17:31
Replace the deprecated Bitnami Keycloak Helm subchart (v24.7.5,
bitnamilegacy/keycloak) with the Codecentric KeycloakX chart (v7.1.9)
using the official quay.io/keycloak/keycloak:26.5.5 image.

Key changes:
- Use alias: keycloak in Chart.yaml to preserve .Values.keycloak.* paths
- Restructure values from Bitnami format (externalDatabase, extraEnvVars,
  auth) to KeycloakX format (database, extraEnv, KEYCLOAK_ADMIN env var)
- Replace custom wait-for-db init container with built-in dbchecker
- Update ingress from Bitnami hostname/secrets to standard rules/tls
- Update service URL from http://keycloak to http://keycloak-http
- Update all Replicated sections (proxy, external_postgres, local registry)
- Remove keycloakConfigCli and embedded PostgreSQL subchart references

Migration note: existing StatefulSet must be deleted before upgrade
(kubectl delete statefulset keycloak --cascade=orphan) due to selector
label changes.
The codecentric KeycloakX chart already renders these from proxy.mode
and http config values. Including them in extraEnv caused a StatefulSet
patch failure due to duplicate env var keys.
The busybox image used by the dbchecker init container fails to pull
through the Replicated image proxy with a 400 error. Disable it since
the external RDS instance is already available before Keycloak starts,
and Keycloak has its own DB connectivity retry logic.
Use docker.io/library/busybox (the correct official image namespace)
instead of docker.io/busybox, which caused a 400 error from the
Replicated image proxy when pulling the dbchecker init container image.
docker.io/library/busybox (official Docker Hub library image) cannot be
pulled through the Replicated image proxy. Use bitnamilegacy/os-shell
instead — it is already proxied and includes netcat-openbsd (nc),
which the dbchecker script requires.
Disable the codecentric chart's built-in dbchecker (which requires
busybox) and use extraInitContainers with the same pg_isready pattern
already used by the openhands init containers. Uses the already-proxied
bitnamilegacy/postgresql image.
The Replicated image proxy requires index.docker.io (not docker.io)
for Docker Hub images. Use index.docker.io/library/busybox:1.37 for
the keycloak dbchecker init container.
The keycloak pod needs the Replicated pull secret to authenticate
with the images.r9.all-hands.dev proxy. Also drop the library/ prefix
from the busybox image path as it may not be needed for the proxy.
busybox is not in the Replicated proxy's allowed image set. Use
bitnamilegacy/os-shell instead — it's already proxied for clickhouse
volume permissions and includes netcat (nc) for the DB readiness check.
…secret

Docker Hub library images require the /library/ prefix when specifying
a registry hostname through the Replicated proxy. The previous attempt
omitted it. Tested on the cluster: docker.io/library/busybox:1.37
pulls successfully with the imagePullSecret.
The official keycloak image entrypoint (kc.sh) requires a subcommand.
Without 'start', it prints CLI help and exits immediately, causing
CrashLoopBackOff.
Keycloak 26.x requires either KC_HOSTNAME or KC_HOSTNAME_STRICT=false.
Since the hostname varies per deployment, disable strict hostname
checking to allow Keycloak to accept requests on any hostname.
fullnameOverride: keycloak caused a naming collision with the old
Bitnami StatefulSet, requiring a manual delete on upgrade. Without it,
the codecentric chart generates new resource names (openhands-keycloak,
openhands-keycloak-http) that don't conflict with the old chart's
resources.
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