-
Notifications
You must be signed in to change notification settings - Fork 40.7k
cleanup: Remove deprecated containerGC flags from kubelet. #129391
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
Hi @zhifei92. 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. |
pkg/kubelet/kubelet.go
Outdated
MaxContainers: int(maxContainerCount), | ||
MinAge: time.Duration(0), | ||
MaxPerPodContainer: 1, | ||
MaxContainers: -1, |
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.
Is this policy used somewhere outside of GC? If not, should we remove it?
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.
Is this policy used somewhere outside of GC? If not, should we remove it?
The policy is not used outside of GC, but removing it would affect the current behavior of GC.
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.
Initializing directly within NewContainerGC
might be more reasonable.
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.
As all fields are set to static values, we may want to refactor GC code or even get rid of (some of) it if possible. For example MinAge 0 is asking for refactoring of func (cgc *containerGC) evictableContainers
, with MaxContainer -1 (cgc *containerGC) evictContainers
could be simplified, etc .
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.
agree with this
/triage accepted |
Changelog tweak suggestion -Removed deprecated kubelet containerGC flags: `--minimum-container-ttl-duration`, `--maximum-dead-containers`, and `--maximum-dead-containers-per-container`. These options were previously deprecated and are now fully removed to enhance kubelet performance. Users who utilized these flags should update their configurations before upgrading.
+Removed several deprecated kubelet command line arguments for container garbage collection: `--minimum-container-ttl-duration`, `--maximum-dead-containers`, and `--maximum-dead-containers-per-container`. These arguments were previously deprecated and are now fully removed. Users who utilized these arguments should update their configurations before upgrading. |
091c32d
to
441836e
Compare
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: zhifei92 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 |
@zhifei92, Is there any milestone(v1.33 or later release) we are targeting for this PR to merge? |
Hi @derekwaynecarr @matthyx @bart0sh Thanks! |
/lgtm |
LGTM label has been added. Git tree hash: 9463749ef2c35f86d7bbbadd02e4e37d17249b3c
|
Hi @matthyx, as mentioned above, this PR needs approval from the sig-node approver. Could you please take a look? |
@SergeyKanzhelev PTAL |
/test pull-kubernetes-cmd |
cmd/kubelet/app/options/options.go
Outdated
fs.MarkDeprecated("minimum-container-ttl-duration", "Use --eviction-hard or --eviction-soft instead. Will be removed in a future version.") | ||
fs.Int32Var(&f.MaxPerPodContainerCount, "maximum-dead-containers-per-container", f.MaxPerPodContainerCount, "Maximum number of old instances to retain per container. Each container takes up some disk space.") | ||
fs.MarkDeprecated("maximum-dead-containers-per-container", "Use --eviction-hard or --eviction-soft instead. Will be removed in a future version.") | ||
fs.Int32Var(&f.MaxContainerCount, "maximum-dead-containers", f.MaxContainerCount, "Maximum number of old instances of containers to retain globally. Each container takes up some disk space. To disable, set to a negative number.") | ||
fs.MarkDeprecated("maximum-dead-containers", "Use --eviction-hard or --eviction-soft instead. Will be removed in a future version.") |
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.
why keep this marking as deprecated?
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.
Missed this one; it has been deleted.
Before accepting this PR, can you please write a small document on how to migrate from using these flags to the eviction? How much functionality is being lost with this removal? Perhaps it can be an extension of this update: kubernetes/website#48001 |
d002961
to
383cb7b
Compare
New changes are detected. LGTM label has been removed. |
/test pull-kubernetes-e2e-gce |
was this addressed yet? |
There is already a part of the explanation in kubernetes/website#48001. Should I open a new PR to cover the content? |
@zhifei92, as there has been no update on the PR for a long time, it would be good if you open a new docs PR for it so that this PR will be merged soon. |
The |
Since we do not know whether this functionality is still being used, some transitioning instructions are needed before removing those options. The PR: kubernetes/website#48001 doesn't contain those details |
JFI: As it is mentioned here we can use cc @derekwaynecarr (as the author of Kubelet - Eviction Policy) could please take a look? |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
Remove deprecated containerGC flags from kubelet, to encourage the use of the eviction mechanism instead.
Which issue(s) this PR fixes:
Fixes #127157
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: