-
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
✨ MachineDeployment - Available, Progressing and Ready Conditions #4174
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Hi @Arvinderpal. 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. |
43b696f
to
034ffc7
Compare
034ffc7
to
6e0f4d6
Compare
/ok-to-test |
api/v1alpha4/condition_consts.go
Outdated
// Progressing means the MachineDeployment is progressing. Progress for a MachineDeployment is | ||
// considered when a new machine set is created or adopted, and when new machine scale | ||
// up or old machine scale down. Progress is not estimated for paused deployments or | ||
// when progressDeadlineSeconds is not specified. | ||
MachineDeploymentProgressing ConditionType = "MachineDeploymentProgressing" | ||
// MachineFailure is added in a MachineDeployment when one of its machines fails to be created | ||
// or deleted. | ||
MachineDeploymentMachineFailure ConditionType = "MachineDeploymentMachineFailure" |
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.
These two conditions seem a bit out of place compared to others, given that they could be a reason for Ready
or similar, rather than on their own. @fabriziopandini what do you think?
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.
Just to give some context.
The code is modeled after the Deployment/ReplicaSet code
Additionally, the much like the kubectl rollout status
command, the clusterctl rollout status
will monitor the Progressing condition.
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.
Got it, although to be consistent with the rest of CAPI conditions, we might want to change things up a little bit. I'd see having a Ready
condition on MachineDeployment that not only aggregates the status of each Machine in a MachineDeployment, but can tell users if there is a failure or a scaling operation is in progress. This would be a Reason
for the condition to be False
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 agree with Vince we should aim to better consistency, and in this case, we should revisit things in order to have all the conditions using a positive polarity.
Please note there is also the option to propose an amendment to the current condition proposal, so we can discuss pros and cons and address all the related concerns e.g. how do we compute summary in case of conditions with mixed polarity? what are the required changes to util/conditions in order to help users in shifting to the new model?
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 have created a MachineDeploymentReadyCondition
which encapsulates failures in the underlying MachineSets. The MachineDeploymentProgressing
IMO is essential. Again to be in line with how Deployment/RS work and in particular since MD/MS has been modeled around that, the Progressing seems to be an important condition. It's not clear to me how just a Ready condition can capture progression by itself. For example, NewMSAvailableReason
and MachineSetUpdatedReason
are Reasons for progressing condition. How do they get incorporated into Ready? Also, clusterctl rollout status
essentially watches the Progressing condition and spits out updates as they happen. Again, not sure how this command would be impacted or even be useful.
@fabriziopandini Positive polarity only seems too restrictive to me. Also, I see various places where conditions.MarkFalse()
is used already.
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 on ensuring we have the Ready
condition. This is for consistency and making this kstatus compatible.
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 Progressing
a way to describe that a rolling upgrade is happening, should we be more explicit here? Thinking about the rest of the system as well, should we do something similar in KCP and express better when a resource is performing a rolling operation?
Before merging and proceeding with any of these, I'd like to find some consistency and apply it everywhere.
api/v1alpha4/condition_consts.go
Outdated
// Reasons for deployment conditions | ||
// | ||
// Progressing: | ||
// NewMSAvailableReason is added in a deployment when its newest machine set is made available | ||
NewMSAvailableReason = "NewMachineSetAvailable" | ||
// TimedOutReason is added in a deployment when its newest machine set fails to show any progress | ||
// within the given deadline (progressDeadlineSeconds). | ||
TimedOutReason = "ProgressDeadlineExceeded" | ||
// MachineSetUpdatedReason is added in a deployment when one of its machine sets is updated as part | ||
// of the rollout process. | ||
MachineSetUpdatedReason = "MachineSetUpdated" | ||
// | ||
// Available: | ||
|
||
// MinimumMachinesAvailable is added in a deployment when it has its minimum machines required available. | ||
MinimumMachinesAvailable = "MinimumMachinesAvailable" | ||
// MinimumMachinesUnavailable is added in a deployment when it doesn't have the minimum required machines | ||
// available. | ||
MinimumMachinesUnavailable = "MinimumMachinesUnavailable" |
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.
nit: Is it possible to map reasons and conditions, so it will be easier to understand the expected workflow/state diagram for each condition?
// If the previous condition has been a successful rollout then we shouldn't try to | ||
// estimate any progress. Scenario: |
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 a general recommendation, we should avoid to determine the current status on the basis of the previous one, but instead, we should always reconcile with the current state of things.
/milestone v0.4.0 |
/ok-to-test |
6e0f4d6
to
dfea528
Compare
to MachineDeployment.
dfea528
to
adb1bfc
Compare
@Arvinderpal: The following tests failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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. I understand the commands that are listed here. |
@Arvinderpal: PR needs rebase. 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. |
hey @Arvinderpal are you still tackling this work? |
Thanks for the update @Arvinderpal. |
@enxebre I think the last time it was mentioned in the ClusterAPI Meeting we were talking about some time in June. But not sure if there are more concrete plans now. |
@vincepri @fabriziopandini @enxebre I'm closing this in favor of #4625 |
What this PR does / why we need it:
This brings the use of Conditions to MachineDeployment. More specifically, it brings the Available, Progressing and Failure Conditions. The code borrows heavenly from the Deployment/ReplicaSet approach for conditions.
Fixes # #3486