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

reasonable --image-gc-high-threshold #4739

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

Conversation

olderTaoist
Copy link

@olderTaoist olderTaoist commented Jun 19, 2024

KEP-4120: add ImageGCBeforeStorageEviction feature gate to kubelet

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jun 19, 2024
@k8s-ci-robot
Copy link
Contributor

Hi @olderTaoist. 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 needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. kind/kep Categorizes KEP tracking issues and PRs modifying the KEP directory sig/node Categorizes an issue or PR as relevant to SIG Node. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jun 19, 2024
@olderTaoist
Copy link
Author

@haircommander @SergeyKanzhelev discuss here

@bart0sh
Copy link
Contributor

bart0sh commented Jun 25, 2024

/ok-to-test
/cc @SergeyKanzhelev

@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 Jun 25, 2024
Copy link

linux-foundation-easycla bot commented Jun 26, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

@k8s-ci-robot k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. and removed cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jun 26, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: olderTaoist
Once this PR has been reviewed and has the lgtm label, please assign dchen1107, jpbetz for approval. For more information see the Kubernetes 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

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Jun 26, 2024
@olderTaoist
Copy link
Author

@haircommander @SergeyKanzhelev please review again


### Goals

discuss reasonable values of `--image-gc-high-threshold` for different scenarios, and constrain them by some means.
Copy link
Contributor

Choose a reason for hiding this comment

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

I think generally a goal should be: protect users from inopportune configurations, and fix the defaults so they make more sense

Copy link
Author

Choose a reason for hiding this comment

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

You said it more summarily. To protect users from inopportune configurations, we should first figure out the needs of users in different scenarios, and then take corresponding protection measures. What you say can be part of the goal.


#### Story 2

Keep the current usage that turn off image garbage collection by setting `--image-gc-high-threshold` 100%.
Copy link
Contributor

Choose a reason for hiding this comment

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

isn't this possible already today?

Copy link
Author

Choose a reason for hiding this comment

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

yeah, i'm just illustrating different scenarios

Copy link
Contributor

Choose a reason for hiding this comment

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

I think typically the user stories are more like "what problem does adding this feature solve". in this case, it's really "As a new cluster admin, I'd like for image garbage collection to trigger before a node is under disk pressure, and would like validation to protect that expectation". The two scenarios you've described are available today, it's just not the default, and when an admin misconfigures, they get no insight

### Monitoring Requirements

Monitor the metrics
- "kubelet_image_gc_before_storage_eviction" that contains `image-gc-threshold` and `imagefs-available` labels
Copy link
Contributor

Choose a reason for hiding this comment

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

specifically: I think this metric should say whether the image-gc-threshold is higher than 100-imagefs-available , which would be a breaking configuration in the future

Copy link
Author

Choose a reason for hiding this comment

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

The value of the metric is exactly what you mean, with 1 for image-gc-threshold greater than 100-imagefs-available and 0 for image-gc-threshold less than or equal to 100-imagefs-available, the metric labels let users see intuitively the value of the corresponding configuration

@olderTaoist
Copy link
Author

@haircommander @SergeyKanzhelev PTAL

- Impact of its outage on the feature:
- Impact of its degraded performance or high-error rates on the feature:
-->

Copy link
Contributor

Choose a reason for hiding this comment

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

you'll want to put N/A for any section that's not relevant, but some of these may be.

Copy link
Author

Choose a reason for hiding this comment

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

done


approvers:
- "@haircommander"
- "@SergeyKanzhelev"
Copy link
Contributor

Choose a reason for hiding this comment

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

we'll need a sig node approver for this, but we won't determine that until 1.32 cycle begins, so we needn't update it now

Copy link
Author

Choose a reason for hiding this comment

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

i change to TBD

@olderTaoist
Copy link
Author

@SergeyKanzhelev @haircommander PTAL

## Design Details

Add `ImageGCBeforeStorageEviction` feature gate to kubelet.
When the feature is turned on, the value of `--image-gc-high-threshold` must be smaller than value of `100 - imagefs.available`.
Copy link
Contributor

Choose a reason for hiding this comment

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

If the value of --image-gc-high-threshold is not less than "100 - imagefs.available", what will kubelet do? Will it panic, or will this field become ineffective? Can you explain this in detail here?

##### Unit tests


- `pkg/kubelet/apis/config/validation`: `-:-:-` - `0%`
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is the test coverage 0%? The test coverage of the latest master branch is 97.1%.

Copy link
Author

Choose a reason for hiding this comment

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

sorry, just figured out what Unit tests means. already updated as https://testgrid.k8s.io/sig-testing-canaries#ci-kubernetes-coverage-unit stated.

## Design Details

Add `ImageGCBeforeStorageEviction` feature gate to kubelet.
When the feature is turned on, the value of `--image-gc-high-threshold` must be smaller than value of `100 - imagefs.available`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Will we change the default value of --image-gc-high-threshold? What will it be changed to? Please also explain this here.

Copy link
Author

Choose a reason for hiding this comment

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

done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/kep Categorizes KEP tracking issues and PRs modifying the KEP directory ok-to-test Indicates a non-member PR verified by an org member that is safe to test. sig/node Categorizes an issue or PR as relevant to SIG Node. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
Status: Needs Reviewer
Development

Successfully merging this pull request may close these issues.

None yet

6 participants