-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Externalize provider specific specs and status in separated CRDs #1137
Externalize provider specific specs and status in separated CRDs #1137
Conversation
Signed-off-by: Pablo Chacin <[email protected]>
Hi @pablochacin. Thanks for your PR. I'm waiting for a kubernetes-sigs or kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/ok-to-test Thanks @pablochacin. We'll take a look at this soon! |
I like this, it breaks up dependencies and exposes a clearer contract between the moving pieces. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is my first pass through the proposal. I will likely have additional comments, but this is what jumped at out me. And I wanted to provide this feedback now because I'm in meetings the rest of the day.
|
||
When the `InfrastructureRef` is set in the cluster, the cluster controller will retrieve the infrastructure object. If the object has not been seen before, it will start watching it. Also, if the object's owner is not set, it will set to the Cluster object and will set the cluster's `InfrastructureState` to "Provisioning". | ||
|
||
When an infrastructure object is updated, the provider controller will check the owner reference. If it is set, it will retrieve the cluster object to obtain the required cluster specification and starts the provisioning process. When the process finishes, it sets the `InfrastructureStatusRef` in the cluster object. When the cluster controller detects the `InfrastructureStatusRef` is set, it sets the status to "Provisioned". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The way we determine the value of Machine.Status.InfrastructureReady
is by retrieving the object referenced by Machine.Spec.InfrastructureRef
and evaluating a required boolean field .Status.Ready
. I recommend doing the same thing here for consistency. This is also the responsibility of the cluster controller in cluster-api; it should not be done by a provider controller.
|
||
The sequence diagram below describes the hight-level process, collaborations and state transitions. | ||
|
||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use the same diagrams @dlipovetsky contributed to the other proposal?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 to using plantUML here, it will help with updating/modifying if necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll update the proposal with the diagrams ASAP.
That said, is sad to realize ascii art is no longer appreciated ... like vinyl discs ... 😢
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lol, I appreciate the ascii art, I just don't want to have to attempt to update said ascii art 😂
|
||
##### Transition Conditions | ||
|
||
- The Cluster object has the `InfrastructureRef` field set |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would expect the InfrastructureRef to be set at creation time, I'm curious to know how this affects the Phases
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assuming the reference is always set when the cluster is created will make the pending phase unnecessary.
The current phases consider the possibility that the two objects, cluster and infrastructure are not created in a given order. It particularly opens the possibility of some tool watching for new clusters an creating the infrastructure for the cluster automatically.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vincepri I know there are some providers today that don't use the Cluster resource. If we can get them to switch to using it, primarily as a means to link related machines together, maybe we need to keep InfrastructureRef optional? Otherwise, they'd have to create a dummy reference to something...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it is too difficult to make the InfrastructureRef optional, maybe we can provide a Noop Infrastructure provider as part of cluster-api
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I mentioned here #1137 (comment), I'd prefer InfrastructureRef
to be required like it is for Machines. If folks don't want to use the Cluster object, they can already do so today by not specifying a Cluster label on Machines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you don't use a Cluster, you don't get machine.status.nodeRef, which means that machineSet.status is broken (the controller can't calculate ready/available/etc replicas). I'd like to suggest in a separate discussion that Cluster be required, but that's not up for debate as part of this proposal 😄.
##### Transition Conditions | ||
|
||
- The Cluster object has the `InfrastructureRef` field set | ||
- The Infrastructure object has its owner set to the Cluster |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Cluster Controller would set this reference for us
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I understand this comment. The Cluster Controller handles the common cluster object (independent of the provider). Some other entity (the provider's version of clusterctl, maybe? is responsible for setting this ref.
This state transition doesn't assume the reference is set when the object is created in the cluster api.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI, there will no longer be provider-specific clusterctls going forward.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
The sequence diagram below describes the hight-level process, collaborations and state transitions. | ||
|
||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 to using plantUML here, it will help with updating/modifying if necessary.
- Fix spelling, wrong references to "machine" instead of "cluster". - Make `InfrastructureRef` a top level element in `ClusterSpec` and make it mandatory - Remove `InfrastructureStatusRef` and introduce `Infrastructure.Status.Ready` field - Update collaboration sequence - Add step for copying status from Infrastructure to Cluster status to collabotation sequence - Complete state transition descriptions
Replace the InfrastructureState field by a boolean that reflects when the cluster infrastructure is ready or not. Adjust the collaboration diagram and state transition description accordingly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking good imo, we'll just need to fix the diagrams
/test pull-cluster-api-test |
If the ASCII diagrams are a blocker, I'd be ok merging this in now and opening an issue to fix them up later so we don't hold up the proposal longer. |
Finally replaced. Retro look is now gone 😞 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/approve
/hold
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: pablochacin, vincepri The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
If there are no major comments today, I'd like to get this merged as we discussed during last community meeting 🙂 /cc @detiber @ncdc @justinsb @timothysc @davidewatson @dlipovetsky |
/hold cancel |
Signed-off-by: Pablo Chacin (@pablochacin)
What this PR does / why we need it:
This proposal outlines the replacement of the provider-specific fields embedded in the Cluster object by references to objects managed by a provider controller, effectively eliminating the actuator interface. The new objects are introduced and the cooperation between the Cluster controller and the Cluster Infrastructure Controller is outlined. This process introduces a new field
InfrastructureState
which reflects the state of the provisioning process.Fixes #833
Special notes for your reviewer:
07/14/20109: First set of review comments addressed.
InfrastructureRef
is a top level element ofClusterSpec
andInfrastructureStatusRef
was removedInfrastructureRef
is mandatory and is expected to be set when the Cluster object is createdNote: changes submitted in two commits to allow reverting the change in the transition model if found it is not satisfactory.
07/18/2019: Replace ascii-art sequence diagrams
Release note: