-
Notifications
You must be signed in to change notification settings - Fork 41.3k
kubelet: fix pod ready state flips after kubelet restart #133770
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: master
Are you sure you want to change the base?
Conversation
Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it. 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. |
The committers listed above are authorized under a signed CLA. |
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-sigs/prow repository. |
Welcome @x-zl! |
Hi @x-zl. Thanks for your PR. I'm waiting for a kubernetes 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. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: x-zl 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 |
/hold @HirazawaUi is already working on fixing this issue and has created a KEP. It would be redundant effort, so I think it’s better to review the KEP and provide feedback if you have any concerns. KEP: kubernetes/enhancements#5493 |
Yes, fixing this issue is not particularly complex, and there are multiple approaches to resolve it. However, it might break some of our existing use cases, so extra caution is needed when addressing it, along with further discussion. If you would like to help advance this issue toward a resolution, feel free to share your opions on kubernetes/enhancements#5493. |
PR needs rebase. 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. |
What type of PR is this?
/kind bug
What this PR does / why we need it:
Currently, after kubelet restart, if a pod has readiness probe, the ready state will flip:
Ready pod: ready --> not ready --> ready
Not ready pod: not ready --> ready --> not ready
Which issue(s) this PR is related to:
Fixes #131303
Special notes for your reviewer:
Root Cause:
In the probeManager.UpdatePodStatus function, pods that don't have readiness workers found will have their ready status set to true by default. However, during kubelet restart, when this function is called, kubelet hasn't yet added this pod's readiness to the probeManager's workers, so not-ready pods will briefly become ready until the next probe completes.
Meanwhile, when probeManager calls the newWorker function, readiness.initialValue is constantly set to Failure, which causes originally ready pods to briefly change from ready to not-ready until the next probe completes.
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: