-
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
✨ Add MachineSetReady condition to MachineDeployment #9262
✨ Add MachineSetReady condition to MachineDeployment #9262
Conversation
Welcome @muraee! |
Hi @muraee. Thanks for your PR. I'm waiting for a kubernetes-sigs 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. |
Thanks @muraee! can you please provide concrete examples in the PR desc for use cases where this condition gives additional value? /ok-to-test |
@@ -228,6 +228,14 @@ const ( | |||
// machines required (i.e. Spec.Replicas-MaxUnavailable when MachineDeploymentStrategyType = RollingUpdate) are up and running for at least minReadySeconds. | |||
MachineDeploymentAvailableCondition ConditionType = "Available" | |||
|
|||
// MachineSetReadyCondition reports a summary of current status of the MachineSet owned by the MachineDeployment. | |||
MachineSetReadyCondition ConditionType = "MachineSetReady" |
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.
should this be included in the MD conditions.SetSummary
?
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 I am not mistaken, currently if the minReplicas is reached, the MachineDeployment will report Ready to be True, even if one of the machines is failing.
If we include this new condition in the summary, then the MachineDeployment will not be Ready if any machine fails.
Do we want that?
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 think you're right, let's keep the scope to the minimal and avoid changing existing semantic.
6560132
to
03545ca
Compare
03545ca
to
4bc8a1f
Compare
something doesn't like it in the tests
lgtm otherwise |
/test pull-cluster-api-test-main |
test passed, seems it was just a flake. |
conditions.WithFallbackValue(false, clusterv1.WaitingForMachineSetFallbackReason, clusterv1.ConditionSeverityInfo, ""), | ||
) | ||
} else { | ||
conditions.MarkFalse(md, clusterv1.MachineSetReadyCondition, clusterv1.WaitingForMachineSetFallbackReason, clusterv1.ConditionSeverityInfo, "MachineSet not found") |
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.
In what scenarios would newMS
be nil?
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.
before I added this check, one of the e2e panicked with a nil dereference error.
If I am not wrong, that was the case when the MD was deleting.
I think this is a good step towards providing better UX for MD consumers. Can we think of any additional scenario where the condition would provide value, e.g during a rolling upgrade? /lgtm |
LGTM label has been added. Git tree hash: 565398f47e778f22b1fd10c7fe4f12a44c74abd8
|
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.
/approve
/hold
@sbueringer any thoughts here?
[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 |
Looks good. We obviously ignore all the potentially existing old MachineSets, but I assume this is intended. Not sure if it's confusing if we refer to "the" MachineSet in /lgtm Not sure if Fabrizio has an opinion on it. |
Hey @fabriziopandini did you have a chance to review this? |
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.
/hold cancel
@fabriziopandini if you have time to review, we can follow-up to address potential comments |
What this PR does / why we need it:
For example, when the AWSMachine (InfraMachine) fails to be created/provisioned, the MachineSet will propagate that error into the
MachinesReady
condition which is included in theReady
condition summary:However, looking at the MachineDeployment, it wouldn't be clear what is failing
This PR adds a new condition
MachineSetReady
to MachineDeployment which mirrors the underlying MachineSet Ready condition to provide meaningful errors.Given the example above, the new condition will look like the following:
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 ##3486
/area machinedeployment