-
Notifications
You must be signed in to change notification settings - Fork 40.1k
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 min ready seconds impl #101316
Add min ready seconds impl #101316
Conversation
fa2f0e2
to
d9bc222
Compare
f5744f3
to
1c6c06a
Compare
/sig apps |
/remove-sig api-machinery |
1c6c06a
to
123d9de
Compare
/retest |
/remove-sig api-machinery |
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 missing unit test ensuring the new functionality is working as expected. I'd at least require following tests:
- requeue if available replicas is less than requested
- ensure available is updated when pods switches to available
@@ -458,7 +481,7 @@ func (ssc *defaultStatefulSetControl) updateStatefulSet( | |||
} | |||
} | |||
|
|||
// At this point, all of the current Replicas are Running and Ready, we can consider termination. | |||
// At this point, all of the current Replicas are Running and Ready or Available, we can consider termination. |
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.
Ready and Available, you can't be one or the other, IsPodAvailable
checks IsPodReady
in the first place.
@@ -486,6 +509,15 @@ func (ssc *defaultStatefulSetControl) updateStatefulSet( | |||
firstUnhealthyPod.Name) | |||
return &status, nil | |||
} | |||
// if we are in monotic mode and the condemned target is not the first unhealthy Pod, block. | |||
if utilfeature.DefaultFeatureGate.Enabled(features.StatefulSetMinReadySeconds) && isRunningAndAvailable(condemned[target], set.Spec.MinReadySeconds) && monotonic && condemned[target] != firstUnhealthyPod { |
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.
Yes
caa5347
to
3b55b4b
Compare
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.
Thank you for the reviews @atiratree and @soltysh for the reviews. I updated the PR based on your feedback. PTAL
// If we have a Pod that has been created but is not available we can not make progress. | ||
// We must ensure that all for each Pod, when we create it, all of its predecessors, with respect to its | ||
// ordinal, are Available. | ||
// Since available is superset of Ready, once we have this featuregate enabled by default, we can remove the |
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.
personally I would prefer TODO or some similar label here :-) but don't know what are the conventions for 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.
Done. PTAL
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
3b55b4b
to
82b7478
Compare
/test pull-kubernetes-integration |
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.
A few minor nits, and this can land.
/triage accepted
/priority backlog
/approve
} | ||
|
||
klog.V(1).Infof("%v", currentStatus) |
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 looks like a debug leftover.
status.AvailableReplicas++ | ||
} | ||
} else { | ||
klog.V(4).Infof("minReadySeconds featuregate is disabled") |
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 will be very chatty and unnecessary in most cases, I'd probably drop it.
@@ -486,6 +509,17 @@ func (ssc *defaultStatefulSetControl) updateStatefulSet( | |||
firstUnhealthyPod.Name) | |||
return &status, nil | |||
} | |||
// if we are in monotic mode and the condemned target is not the first unhealthy Pod, block. |
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.
s/monotoic/monotonic
inputSTS *apps.StatefulSet | ||
expectedActiveReplicas int32 | ||
readyDuration time.Duration | ||
enabled 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.
nit: featureGateEnabled to make it explicitly clear what it does
Removing api-change label, which was here b/c the PR was originally based on API changes which landed in separate PR. |
kubernetes#100842 introduced featuregate. This PR implements the logic behind it.
82b7478
to
ceb1dbd
Compare
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
/kind feature
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ravisantoshgudimetla, soltysh 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 |
@@ -1993,6 +2100,7 @@ func scaleUpStatefulSetControl(set *apps.StatefulSet, | |||
if err := invariants(set, spc); err != nil { | |||
return err | |||
} | |||
//fmt.Printf("Ravig pod conditions %v %v", set.Status.ReadyReplicas, *set.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.
This should be removed?
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.
Yup, feel free to open a PR and ping me with it :)
What type of PR is this?
/kind feature
What this PR does / why we need it:
#100842 introduced featuregate. This PR implements the logic behind it.
Which issue(s) this PR fixes:
Partially Fixes# #65098.
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: