Skip to content
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 image garbage collection #9832

Merged

Conversation

zhan9san
Copy link
Contributor

@zhan9san zhan9san commented Feb 25, 2023

What type of PR is this?
/kind feature

What this PR does / why we need it:
Customize the imageGCHighThresholdPercent and imageGCLowThresholdPercent values in the kubelet config
Which issue(s) this PR fixes:

Fixes #9815

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

Allow to configure image garbage collection (using `kubelet_image_gc_high_threshold` and `kubelet_image_gc_low_threshold`)

@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Feb 25, 2023
@k8s-ci-robot
Copy link
Contributor

Welcome @zhan9san!

It looks like this is your first PR to kubernetes-sigs/kubespray 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/kubespray has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Feb 25, 2023
@k8s-ci-robot
Copy link
Contributor

Hi @zhan9san. Thanks for your PR.

I'm waiting for a kubernetes-sigs 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/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Feb 25, 2023
Copy link
Contributor

@oomichi oomichi left a comment

Choose a reason for hiding this comment

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

Looks interesting feature, just one comment.

/cc @oomichi

docs/vars.md Outdated
@@ -205,6 +205,10 @@ Stack](https://github.com/kubernetes-sigs/kubespray/blob/master/docs/dns-stack.m

* *kubelet_streaming_connection_idle_timeout* - Set the maximum time a streaming connection can be idle before the connection is automatically closed.

* *kubelet_image_gc_high_threshold* - Set the percent of disk usage before which image garbage collection is never run.

* *kubelet_image_gc_low_threshold* - Set the percent of disk usage before which image garbage collection is never run .
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we describe different explanation with the above kubelet_image_gc_high_threshold?
Current description is completely same and it is hard to know the difference from that.
In addition, it is nice to describe some example values for those options.
(I was wondering we need to specify 90 or 90%)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry, it's a typo.

It is fixed, and the commits are squashed.

@zhan9san zhan9san force-pushed the feature/image-grabage-collection branch from 6e714de to 64f7597 Compare February 27, 2023 02:05
@yankay
Copy link
Member

yankay commented Feb 27, 2023

Thanks @zhan9san
/ok-to-test
/lgtm

@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. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Feb 27, 2023
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 27, 2023
Copy link
Member

@floryut floryut left a comment

Choose a reason for hiding this comment

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

@zhan9san Thank you for the PR

Not sure if a default var should be set in default, but this is not always done so fine by me

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: floryut, zhan9san

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 27, 2023
@k8s-ci-robot k8s-ci-robot merged commit 62f34c6 into kubernetes-sigs:master Feb 27, 2023
@zhan9san zhan9san deleted the feature/image-grabage-collection branch February 27, 2023 08:44
@zhan9san
Copy link
Contributor Author

@floryut

Not sure if a default var should be set in default, but this is not always done so fine by me

IMO, there is no need to set the default value in kubespray, as it will respect the default value in kubelet.

As we can see, this item is not used frequently, the advanced usage can set it explicitly.

The default value is set in kubelet, https://github.com/kubernetes/kubelet/blob/fafeddfbd4f5bc495a54bd856f815fd018ea1e61/config/v1beta1/types.go#L291-L306

If they are not defined, no item would be set in config by kubespray, https://github.com/kubernetes-sigs/kubespray/pull/9832/files#diff-b0825d62030b3a7901d61f15022353f8f2592796f007db00a4fafbe6d17c3a94R150-R155

HoKim98 pushed a commit to ulagbulag/kubespray that referenced this pull request Mar 8, 2023
HoKim98 pushed a commit to ulagbulag/kubespray that referenced this pull request Mar 8, 2023
nolimitkun pushed a commit to nolimitkun/kubespray that referenced this pull request Mar 19, 2023
@sathieu
Copy link
Contributor

sathieu commented May 10, 2023

Maybe this PR was not needed, because kubelet_config_extra_args exists.

@floryut
Copy link
Member

floryut commented May 10, 2023

Maybe this PR was not needed, because kubelet_config_extra_args exists.

You are kind of right, but it is easier for end user to configure them when presented that way, I'm incline to only have corner case args set using extra_args, and common one using vars

@yankay yankay mentioned this pull request May 15, 2023
pedro-peter pushed a commit to pedro-peter/kubespray that referenced this pull request May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Override default image grabage collection in kubelet config
6 participants