Migrate IdentityProviderConfigurations and Invites to keycloak.platform-mesh.io
v26.11 moves the Keycloak integration out of security-operator into pm-keycloak-operator and gives it its own API group:
| before (deprecated) | after |
|---|---|
core.platform-mesh.io/v1alpha1 Invite | keycloak.platform-mesh.io/v1alpha1 Invite |
core.platform-mesh.io/v1alpha1 IdentityProviderConfiguration | keycloak.platform-mesh.io/v1alpha1 IdentityProviderConfiguration |
APIExports core.platform-mesh.io (invites), system.platform-mesh.io (identityproviderconfigurations) | APIExport keycloak.platform-mesh.io |
WorkspaceType security (initializer root:security) runs the identity setup | WorkspaceType keycloak (initializer/terminator root:keycloak) |
OIDC client secrets labelled core.platform-mesh.io/{idp-name,client-name} | additionally keycloak.platform-mesh.io/{idp-name,client-name} |
Both groups are served during the transition. pm-keycloak-operator reconciles the deprecated kinds through the old exports when the LegacyAPIs feature gate is enabled. It is enabled by default.
What platform-mesh-operator does on its own
The keycloak-apigroup-split migration step runs on every reconcile of the PlatformMesh resources once v26.11 is deployed:
- Binds
keycloak.platform-mesh.iointo every existing organization and account workspace.root:platform-mesh-systemandroot:orgsget theirs from the kcp manifests. - Adds the
keycloak.platform-mesh.io/{idp-name,client-name}labels to the OIDC client secrets of every deprecatedIdentityProviderConfiguration, so the keycloak export's secrets claim selects them. The legacy labels stay. - Adds
root:keycloaktospec.terminatorsandstatus.terminatorsof every organization LogicalCluster, so deleting an organization created before v26.11 still removes its realm and clients.
The portal still reads identityproviderconfigurations.core.platform-mesh.io (welcome and the organization realms), so a deprecated twin is kept next to every keycloak.platform-mesh.io object the platform owns: platform-mesh-operator applies one for welcome, pm-keycloak-operator's initializer creates one per organization. The twins are created marked keycloak.platform-mesh.io/migrated=true, only the keycloak object's reconciler touches the realm and mirrors its status into the twin. They go once the portal reads the new group.
This is skipped entirely when the feature-disable-keycloak toggle is set.
Moving an object to the new group
Deprecated objects keep working. To move one create the keycloak.platform-mesh.io object next to it and remove the deprecated one afterwards:
- Create the
keycloak.platform-mesh.io/v1alpha1object with the same name and spec in the same workspace. The validating webhook accepts it although the realm already exists, because a deprecated object of that name is present in the same workspace. - pm-keycloak-operator adopts the realm: it copies
status.managedClientsfrom the deprecated object (no new Keycloak clients, secrets unchanged) and annotates the deprecated objectkeycloak.platform-mesh.io/migrated=true. From then on the deprecated object is no longer reconciled, its status mirrors the new object's. - Wait until the new object reports
Ready. - Delete the deprecated object. A migrated object is released without touching Keycloak.
Deleting the deprecated object before its successor exists deletes the realm.
Invites need no hand-over: create the new one, delete the old one in any order - the Keycloak user is only created once.
With GitOps, commit the new object first and the removal of the old one in a later change.
Operator checklist
Upgrade to v26.11.
pm-keycloak-operatormust be enabled in the profile (it is in the shippedkind-profile.yaml/production-profile.yaml), security-operator (now pm-openfga-operator, see openfga-api-group.md) no longer takeskeycloak/idpvalues.Check the migration step ran:
shellkubectl -n platform-mesh-system logs deploy/platform-mesh-operator | grep keycloak-apigroup-splitMove your own
IdentityProviderConfiguration/Invitemanifests tokeycloak.platform-mesh.io/v1alpha1as described above. Requests against the deprecated kinds return a deprecationWarning. iam-service and thewelcomerealm applied by platform-mesh-operator already use the new group, the portal does not yet.Once no deprecated objects are left anywhere:
shellKUBECONFIG=<kcp admin kubeconfig> kubectl get identityproviderconfigurations.core.platform-mesh.io --server=<kcp>/clusters/root:orgs kubectl get identityproviderconfigurations.core.platform-mesh.io --server=<kcp>/clusters/root:platform-mesh-systempm-keycloak-operator can run with
--feature-gates=LegacyAPIs=false, which also drops the legacy webhook rule. The deprecated kinds are removed from thecoreandsystemexports in a later release.
Rollback
Deprecated objects that were not moved are unaffected by a downgrade. A moved object has its deprecated twin marked keycloak.platform-mesh.io/migrated=true; remove that annotation to hand the realm back to the deprecated object.