-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 configurable container minimum memory limit #7832
Add configurable container minimum memory limit #7832
Conversation
Hi @roman-kiselenko. Thanks for your PR. I"m waiting for a cri-o 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/test-infra repository. |
/ok-to-test |
@roman-kiselenko do you mind rebasing on top of the latest |
It"s not ready yet, I"m almost done with the implementation, and after adding some test will perform rebase and request the review. 🙏 |
f24bec4
to
56871bd
Compare
56871bd
to
e496350
Compare
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #7832 +/- ##
==========================================
+ Coverage 48.94% 49.82% +0.88%
==========================================
Files 151 153 +2
Lines 16426 16635 +209
==========================================
+ Hits 8039 8288 +249
+ Misses 7412 7324 -88
- Partials 975 1023 +48 |
@roman-kiselenko, looks great so far! Thank you! 🚀 Some ideas on how this would be deployed.
(somewhere within the code base) const defaultContainerMinimumMemory = 7.5 * 1024 * 1024 // 7.5 MiB
A default of 7.5 or 12 MiB (something that remains to be seen) is overridden by the following: (within a crio.conf configuration file) [crio.runtime]
container_minimum_memory = "7680K" Which then overrides this setting for a specific runtime, such as [crio.runtime.runtimes.crun]
container_minimum_memory = "384K" (somewhere in the terminal on the commnad-line) Above, irregardless where the value was set, can be then overridden with directly specifying value via a command-line switch such as the Since both Docker and Podman allow users to supply values using more of a human-friendly way, such as ability to provide units next to values, which makes it easier to say 7.5M (or 7.5m) to denote 7.5 MiB rather than 7864320 (bytes), which is easy to get wrong. This parsing and conversion to bytes can be done using the Granted, this then makes it a little more inconvenient to deal with in therm of the type of the field with a corresponding configuration type (as in, Go type, that is). However, since this value is used once when setting up cgroups into which the container will be place, so at a very beginning, then there is no need to cache this and a calculation of a bytes value on-the-fly via some helper would be fine, I belive. Thoughts? |
38a0c39
to
40655e5
Compare
@kwilczynski SGTM. I"ve done changes from int64 to string representation, going to add some tests now. |
5873249
to
262b873
Compare
2696308
to
74dfb15
Compare
Added some integration tests, PTAL |
1262fab
to
f30f8fc
Compare
--runtimes:container_min_memory Signed-off-by: roman-kiselenko <[email protected]>
cbde2ec
to
9bac613
Compare
/retest |
@cri-o/cri-o-maintainers, please have another look at this! Thank you! |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: haircommander, kwilczynski, roman-kiselenko, saschagrunert 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 |
/unhold |
/cherry-pick release-1.29 |
@kwilczynski: cannot checkout In response to this:
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. |
@kwilczynski: #7832 failed to apply on top of branch "release-1.29":
In response to this:
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. |
OK. Requires manual cherry-pick. |
What type of PR is this?
/kind feature
What this PR does / why we need it:
Provide a way to configure container minimum memory limit per OCI runtime.
Which issue(s) this PR fixes:
Fixes #7694
Special notes for your reviewer:
None
Does this PR introduce a user-facing change?