-
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
Remove NodeConditions from Machine.Status #1081
Remove NodeConditions from Machine.Status #1081
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: 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 |
6fb6f2e
to
5c2e21b
Compare
/lgtm +1 from me considering the Node's Conditions and Addresses can be introspected by following the nodeRef. holding to give time for additional feedback. |
While #950 was closed/unresolved, The related PR stated that the getting the Addresses from the node was sufficient: #951 (comment) |
+1 from me! |
Is this because of the presence of NodeRef? And if so, will this be back ported to 1.5? CAPV does currently use the Machine's addresses as part of the workflow to indicate whether or not a machine is ready. In fact, this is critical since on-prem providers may not have a ControlPlaneEndpoint from an external load balancer, and thus the initial control plane machine's IP address(es) are used to determine the control plane endpoint. I'm adding a hold that anyone can cancel at any time. I just want to make sure that we understand the effects this may have on providers relying on those addresses. If we shouldn't be, then tell us why not, and what we should use instead. Thanks! p.s. @andrewsykim I've an inkling the answer will be to use the NodeRef to determine addresses. If this is the case, then we need to reconcile the discrepancy between the CAPV address resolution and the CCM address resolution sooner rather than later. /hold |
This will not be backported. If you need to know when a machine is "ready", we have machine.status.infrastructureReady in v1alpha2. This field flips to true only when the infrastructure provider decides this is appropriate. If you need to know the apiserver's url... we'll need to continue to think about that. |
5c2e21b
to
eabb4a7
Compare
/test pull-cluster-api-test |
2 similar comments
/test pull-cluster-api-test |
/test pull-cluster-api-test |
I am not sure about this change and would like feedback from others who participated in the debate which introduced it (e.g. @hardikdr, @alvaroaleman, et al.).
Notes
At the time I remember there was a long discussion. Two reasons from the PR are #47 and #253 Looking at last years meeting notes on August 15th another reason was given: to avoid requiring the |
If the intent is to rely on Kubernetes Node addresses, there are some issues there worth considering:
|
Let's add this item to next week's agenda and discuss on Zoom, if you all agree. One thing I'd like to point out is that both of these fields are unused in v1alpha1. |
Addresses may be used by providers (e.g. CAPV uses them). |
Currently refactoring that out, but it just opens up a broader issue related to how CAPI providers handle addressing versus the cloud providers for the same platform (as @andrewsykim noted). |
Hi @dhellmann,
CAPV maintains the addresses in both locations for this reason. Placing them solely on the NodeRef fails to address the issue of IP addresses that may not be relevant to Kubernetes, but relevant to machine infrastructure. This is an issue that I've discussed with @andrewsykim quite a bit. Today there are only five choices for a Kubernetes type NodeAddressType string
const (
NodeHostName NodeAddressType = "Hostname"
NodeExternalIP NodeAddressType = "ExternalIP"
NodeInternalIP NodeAddressType = "InternalIP"
NodeExternalDNS NodeAddressType = "ExternalDNS"
NodeInternalDNS NodeAddressType = "InternalDNS"
) I think the node address type should be a bit mask: type NodeAddressType uint32
const (
NodeAddrUnknown NodeAddressType = 0
NodeAddrDNS NodeAddressType = 1 << iota
NodeAddrIP4
NodeAddrIP6
NodeAddrInternal
NodeAddrExternal
NodeAddrAPIServer
NodeAddrKubelet
// and others
) This way it will be possible to easily ascertain the purpose of an address associated with a node, whether it's meant for the API server, the Kubelet, some non Kubernetes service, the address family, etc. |
Thanks for clarifying @ncdc. I overlooked that. Since we would have to change the Conditions type from |
My concern would be around forcing a remote call for static or slow changing fields could introduce undefined or unwanted behavior when there are intermittent network issues, especially if these addresses and/or conditions are used for load balancers/endpoints. |
To chime in, we're using the addresses today in OpenShift. Generally speaking, components external to cluster-api should be able to rely on machine-object as the source of truth. We might need these addresses for any number of things (today we use internal hostname for CSR approval), and having to account for a proliferation of infra-providers seems unhelpful long term. |
I'm +1 for removing the existing Conditions as documented (mirroring Node Conditions). I'm now a -1 on Removing the Addresses. I think there has been sufficient cases made where the existing Node Addresses may not be sufficient. |
Would having The upside is that we don't have to copy the status and deal with 2 source of truth. |
I would expect these addresses to only be set on create, especially since we have said that a failed instance should not be replaced by a Machine controller. In general, if we expect an outside system to interact with it, then it should be a field on a known resource and not have to deal with unstructured. |
+0 on Addresses IMO I had thoughts of using conditions for the future states of the state machine. |
No objections from me here, but the comment would need updating and we are still lacking a backing implementation to populate the field. |
Hey folks, given the feedback, I went ahead and scoped down the PR to just remove NodeConditions and keep Addresses. |
eabb4a7
to
2e0bd1c
Compare
I am inclined towards keeping something-like Conditions in API. From UX PoV it helps in realizing the status of the machine Although we never really implemented the logic to populate this field so far, we might want to consider having it in the future. I think it does not have to be NodeConditions, it could be something generic, what we could also define. For now, I am happy with the current changes, thanks for the PR. |
@hardikdr fully agree longer term that having Machine Conditions would be beneficial, but I'd also like to get away from having fields for unimplemented functionality. |
And again, to clarify, we do still have some "conditions" in the machine status: bootstrapReady and infrastructureReady. These are actively used in v1alpha2. |
Given that it has been 2 weeks and comments have slowed down on this PR, should we merge this change? |
Signed-off-by: Vince Prignano <[email protected]>
I haven't seen any major disagreements in the comments for removing NodeConditions. Lazy consensus ftw. /hold cancel |
Oh but you need to rebase 😄 |
2e0bd1c
to
dee2b39
Compare
@ncdc Just rebased :) |
/lgtm |
Signed-off-by: Vince Prignano [email protected]
What this PR does / why we need it:
This PR removes
Conditions
fields fromMachine.Status
. Only applies to v1alpha2 types.Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #
Special notes for your reviewer:
Please confirm that if this PR changes any image versions, then that's the sole change this PR makes.
Release note: