-
Notifications
You must be signed in to change notification settings - Fork 39.8k
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
apf: exempt probes /healthz /livez /readyz #100678
Conversation
/assign @deads2k @MikeSpreitzer |
Is this the right thing to do? Isn't it common for unathenticated users to have access to these endpoints? |
This PR may require API review. If so, when the changes are ready, complete the pre-review checklist and request an API review. Status of requested reviews is tracked in the API Review project. |
kubelet liveness probe gets a Is your concern that a bad actor can drown the apiserver with probe requests and bring it down? I think the health checks in the apiserver are designed to be asynchronous and these are very cheap. But yeah, making it exempt does leave a window open. An alternative is to use a dedicated non-exempt priority level (maybe with a small concurrency share) |
@kubernetes/sig-api-machinery-bugs |
/triage accepted |
/priority important-soon |
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.
// the following flow schema exempts probes | ||
SuggestedFlowSchemaProbes = newFlowSchema( | ||
"probes", "exempt", 2, | ||
flowcontrol.FlowDistinguisherMethodByUserType, |
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.
The choice of flow distinguisher method is not obvious. Since these requests are exempt and thus not queued, there is no wrong answer from a functional point of view. Why not go with the simplest choice, the one that makes the flow distinguisher always be the empty string? Specifying something more specific suggests there is a reason, which would be misleading to readers if there is not a reason. Is there thinking that this will produce better metrics or debug output or something? If there is a positive reason, it would be best to comment it, since it is not obvious.
I guess the right thing to do is to figure out what user kubelet identifies as and make only kubelet exempt. I have conflicting feelings about that, however, like imagine we get into a situation where all the queues go into a deadlock, but exempt requests are getting handled fine. Then the proper thing would be for kubelet to restart apiserver, but it will appear as if apiserver is perfectly happy. I guess maybe instead of relying on the health check itself going through the system, we should make them exempt and somehow continuously test the queues ourselves, and report a health failure if they are stuck for a long time? E.g., we could periodically insert sentry requests in each PL and verify that they actually eventually get handled or canceled. Anyway I agree restarting healthy apiservers is quite bad and we should prevent that. But failing to restart unhealthy apiservers is also bad! |
So I grabbed the kubelet probes for
It appears as The audit is taken from an OpenShift cluster, and I assume it will be the same for other clusters as well. |
Long term, we need to make sure kubelet has its own account. We probably can't block on that. People can always change this back on individual clusters if it gets abused, I guess. |
/approve (with the understanding that @tkashem is going to start a conversation with SIG Auth about them getting kubelet its own identity somehow) |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: lavalamp, MikeSpreitzer, tkashem 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 |
/retest Review the full test history for this PR. Silence the bot with an |
opened an issue #100844 to have a discussion on this |
…678-upstream-release-1.21 Automated cherry pick of #100678: apf: exempt probes /healthz /livez /readyz
…678-upstream-release-1.20 Automated cherry pick of #100678: apf: exempt probes /healthz /livez /readyz
…678-upstream-release-1.18 Automated cherry pick of #100678: apf: exempt probes /healthz /livez /readyz
…678-upstream-release-1.19 Automated cherry pick of #100678: apf: exempt probes /healthz /livez /readyz
What type of PR is this?
/kind bug
What this PR does / why we need it:
Add a FlowSchema that exempts the following probes from any user:
/readyz
/livez
/healthz
Which issue(s) this PR fixes:
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: