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
Introduce minReadySeconds in StatefulSets #2607
Introduce minReadySeconds in StatefulSets #2607
Conversation
6f1aedb
to
a43d4b6
Compare
a43d4b6
to
157ad39
Compare
|
||
### Non-Goals | ||
|
||
Moving minReadySeconds to Pod Spec is beyond the scope of this KEP |
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 would describe why, and maybe say a future story could address it based on consistent use. First, the effort to change pod spec would be large (impact). Second, currently our workload controllers are inconsistent and we prioritize consistent of experience over desirable future state (consistency). Third, stateful sets are just different enough from daemonsets and deployments that real world use of minReadySeconds for stateful sets might influence any future design or point in a more appropriate direction (completeness)
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 tried explaining second point in the motivation section. I will add first. Can you expand a bit on completeness(third point) like why do you think the real world use of minReadySeconds for sts might point in a more appropriate direction? I can add that in the use-case section.
/assign |
5bcf727
to
1dd1a00
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.
@ehashman - Thank you for the review. I tried answering your questions, can you PTAL
Add docs from minReadySeconds. xref: kubernetes/enhancements#2607
- The effort to change pod spec would be large. | ||
- Currently our workload controllers are inconsistent and we prioritize consistency of experience. | ||
- StatefulSets are just different enough from daemonsets and deployments that real world use of minReadySeconds | ||
for stateful sets might influence any future design or point in a more appropriate direction (completeness). |
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.
Link to that k/k issue where this was discussed, for reference.
|
||
We are proposing a new field called `minReadySeconds` whose default value will | ||
be 0. In this mode, StatefulSet will behave exactly like its current behavior. | ||
Its possible we introduce a bug in the implementation. The mitigation |
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.
Be more specific about the risk of a bug, namely that we either:
- mark a pod as ready too soon
- mark as ready too late.
and what that might potentially mean.
// Defaults to 0 (pod will be considered available as soon as it is ready) | ||
// This is an alpha field and requires enabling StatefulSetMinReadySeconds feature gate. | ||
// +optional | ||
MinReadySeconds *int32 |
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.
For consistency with other controllers this should not be a pointer, especially that 0 and nil have the same meaning.
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.
Ya, I was thinking about the same but in the apiconventions, it was mentioned that:
- ensure the field is entirely absent from API responses when empty (optional fields should be pointers, anyway) which made me think I should use a pointer. It also helps in setting default values easily as we can distinguish between being set and the default value.
This was also mentioned in the api conventions doc.
Do use pointers to scalars when you need to distinguish between an unset value and an automatic zero value. For example, PodSpec.TerminationGracePeriodSeconds is defined as *int64 the go type definition. A zero value means 0 seconds, and a nil value asks the system to pick a default.
I think the above is the case for us too say if we choose to a non-zero default value in future.
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 spoke with @smarterclayton on slack, and the agreement is that we'll go with non-pointer version.
// Total number of available pods (ready for at least minReadySeconds) targeted by this statefulset. | ||
// This is an alpha field and requires enabling StatefulSetMinReadySeconds feature gate. | ||
// +optional | ||
AvailabileReplicas *int32 |
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.
Ditto.
1dd1a00
to
bddcc53
Compare
bddcc53
to
0acdf52
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
/approve
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
for PRR
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ehashman, 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 |
Hi @ravisantoshgudimetla 👋 1.22 Docs Shadow here. Please follow the steps detailed in the documentation to open a PR against dev-1.22 in the kubernetes/website repo. This PR can be just a placeholder at this time and must be created before Fri July 9, 11:59 PM PDT. Also, take a look at Documenting for a release to familiarize yourself with the docs requirement for the release. Thank you! |
Add docs from minReadySeconds. xref: kubernetes/enhancements#2607
Add docs for StatefulSet minReadySeconds. xref: kubernetes/enhancements#2607
Add docs for StatefulSet minReadySeconds. xref: kubernetes/enhancements#2607
Introduce minReadySeconds in StatefulSets