-
Notifications
You must be signed in to change notification settings - Fork 38.6k
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
StatefulSet reports wrong replica count after pod creation #120732
Comments
This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The 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. |
/sig apps |
/assign |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /close not-planned |
@k8s-triage-robot: Closing this issue, marking it as "Not Planned". In response to this:
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. |
What happened?
StatefulSet controller updates the status of a StatefulSet object with
Replicas
, which is the count of all existing pods. Immediately after successfully creating pods, StatefulSet ignores them, showing a lower replica count than expect. The replica count is updated correctly the next time StatfulSet object is processed (usually within a couple of seconds).The status self-recovers quickly. However, as the same value is used in some checks related to rolling update, the impact can be serious, as seen in #119685. These checks are being fixed in #120731, but we should also fix the status.
Proposed solution: update creation timestamp of successfully created replicas (around https://github.com/kubernetes/kubernetes/blob/master/pkg/controller/statefulset/stateful_set_control.go#L420). They should be processed correctly then.
What did you expect to happen?
StatefulSet should immediately calculate the replica count correctly.
How can we reproduce it (as minimally and precisely as possible)?
Alternatively, StatefulSet status can be monitored in another way (for example frequently fetched via k8s API) and correlated with pod creation times.
Anything else we need to know?
No response
Kubernetes version
1.28.0 and later
1.27.4 and later
Cloud provider
N/A
/sig apps
The text was updated successfully, but these errors were encountered: