Skip to content

Add DatastoreMigration CR awareness to operator controllers#4577

Open
caseydavenport wants to merge 4 commits intotigera:masterfrom
caseydavenport:casey-migration-cr-support
Open

Add DatastoreMigration CR awareness to operator controllers#4577
caseydavenport wants to merge 4 commits intotigera:masterfrom
caseydavenport:casey-migration-cr-support

Conversation

@caseydavenport
Copy link
Member

Wire up the operator to read DatastoreMigration CRs and react to migration phase changes:

  • Defer APIServer reconciliation during Migrating phase to avoid fighting over the APIService resource
  • Trigger operator restart on Converged phase to switch to v3 CRD mode
  • Create/delete dynamic migration RBAC (calico-kube-controllers-migration ClusterRole) based on whether a DatastoreMigration CR exists
  • Check DatastoreMigration CR at startup to handle operator restarts during or after migration
  • Change UseV3CRDS() signature to accept *rest.Config so it can create a dynamic client for the DatastoreMigration check

Stacked on #4576 -- merge that first.

Grant kube-controllers access to datastoremigrations and
datastoremigrations/status in migration.projectcalico.org so it can
drive the datastore migration workflow.
kube-controllers needs to watch CRDs to determine which API group is
active during datastore migration.
Introduce pkg/apigroup to track the active CRD API group and inject
CALICO_API_GROUP into all workload containers via the component handler.
This tells components whether to use projectcalico.org/v3 or the legacy
crd.projectcalico.org/v1 API group.
Wire up the operator to read DatastoreMigration CRs and react to
migration phase changes:

- Defer APIServer reconciliation during Migrating phase to avoid
  fighting over the APIService resource
- Trigger operator restart on Converged phase to switch to v3 CRD mode
- Create/delete dynamic migration RBAC for kube-controllers based on
  whether a DatastoreMigration CR exists
- Check DatastoreMigration CR at startup to handle operator restarts
  during or after migration
@caseydavenport caseydavenport force-pushed the casey-migration-cr-support branch from 4ce7270 to 51acfe6 Compare March 19, 2026 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants