-
Story
-
Resolution: Done
-
Critical
-
None
-
None
-
BU Product Work
-
3
-
False
-
None
-
False
-
OCPSTRAT-683 - Migrate MAPI to Cluster API for AWS -Phase 1
-
-
-
CLOUD Sprint 256, CLOUD Sprint 257, CLOUD Sprint 258, CLOUD Sprint 259, CLOUD Sprint 260, CLOUD Sprint 261
Background
We want to build out a sync controller for both Machine and MachineSet resources.
This card is about bootstrapping the basics of the controllers, with more implementation to follow once we have the base structure.
For this card, we are expecting to create 2 controllers, one for Machines, one for MachineSets.
The MachineSet controller should watch MachineSets from both MachineAPI and ClusterAPI in the respective namespaces that we care about. It should also be able to watch the referenced infrastructure templates from the CAPI MachineSets.
For the Machine controller, it should watch both types of Machines in MachineAPI and ClusterAPI in their respective namespaces. It should also be able to watch for InfrastructureMachines for the CAPI Machines in the openshift-cluster-api namespace.
If changes to any of the above resources occur, the controllers should trigger a reconcile which will fetch both the Machine API and Cluster API versions of the resources, and then split the reconcile depending on which version is authoritative.
Deletion logic will be handled by a separate card, but will need a fork point in the main reconcile that accounts for if either of the resources have been deleted, once they have been fetched from the cache.
Note, if a MachineSet exists only in CAPI, the controller can exit and ignore the reconcile request.
If a Machine only exists in CAPI, but is owned by another object (MachineSet for now) that is then mirrored into MAPI, the Machine needs to be reconciled so that we can produce the MAPI mirror of the Machine.
Steps
- Bootstrap base controllers
- Fetch resources in the controllers as per description above
- Set up reconcileMAPItoCAPI and reconcileCAPItoMAPI functions as templates for future work.
- Set up watches based on the decsription above - note this will need some dynamic watching since the infrastructure refs may refer to any resource
- Add envtest based testsuite setup for controllers
Stakeholders
- Cluster Infra
Definition of Done
- We have the basis of the sync controllers implemented so that we can start implementing that actual business logic.
- Docs
- <Add docs requirements for this card>
- Testing
- <Explain testing that will be added>
- links to