Warn people about mistaking "M" suffix for "m" when setting resource limits
Although it's not recommended, we also support 'm' as an unit for memory which means milli-bytes.
https://github.com/kubernetes/apimachinery/blob/master/pkg/api/resource/quantity.go#L46
We need to document it.
https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-memory
@dialogbox can you explain why? I imagine it's in case someone writes a quantity as, eg, 256m meaning 256Mi, and they don't realize their error?
We do document quantities: https://kubernetes.io/docs/reference/glossary/?all=true#term-quantity
/priority awaiting-more-evidence /language en
@sftim Yes. That is exactly the case. Although we have a document about the general quantities, this page would be the page someone who is searching about memory configuration.
And since this page also mentions but only mentions E, P, T, G, M, k, and since 'm' just works, I saw some people blindly assumed that the 'm' means 'Mega'. This might not be a big problem for resource limits because the differences are so huge like 1/1,000,000,000, most likely this mistake will cause cgroup OOM. However, when it comes to the resource requests, it's not easy to know there is some mistake. But pod scheduling might work incorrectly because the the requests is incorrect.
So I'm requesting to add this as a kind of warning.
/triage accepted /kind feature /priority backlog /help /language en
Thanks for clarifying. Let's try to use a glossary tooltip for what we mean by “quantity”, too, if we can.
@sftim: This request has been marked as needing help from a contributor.
Guidelines
Please ensure that the issue body includes answers to the following questions:
- Why are we solving this issue?
- To address this issue, are there any code changes? If there are code changes, what needs to be done in the code and what places can the assignee treat as reference points?
- Does this issue have zero to low barrier of entry?
- How can the assignee reach out to you for help?
For more details on the requirements of such an issue, please see here and ensure that they are met.
If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-help command.
In response to this:
/triage accepted /kind feature /priority backlog /help /language en
Thanks for clarifying. Let's try to use a glossary tooltip for what we mean by “quantity”, too, if we can.
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.
/retitle Warn people about mistaking "M" suffix for "m" when setting resource limits
Hi, I would like to work on this.
/assign
I was thinking to solve the PR in the following manner:
- On the page https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-memory I will add 'm (milli)' in the list of suffixes.
- Before the example I would include a
Caution/ NotementioningWhile setting resource limits one should not mistake the m (mili) suffix as M (mega) suffix as similar unit of memory.(I will change this text to a more suitable one) - In the same Note/Caution I will try to add the glossary tooltip for memory.
@sftim @dialogbox Could be you please provide your inputs for my method above to fix this PR. Thanks.
@Babapool I love the idea of having the Caution/ Note. Can you please add the comment to the https://github.com/kubernetes/website/pull/30501?
@dialogbox Let me ask the reviewers on #30501 on how to proceed on the same and as per their advice/suggestion I will do the necessary changes as I have no experience on editing already generated PRs.
@dialogbox Since you have squashed and merged the commits in #30501 can ask whether I could add the Caution/Note part ?
@Babapool I think making it as caution/note is a reasonable idea but I'm not sure if others would agree on that. How about keep having discussion here and filing a new pr for adding Caution/Note once we got concluded?
@dialogbox Thanks I will ask them again the PR conversation.
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas applied, the issue is closed
You can:
- Mark this issue or PR as fresh with
/remove-lifecycle stale - Mark this issue or PR as rotten with
/lifecycle rotten - Close this issue or PR with
/close - Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
/remove-lifecycle stale
This issue is fixed by PR #30501. I believe that this issue can be closed. Thanks.
/close
@sftim: Closing this issue.
In response to this:
/close
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.