Cutover from Kanidm to Keycloak #575
Etiketter
Inga etiketter
area/backups
area/ci
area/control-panel
area/identity
area/infra
area/observability
area/payments
area/security
area/storage
area/web
blocked
needs-info
needs-triage
priority
high
priority
low
priority
medium
ready-for-implementation
type
bug
type
chore
type
docs
type
epic
type
feature
type
task
wontfix
Ingen milstolpe
Inget projekt
Inga tilldelade
1 deltagare
Notiser
Förfallodatum
Inget förfallodatum satt.
Beroenden
Inga beroenden satta
Referens
bitborg/bitborg-infra#575
Läser in…
Hänvisa till i nytt ärende
Ingen beskrivning angiven.
Ta bort grenen "%!s()"
Borttagning av en gren är permanent. Även om den borttagna grenen kan fortsätta existera en kort tid innan den faktiskt tas bort, kan det INTE ångras i de flesta fall. Vill du fortsätta?
Switch prod from Kanidm to Keycloak in one window. Use the
infra-applyskill for every apply.SIGNUPS_OPEN=false). Stop the reconciler timer and path unit.keycloakrole and the prod realm.Done when: all sign-in paths work on prod, counts match, and Kanidm is stopped but restorable.
Depends on: #572
Depends on: #573
Depends on: #574
Depends on: bitborg/bitborg-auth-reconciler#78
Depends on: bitborg/bitborg-web#311
Depends on: bitborg/bitborg-payment#111
Depends on: a private task
Epic: bitborg/bitborg-docs#127
Staging cutover rehearsed 2026-10-09 with the new
kanidm_enabledswitch (#574 branch). Items the prod flip must also cover, not exercised on staging:bitborg-backup-drill.py.j2). Gate the Kanidm part onkanidm_enabledand decide whether the kept volume is still backed up.kanidm_domain(roles/monitoring/defaults/main.yml). Move it to/realms/bitborg/protocol/openid-connect/in the same window. Keep a break-glass local login until then.web_oidc_issuerdefault andscripts/signup-drill.shstill use the Kanidm issuer shape.kanidm,keycloak,caddy,forgejo,reconciler. Forgejo must start after Caddy serves Keycloak on the auth name.Updated by the
id.*rename (branchfeat/identity-id-domain): Keycloak servesid.bitborg.sebeside Kanidm, so cutover needs no domain swap.kanidm_enabled: falsenow also switches the Forgejo source name, web OIDC issuer and secret, Grafana OIDC URLs, admin group and secret, and drops the Kanidm/statusprobe. See the runbook "Cutover switch".Still by hand at cutover:
Bitborg-idcallback on theforgejoclient, before the switch.web_keycloak_required: true.podman_secretwith changed data).grafana.container.j2.Post-cutover check, carried over from the staging rehearsal:
bitborg-renovateas a Write collaborator. The first nightly run (00:30) must open the "Configure Renovate" onboarding PR.On staging the opt-in and the collaborator grant passed. The Renovate role runs on prod only, so the run itself is verified here.
Per-user checks for the cutover window, decided 2026-10-11. They replace a separate rehearsal against a restored Forgejo.
After
importand before the reconciler timer is re-enabled, for every imported person:login_nameof the linked external account.user.idbefore and after).Any mismatch stops the cutover before step 7, where rollback is still cheap.
Take the "before" snapshot from the prod Forgejo database at the start of the window, read-only.
Cutover done on prod, 2026-10-11. Keycloak (
id.bitborg.se, realmbitborg) is the identity provider. Kanidm is stopped; its volume and config are kept for the rollback window.Stage A, beside Kanidm:
kanidm-final-20261011.json.age, stored locally and at both off-site buckets.verifyOK. Per-user id and username match for every linked Forgejo account.Stage B, the switch (#659):
auth.bitborg.seredirects toid.bitborg.se.Bitborg-id.latestwith the Keycloak issuer. Grafana signs in through Keycloak.v2.0.0: a dry run, then apply mode.login_name, repos, orgs, quota) are identical, also after two apply-mode reconciler runs.tofu planshows no changes.Stage C:
keycloak.dump, without Kanidm. The restore drill passed (#572 closed).Follow-ups: web#352 (sign-out from a session started before the cutover).
CoreUnitDown{name="kanidm"}cleared by applying monitoring-agent after the switch.Left open for the rollback window. Rollback re-pins web to
pin-c01b015(runbook "Cutover switch"). The Renovate check after the next nightly run is still to do.Post-cutover follow-ups, 2026-10-11: Keycloak heap flag fixed (#666) after
KeycloakMemoryHighfired; memory caps (#662); reconcile right after a first Forgejo sign-in (#665, quota in 3 s on staging); billing may manage the trial groups (#667, applied on staging and prod with a two-step replace, runbook #669);test-passkey-checkremoved for good (#663). The move to its own user and PostgreSQL is #670. Still open here: the Renovate check after tonight's 00:30 run, then the rollback window.Final Kanidm dump, 2026-10-15: the host copy and the Glesys copy are deleted. The Hetzner copy is under the bucket's object lock until 2026-10-25, so it gets deleted on 2026-10-26. This issue closes after that.
Final Kanidm dump, 2026-10-27: the Hetzner copy is deleted after its object lock ended. No copy remains on the host, Glesys or Hetzner. The rollback state was purged the same day (#585), so the rollback window is over. Closing.