Add DatastoreMigration CR awareness to operator controllers#4577
Open
caseydavenport wants to merge 4 commits intotigera:masterfrom
Open
Add DatastoreMigration CR awareness to operator controllers#4577caseydavenport wants to merge 4 commits intotigera:masterfrom
caseydavenport wants to merge 4 commits intotigera:masterfrom
Conversation
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
4ce7270 to
51acfe6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Wire up the operator to read DatastoreMigration CRs and react to migration phase changes:
Migratingphase to avoid fighting over the APIService resourceConvergedphase to switch to v3 CRD modecalico-kube-controllers-migrationClusterRole) based on whether a DatastoreMigration CR existsUseV3CRDS()signature to accept*rest.Configso it can create a dynamic client for the DatastoreMigration checkStacked on #4576 -- merge that first.