-
Notifications
You must be signed in to change notification settings - Fork 117
[bugfix] fix StatefulsetReady check #705
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
base: main
Are you sure you want to change the base?
[bugfix] fix StatefulsetReady check #705
Conversation
✅ Deploy Preview for kubernetes-sigs-lws canceled.
|
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: LuyuZhang00 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 @LuyuZhang00. Thanks for your PR. I'm waiting for a github.com 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-sigs/prow repository. |
|
/ok-to-test |
|
Why would you not choose AvailableReplicas? That seems even better than ReadyReplicas if MinReady is set. |
What type of PR is this?
/kind bug
We noticed that when the pods in the worker StatefulSet (sts) have been created but are not yet ready, the sts is still considered "ready", which doesn't match the expected behavior. We found that the sts has three parameters used to determine its readiness status(/go/pkg/mod/k8s.io/[email protected]/apps/v1/types.go) :
Replicas: The number of Pods created by the StatefulSet controller. This includes pods in all states (Running, Pending, Unknown, etc.) and does not consider whether the pods are ready or available.ReadyReplicas: The number of pods created for this StatefulSet with a Ready Condition. This requires the pods to be in the Running state and for all their containers to have passed the readiness probe.AvailableReplicas: Total number of available pods (ready for at least minReadySeconds) targeted by this statefulset. In addition to being "ready" (as defined by ReadyReplicas), the pods must have been running for at least the duration specified by minReadySeconds. The minReadySeconds defaults to 0s, which makes it behave the same as ReadyReplicas. However, when a specific value is set, it provides the Pod with a sufficient stable running timeBased on the current situation, using ReadyReplicas may be a better choice to determine the ready status of a StatefulSet
cc @Edwinhr716 @kerthcet