Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
Loading
from

Conversation

zhifei92
Copy link
Contributor

@zhifei92 zhifei92 commented Dec 25, 2024

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?

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.

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Dec 25, 2024
@k8s-ci-robot
Copy link
Contributor

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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@k8s-ci-robot k8s-ci-robot added area/kubelet sig/node Categorizes an issue or PR as relevant to SIG Node. sig/scalability Categorizes an issue or PR as relevant to SIG Scalability. release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. release-note-none Denotes a PR that doesn't merit a release note. labels Dec 25, 2024
MaxContainers: int(maxContainerCount),
MinAge: time.Duration(0),
MaxPerPodContainer: 1,
MaxContainers: -1,
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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 .

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agree with this

@bart0sh
Copy link
Contributor

bart0sh commented Dec 27, 2024

/triage accepted
/priority important-longterm
/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. triage/accepted Indicates an issue or PR is ready to be actively worked on. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Dec 27, 2024
@sftim
Copy link
Contributor

sftim commented Dec 27, 2024

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.

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jan 6, 2025
@zhifei92 zhifei92 force-pushed the remove-deprecated-flags branch from 091c32d to 441836e Compare January 7, 2025 13:04
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: zhifei92
Once this PR has been reviewed and has the lgtm label, please assign marseel, yujuhong for approval. For more information see the Code Review Process.

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@Shubham82
Copy link
Contributor

@zhifei92, Is there any milestone(v1.33 or later release) we are targeting for this PR to merge?

@Shubham82
Copy link
Contributor

Hi @derekwaynecarr @matthyx @bart0sh
Could you please take a look, so that this PR will merge?

Thanks!

@matthyx
Copy link
Contributor

matthyx commented Feb 18, 2025

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 18, 2025
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 9463749ef2c35f86d7bbbadd02e4e37d17249b3c

@Shubham82
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: zhifei92 Once this PR has been reviewed and has the lgtm label, please assign marseel, yujuhong for approval. For more information see the Code Review Process.

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 /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

Hi @matthyx, as mentioned above, this PR needs approval from the sig-node approver. Could you please take a look?

@matthyx
Copy link
Contributor

matthyx commented Feb 27, 2025

@SergeyKanzhelev PTAL

@Shubham82
Copy link
Contributor

/test pull-kubernetes-cmd

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.")
Copy link
Member

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?

Copy link
Contributor Author

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.

@SergeyKanzhelev
Copy link
Member

SergeyKanzhelev commented Mar 6, 2025

Fixes #127157

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

@zhifei92 zhifei92 force-pushed the remove-deprecated-flags branch from d002961 to 383cb7b Compare March 7, 2025 02:42
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 7, 2025
@k8s-ci-robot
Copy link
Contributor

New changes are detected. LGTM label has been removed.

@zhifei92
Copy link
Contributor Author

zhifei92 commented Mar 7, 2025

/test pull-kubernetes-e2e-gce

@ffromani
Copy link
Contributor

ffromani commented Mar 7, 2025

Fixes #127157

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

was this addressed yet?

@zhifei92
Copy link
Contributor Author

zhifei92 commented Mar 7, 2025

Fixes #127157

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

There is already a part of the explanation in kubernetes/website#48001. Should I open a new PR to cover the content?

@Shubham82
Copy link
Contributor

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.

@zhifei92
Copy link
Contributor Author

The Eviction Manager does indeed use ContainerGC for managing container resources. As for how to achieve similar effects through Eviction Manager, I haven't figured that out yet and need more time to think about it. Currently, ContainerGC is effective in two places at the same time, which is indeed unnecessary.

@SergeyKanzhelev
Copy link
Member

The Eviction Manager does indeed use ContainerGC for managing container resources. As for how to achieve similar effects through Eviction Manager, I haven't figured that out yet and need more time to think about it. Currently, ContainerGC is effective in two places at the same time, which is indeed unnecessary.

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

@SergeyKanzhelev SergeyKanzhelev moved this from PRs - Needs Approver to PRs Waiting on Author in SIG Node CI/Test Board Mar 19, 2025
@Shubham82
Copy link
Contributor

Shubham82 commented Mar 24, 2025

JFI: As it is mentioned here we can use --eviction-hard or --eviction-soft instead of these deprecated flags.

cc @derekwaynecarr (as the author of Kubelet - Eviction Policy) could please take a look?

@haircommander haircommander moved this from PRs Waiting on Author to PRs - Needs Reviewer in SIG Node CI/Test Board Apr 30, 2025
@SergeyKanzhelev SergeyKanzhelev moved this from Needs Approver to Needs Reviewer in SIG Node: code and documentation PRs May 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/kubelet cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/node Categorizes an issue or PR as relevant to SIG Node. sig/scalability Categorizes an issue or PR as relevant to SIG Scalability. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
Status: PRs - Needs Reviewer
Development

Successfully merging this pull request may close these issues.

Unclear with Container garbage collection configuration
8 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.