-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Add support to disable /debug/pprof and /debug/flags/v endpoint #98458
Conversation
c38c93d
to
14d5a9a
Compare
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. |
a880668
to
e109cd3
Compare
Second commit is mostly to improve readability and make future enhancements easier - a880668 |
c6cdc99
to
3944e1d
Compare
/triage accepted |
/retest |
Release note claims:
However I don't see any code enforcing that. Maybe the implementation happens to work this way but it's not easy at all to verify. Apart from this the api is fine. I think it's important that these things don't suddenly turn on for people who have them off currently. |
Thank you for reviewing the PR @lavalamp :) We are using we enforce that here - https://github.com/kubernetes/kubernetes/pull/98458/files#diff-c3e7f724d1b0dcee40df80716ed57d90d2649710150fa92bf9822bdad35e0429R239 |
I guess I'm not sure why you install a "not turned on" handler if it is off? I think it would be easier to audit if the section of code you linked me to was just if statements. I also don't really like that this is so inconsistent with how apiserver handles this, but I don't know that anything can be done about that. Anyway, kubelet is not my binary so I don't really have a strong opinion, if you all are certain enough then that's fine. For the API: |
If its |
@lavalamp is it due to the fact that single --profiling cmd line argument takes care of turning off /debug/pprof and /debug/flags/v endpoints in ApiServer but we are turning off in Kubelet with two different flags? (our thought process is documented here for reference #84165 (comment)) or is it in general how Kubelet handles these handlers. |
Co-authored-by: xiaofei.sun <sunxiaofei@kuaishou.com> Co-authored-by: SaranBalaji90 <srisaranbalaji@gmail.com>
3944e1d
to
51c5401
Compare
Yes, I understood, I just am not sure why that's desirable. |
Ah ok.. I can remove if we don't need to return anything.. I added with assumption that it provides better wording(UX) when disabled. |
From what I can see the latest update has changed quite a bit from the last... @sjenning can you PTAL? |
It's up to the Kubelet owners. :) |
51c5401
to
af05a7e
Compare
looks like there was some log format changes in master which was missed after rebase. Fixed it now :) |
/approve @andrewsykim maybe you can help restructure this in a follow-on to make the code path clearer per @lavalamp comments as part of overall |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: derekwaynecarr, dims, lavalamp, SaranBalaji90, sjenning 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 |
Co-authored-by: xiaofei.sun sunxiaofei@kuaishou.com
Co-authored-by: SaranBalaji90 srisaranbalaji@gmail.com
What type of PR is this?
/kind feature
What this PR does / why we need it:
This PR adds
"EnableProfilingHandler"
and"EnableDebugFlagsHandler"
flag to kubelet configuration similar to"EnableSystemLogHandler"
. Based on the value ofEnableProfilingHandler
,/debug/pprof
endpoint will be made available in kubelet and similarly based on"EnableDebugFlagsHandler"
,/debug/flags
will be enabled . Default value for these flag is true.Special notes for your reviewer:
This change is similar to #87273
Special credit to xiaoanyunfei@ for the initial commit.
Which issue(s) this PR fixes:
Fixes #84165
Does this PR introduce a user-facing change?:
/sig node
Testing result:
Updated
/etc/kubernetes/kubelet/kubelet-config.json
with the following valuesAfter updating the values to
true
again/sig node
/area kubelet
/assign @derekwaynecarr
/assign @dchen1107