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
fix: volume stats disabled when value is negative.(Currently, 0 means defualt 1m) #96675
fix: volume stats disabled when value is negative.(Currently, 0 means defualt 1m) #96675
Conversation
886fd50
to
952e964
Compare
952e964
to
fbcf1e3
Compare
fbcf1e3
to
475b751
Compare
This comment has been minimized.
This comment has been minimized.
475b751
to
5ab8207
Compare
…disable when it is negative like -1s. Signed-off-by: pacoxu <paco.xu@daocloud.io>
5ab8207
to
4901855
Compare
@kubernetes/sig-node-pr-reviews This should be cherry-picked to 1.19 or older versions as well. |
@derekwaynecarr Have you had a chance to look at this? |
/triage accepted |
I'm a bit confused. In the linked code in the first comment, it should be disabled for 0 or any negative number (logic is kubernetes/pkg/kubelet/server/stats/fs_resource_analyzer.go Lines 58 to 63 in e456b45
Where is the |
/priority important-longterm |
kubernetes/cmd/kubelet/app/options/options.go Line 484 in 71331d8
@ehashman 0s will be treated as default 1 minute indeed. |
Okay I found where this gets overridden from 0 to 1m: kubernetes/pkg/kubelet/apis/config/v1beta1/defaults.go Lines 141 to 143 in 5150d2f
/lgtm |
This comment has been minimized.
This comment has been minimized.
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.
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mrunalp, pacoxu 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 |
What type of PR is this?
/kind bug
What this PR does / why we need it:
https://kubernetes.io/docs/reference/command-line-tools-reference/kubelet/
the default value of volume-stats-agg-period is 1m0s
However when it is set to be 0, it means disable.
https://github.com/kubernetes/kubernetes/blob/master/pkg/kubelet/server/stats/fs_resource_analyzer.go#L60-62
I tested it. It will be disabled only if we set it to be '-1s'
I tried to fix it but found that the metav1.Duration default value is zeroDuration, and it cannot decide whether it is 0s or none(not set, which should use default value).
Current logic: 1m0s will be used even you set it to
0s
or0
.So I fix it as a doc issue.
Which issue(s) this PR fixes:
Fixes #96674
Special notes for your reviewer:
I tested it. It will be disabled only if we set it to be '-1s'
Cause:
Does this PR introduce a user-facing change?:
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:
It is very confused to make it different for
none
and0
. So I think doc fix would be a better way IMO.