-
Notifications
You must be signed in to change notification settings - Fork 39.8k
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
Update deployment and daemonset completeness checks #44672
Update deployment and daemonset completeness checks #44672
Conversation
func DeploymentComplete(deployment *extensions.Deployment, newStatus *extensions.DeploymentStatus) bool { | ||
return newStatus.UpdatedReplicas == *(deployment.Spec.Replicas) && | ||
newStatus.Replicas == *(deployment.Spec.Replicas) && | ||
newStatus.AvailableReplicas >= *(deployment.Spec.Replicas)-MaxUnavailable(*deployment) && | ||
newStatus.AvailableReplicas >= *(deployment.Spec.Replicas) && |
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, having "min available pods" doesn't mean the rollout is complete |
/release-note-none |
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.
Need to update PR title since this changes DaemonSet also.
@@ -410,25 +410,14 @@ func SetReplicasAnnotations(rs *extensions.ReplicaSet, desiredReplicas, maxRepli | |||
|
|||
// MaxUnavailable returns the maximum unavailable pods a rolling deployment can take. | |||
func MaxUnavailable(deployment extensions.Deployment) int32 { | |||
if !IsRollingUpdate(&deployment) || *(deployment.Spec.Replicas) == 0 { |
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.
We still need this, right?
@@ -960,19 +960,19 @@ func TestDeploymentComplete(t *testing.T) { | |||
expected bool | |||
}{ | |||
{ | |||
name: "complete", | |||
name: "not complete #0", |
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.
Suggest making it more descriptive, something like "not complete: min but not all pods become available"
@@ -960,19 +960,19 @@ func TestDeploymentComplete(t *testing.T) { | |||
expected bool | |||
}{ | |||
{ |
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.
hence both rollout status and ProgressDeadlineSeconds will not be successful in cases where a 1-pod Deployment never becomes successful because its Pod is never run
Add a test case for this
Why labeling with |
Yeah, we need a release note for the change /release-note |
Then add a release note block in the PR description as well |
@janetkuo comments addressed |
Thanks! LGTM Please update PR title and release note since this also changes DaemonSets. Please also squash commits. |
Updated PR title and release note. How do you want me to squash the commits? The first one is a straight revert (and it better stay like that), the second one is another revert, albeit not straight. Squashing the other two makes sense. |
…tatus" This reverts commit d20ac87.
Signed-off-by: Michail Kargakis <[email protected]>
Signed-off-by: Michail Kargakis <[email protected]>
/approve |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: janetkuo, kargakis, lukaszo
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
Automatic merge from submit-queue (batch tested with PRs 43575, 44672) |
maxUnavailable being taken into account for deployment completeness has caused a lot of confusion (#44395, #44657, #40496, others as well I am sure) so I am willing to just stop using it and require all of the new Pods for a Deployment to be available for the Deployment to be considered complete (hence both
rollout status
and ProgressDeadlineSeconds will not be successful in cases where a 1-pod Deployment never becomes successful because its Pod never transitions to ready).@kubernetes/sig-apps-api-reviews thoughts?
Fixes #44395